ZeroK-RTS / Zero-K-Infrastructure

Website, lobby launcher and server, steam deployment, .NET based tools and other vital parts of Zero-K infrastructure
GNU General Public License v3.0
53 stars 52 forks source link

Give NW a rudimentary message scanning function (Discord) #2461

Open ArchShaman opened 5 years ago

ArchShaman commented 5 years ago

We've been being spammed by some "sex dating" bots lately. I'm pretty sure admins don't like me pinging them every time I see that stupid shit on the discord. Let's add a banned message function for NW. When a user posts a message, check it, and if it contains "sex dating > http", ban the fucker and delete the message. If necessary I can create the function myself. I'm tired of seeing the crap on the discord.

The phrase is too specific to catch any actual users I believe. Perhaps storing it in a table format would allow infra devs to expand on this in case any more spammers show up.

Licho1 commented 5 years ago

Its probably best to make it as a chat handler for discord so that we can do commands like !ban message And any ZK admin could do it to permanently filter/block such messages.

ArchShaman commented 5 years ago

That's fairly easy to implement once you get yourself a listener I believe.

Just a heads up for anyone who does try this: If you check if the user's role is admin, MAKE SURE IT IS NOT SELF. Otherwise some troll may discover this fun little exploit with the bridge to start banning random shit (similar to the @everyone incident following the perm being removed).