Added a protection against crash chars that make discord crash, this is not available to be disabled, this only helps out your server.

This commit is contained in:
JustMaffie 2017-07-29 23:52:24 +02:00
parent fc8bfb2ae1
commit 45df6b19fc

View File

@ -110,6 +110,17 @@ class Titan(discord.Client):
print("Skipping indexing server due to no-init flag")
async def on_message(self, message):
crashChar = 'ौौौौ'
if crashChar in message.content:
try:
await bot.delete_message(message)
await bot.send_message(message.channel,
"**I've delete a message posted by {} because it contained characters which crashes discord. I've also banned him.**".format(
message.author.name + "#" + message.author.discriminator + "(ID: " + message.author.id + ")"))
await message.server.ban(message.author, "Causing discord to crash because of weird characters.")
except:
pass
return
await self.wait_until_dbonline()
await self.database.push_message(message)