diff options
author | 2023-04-07 06:59:53 +0300 | |
---|---|---|
committer | 2023-04-07 06:59:53 +0300 | |
commit | 8c38fc6afe45514645af80203c3d40d71b1b3666 (patch) | |
tree | 8abec702468af350420f2966232f1b6aef5c3fe2 | |
parent | Remove cooldown when post is deleted (diff) |
Handle archival task of deleted post
-rw-r--r-- | bot/exts/help_channels/_channel.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bot/exts/help_channels/_channel.py b/bot/exts/help_channels/_channel.py index e11adcb75..3e674dfb9 100644 --- a/bot/exts/help_channels/_channel.py +++ b/bot/exts/help_channels/_channel.py @@ -215,6 +215,12 @@ async def maybe_archive_idle_post(post: discord.Thread, scheduler: scheduling.Sc If `has_task` is True and rescheduling is required, the extant task to make the post dormant will first be cancelled. """ + try: + await post.guild.fetch_channel(post.id) + except discord.HTTPException: + log.trace(f"Not closing missing post #{post} ({post.id}).") + return + if post.locked: log.trace(f"Not closing already closed post #{post} ({post.id}).") return |