aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-12-11 19:28:41 -0800
committerGravatar MarkKoz <[email protected]>2019-12-11 19:28:41 -0800
commit65c7319c7bd83e6f8833b323d5dd408ca771cf9d (patch)
tree36b4ec14022481528a49a230510cc8a0606e7a85
parentVerification: allow mods+ to use commands in checkpoint (#688) (diff)
Verification: delete bots' messages (#689)
Messages are deleted after a delay of 10 seconds. This helps keep the channel clean. The periodic ping is an exception; it will remain.
-rw-r--r--bot/cogs/verification.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/cogs/verification.py b/bot/cogs/verification.py
index b62a08db6..2d759f885 100644
--- a/bot/cogs/verification.py
+++ b/bot/cogs/verification.py
@@ -38,6 +38,7 @@ PERIODIC_PING = (
f"@everyone To verify that you have read our rules, please type `{BotConfig.prefix}accept`."
f" If you encounter any problems during the verification process, ping the <@&{Roles.admin}> role in this channel."
)
+BOT_MESSAGE_DELETE_DELAY = 10
class Verification(Cog):
@@ -56,7 +57,11 @@ class Verification(Cog):
async def on_message(self, message: Message) -> None:
"""Check new message event for messages to the checkpoint channel & process."""
if message.author.bot:
- return # They're a bot, ignore
+ # They're a bot, delete their message after the delay.
+ # But not the periodic ping; we like that one.
+ if message.content != PERIODIC_PING:
+ await message.delete(delay=BOT_MESSAGE_DELETE_DELAY)
+ return
if message.channel.id != Channels.verification:
return # Only listen for #checkpoint messages