Change botspam to ignore symbols
This commit is contained in:
parent
2b00363bfc
commit
d8f7a998ef
@ -24,7 +24,7 @@ public class SpamText
|
||||
public boolean isSpam(String message)
|
||||
{
|
||||
//System.out.println(message.toLowerCase() + " vs " + _text.toLowerCase() + " == " + message.toLowerCase().contains(_text.toLowerCase()));
|
||||
return message.toLowerCase().contains(_text.toLowerCase());
|
||||
return clean(message).contains(clean(_text));
|
||||
}
|
||||
|
||||
public int getId()
|
||||
@ -76,4 +76,10 @@ public class SpamText
|
||||
{
|
||||
_disabledBy = disabledBy;
|
||||
}
|
||||
|
||||
private static String clean(String text)
|
||||
{
|
||||
// Replace all non alphanumeric/whitespace characters
|
||||
return text.toLowerCase().replaceAll("[^\\w\\d\\s]", "");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user