diff options
author | 2020-05-05 08:44:50 -0500 | |
---|---|---|
committer | 2020-05-05 08:44:50 -0500 | |
commit | 3533b0607e2dc19a482c1d442ce1d7b6d6d8796d (patch) | |
tree | 36562ff4ba883c822c97b147d2f70508f9426007 | |
parent | Merge pull request #922 from python-discord/bug/info/914/user-animated-avatar (diff) | |
parent | Merge branch 'master' into antimalware (diff) |
Merge pull request #925 from Savant-Dev/antimalware
Update to Antimalware Filter (.txt uploads)
-rw-r--r-- | bot/cogs/antimalware.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bot/cogs/antimalware.py b/bot/cogs/antimalware.py index 79bf486a4..66b5073e8 100644 --- a/bot/cogs/antimalware.py +++ b/bot/cogs/antimalware.py @@ -38,6 +38,18 @@ class AntiMalware(Cog): "It looks like you tried to attach a Python file - " f"please use a code-pasting service such as {URLs.site_schema}{URLs.site_paste}" ) + elif ".txt" in extensions_blocked: + # Work around Discord AutoConversion of messages longer than 2000 chars to .txt + cmd_channel = self.bot.get_channel(Channels.bot_commands) + embed.description = ( + "**Uh-oh!** It looks like your message got zapped by our spam filter. " + "We currently don't allow `.txt` attachments, so here are some tips to help you travel safely: \n\n" + "• If you attempted to send a message longer than 2000 characters, try shortening your message " + "to fit within the character limit or use a pasting service (see below) \n\n" + "• If you tried to show someone your code, you can use codeblocks \n(run `!code-blocks` in " + f"{cmd_channel.mention} for more information) or use a pasting service like: " + f"\n\n{URLs.site_schema}{URLs.site_paste}" + ) elif extensions_blocked: whitelisted_types = ', '.join(AntiMalwareConfig.whitelist) meta_channel = self.bot.get_channel(Channels.meta) |