diff options
| -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)  |