Help with code.

Status
This thread has been locked.

Backflip

Extremely Well-Known Member
Banned
Feedback score
5
Posts
248
Reactions
88
Resources
0
I am having trouble while triying to filter URLS/IPs in chat. I never done this before so I have little clue.

Someone can help me? Here is what I have:


Yes, I know that setBanned is deprecated. Im just testing
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/resource-scam-report.325273/)

Backflip

Extremely Well-Known Member
Banned
Feedback score
5
Posts
248
Reactions
88
Resources
0
No one? D:
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/resource-scam-report.325273/)

Elina

Ellie
Premium
Feedback score
3
Posts
32
Reactions
11
Resources
0
1. If you set someone "banned" they don't actually get kicked (unless you do so yourself) so would be annoying to check, no? Maybe sending them a message would be a better option to go for instead of banning yourself.
2. Why not always keep the regex compiled as a constant?
3. You need the annotation @EventHandler above your listener block.
4. https://regex101.com/ haven't checked regex, if you haven't either that is a good site to check it on (and learn regex is applicable)

The rest should be fine theoretically, sorry if I sound snappy, I just woke up and haven't had coffee.
 

Quokka

Manager & Developer
Premium
Feedback score
3
Posts
213
Reactions
94
Resources
0
Also just a reminder, deprecated does not mean unusable. It just may mean that future Spigot versions may not support it.
 
Status
This thread has been locked.
Top