Skip to content

Commit

Permalink
Merge branch 'master' into vote
Browse files Browse the repository at this point in the history
  • Loading branch information
scragly authored Mar 9, 2020
2 parents 4ffdb13 + 3fe0f5c commit 537f8e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/cogs/antimalware.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ async def on_message(self, message: Message) -> None:
return

embed = Embed()
file_extensions = {splitext(message.filename.lower())[1] for message in message.attachments}
file_extensions = {splitext(attachment.filename.lower())[1] for attachment in message.attachments}
extensions_blocked = file_extensions - set(AntiMalwareConfig.whitelist)
blocked_extensions_str = ', '.join(extensions_blocked)
if ".py" in extensions_blocked:
# Short-circuit on *.py files to provide a pastebin link
embed.description = (
"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 extensions_blocked:
blocked_extensions_str = ', '.join(extensions_blocked)
whitelisted_types = ', '.join(AntiMalwareConfig.whitelist)
meta_channel = self.bot.get_channel(Channels.meta)
embed.description = (
Expand Down

0 comments on commit 537f8e7

Please sign in to comment.