aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Boris Muratov <[email protected]>2023-04-07 06:46:11 +0300
committerGravatar Boris Muratov <[email protected]>2023-04-07 06:46:11 +0300
commit979701c8030e3299a5a9aa5fbc5a1ab657b9d4a7 (patch)
treebb80785380a9e0de1d2449c64636211b88f6505f
parentAdd thread name filtering (diff)
Remove cooldown when post is deleted
-rw-r--r--bot/exts/help_channels/_channel.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py
index c9e66d944..e11adcb75 100644
--- a/bot/exts/help_channels/_channel.py
+++ b/bot/exts/help_channels/_channel.py
@@ -171,7 +171,11 @@ async def help_post_deleted(deleted_post_event: discord.RawThreadDeleteEvent) ->
_stats.report_post_count()
cached_post = deleted_post_event.thread
if cached_post and not cached_post.archived:
- # If the post is in the bot's cache, and it was not archived before deleting, report a complete session.
+ # If the post is in the bot's cache, and it was not archived before deleting,
+ # report a complete session and remove the cooldown.
+ poster = cached_post.owner
+ cooldown_role = cached_post.guild.get_role(constants.Roles.help_cooldown)
+ await members.handle_role_change(poster, poster.remove_roles, cooldown_role)
await _stats.report_complete_session(cached_post, _stats.ClosingReason.DELETED)