Browse Source

Block bot that was spamming binflop

pull/20/merge
Purpur 3 years ago
committed by GitHub
parent
commit
a9525e63bb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      bot.py

3
bot.py

@ -35,6 +35,7 @@ async def on_ready():
async def on_message(message):
# Binflop
if len(message.attachments) > 0:
if message.author.id != 834065535041798225:
if not message.attachments[0].url.lower().endswith(('.html')):
file_type = mimetypes.guess_type(message.attachments[0].url)
if not file_type[0] == None:
@ -65,6 +66,8 @@ async def on_message(message):
except:
print("Permission error")
logging.info(f'File uploaded by {message.author} ({message.author.id}): https://bin.birdflop.com/{key}')
else:
logging.info(f'Blocked file upload by {message.author} ({message.author.id})')
# Pastebin is blocked in some countries
words = message.content.replace("\n", " ").split(" ")
for word in words:

Loading…
Cancel
Save