actually implement message rejection for attachment filtering, TODO'd warning helper func

This commit is contained in:
Xevion
2021-02-15 05:25:33 -06:00
parent c234487302
commit 0b8aaec332

View File

@@ -200,10 +200,15 @@ class ContestCog(commands.Cog):
await warning.delete(delay=5)
else:
attachment = attachments[0]
# TODO: Add helper for displaying error/warning messages
if attachment.is_spoiler():
await channel.send('Attachment must not make use of a spoiler.')
await message.delete(delay=1)
warning = await channel.send(':no_entry_sign: Attachment must not make use of a spoiler.')
await warning.delete(delay=5)
elif attachment.width is None:
await channel.send('Attachment must be a image or video.')
await message.delete(delay=1)
warning = await channel.send(':no_entry_sign: Attachment must be a image or video.')
await warning.delete(delay=5)
else:
last_submission: Submission = session.query(Submission).filter_by(period=guild.current_period,
user=message.author.id).first()