Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void bannedWordsFilter(String sentMessage2) {
- //only moderate if the bot is modded on the channel and the sender is not a mod! this is important
- ModElement e1= new ModElement(nick, targetChannel);
- ModElement e2= new ModElement(sender, targetChannel);
- boolean allow1=false;
- boolean deny2=false;
- if(lists.getModlist().contains(e1)) allow1=true;
- if(lists.getModlist().contains(e2)) deny2=true;
- if(allow1&&!deny2){
- //modding method
- for(BannedWordElement e : lists.getBannedWords()){
- Pattern p=Pattern.compile(e.word.toLowerCase());
- Matcher m=p.matcher(sentMessage2.toLowerCase());
- if(m.find() &&(e.channel.contentEquals("all")||e.channel.contentEquals(targetChannel))){
- if(e.level==BannedWordElement.BAN) sendBAN(targetChannel, sender);
- else sendTO(targetChannel, sender, e.level);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement