From 65c7319c7bd83e6f8833b323d5dd408ca771cf9d Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Wed, 11 Dec 2019 19:28:41 -0800 Subject: 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. --- bot/cogs/verification.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3