Browse Source

more exclusions to binflop uploads

master
Pempkin 4 years ago
parent
commit
20ba6fed88
  1. 2
      .gitignore
  2. 2
      bot.py

2
.gitignore

@ -127,3 +127,5 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
/.idea/*

2
bot.py

@ -35,7 +35,7 @@ async def on_message(message):
# Binflop # Binflop
if len(message.attachments) > 0: if len(message.attachments) > 0:
if not message.attachments[0].url.endswith( if not message.attachments[0].url.endswith(
('.png', '.jpg', '.jpeg', '.mp4', '.mov', '.avi', '.gif', '.image', '.svg')):
('.png', '.jpg', '.jpeg', '.mp4', '.mov', '.avi', '.gif', '.image', '.svg', '.jar', ',zip', '.tar', '.gz', '.msi', '.exe', '.html')):
text = await discord.Attachment.read(message.attachments[0], use_cached=False) text = await discord.Attachment.read(message.attachments[0], use_cached=False)
text = text.decode('Latin-1') text = text.decode('Latin-1')
text = "\n".join(text.splitlines()) text = "\n".join(text.splitlines())

Loading…
Cancel
Save