Block some usernames from being shown in text alerts


Hi. I’m using the alerts on my bot, both on Twitch and Discord. Recently I’ve started getting new followers with offensive nicknames (containing insults, blaphemies and things like that) and I wanna block the bot from showing alerts for those nickname and eventually from showing alerts for nicknames containing certain words. Is it possibile and eventually how?


Sure it’d be possible but I don’t think it’d be something phantombot would support (As in, it may not be seen in a main build). Reason being is I see something like that slightly slowing down these alert events.

Would it only be follow alerts you want to filter or what? The more information the better.

Note that this will require core script modification, which means any time you update the bot you will have to redo this, and that you should make backups before doing any form of modification.


I think the filter I’d need would be on new followers and hosts or, in other words, any alert that doesn’t involve money, cause I can tell you from my experience that this stupid kind of people won’t ever sub or send tips or bits to let their offensive nicknames appear on alerts.


So I’m thinking a text list that would be loaded on bot-launch. It’d be nearly identical to the one that’s used for the top-lists (see /addons/ignorebots.txt). Instead of bot names, though, you would put offending words on each line.

From there it’d just be modifying the scripts for the alerts. If I write the code I’d probably but all the code I can into a custom script, and have the custom script ‘expose’ a function that can be used in others. That way we can keep modification of core scripts to a minimal.


There are so many creative ways of making offensive usernames that there’s no way to stop them. Twitch has filters, and people can clearly bypass them, same goes if we make filter. Just ignoring it seems to be the best way to stop these people nowadays. Even if we did have a list, the alert would have to popup once for you to add it to the list afterwards, which by then the bot has it cached and it will never be shown again.


Why not doing something like the RegEx function on blacklist but for the usernames? I wouldn’t care about the delay, idk why but the bot for me shows the alerts in chat with some delay already, so it wouldn’t change much.


We only pull the API every 30 seconds, hence the delay. Also, regex gets hard to handle when it comes to the average user, we’d have to implement a bunch of check just to be sure a user doesn’t break something and wonder why. That’s why it’s an option for the moderation and you can still use normal words. Just for an example, our keywords system supports regex and has caused so many users issues when using it, we don’t really want to provide regex support since it can be hard to understand.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.