From 0b8aaec3326d82ceb64af583eb74b4cc515d9ab7 Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 15 Feb 2021 05:25:33 -0600 Subject: [PATCH] actually implement message rejection for attachment filtering, TODO'd warning helper func --- bot/cogs/contest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bot/cogs/contest.py b/bot/cogs/contest.py index 35dece1..e9e58df 100644 --- a/bot/cogs/contest.py +++ b/bot/cogs/contest.py @@ -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()