From 8c38fc6afe45514645af80203c3d40d71b1b3666 Mon Sep 17 00:00:00 2001 From: Boris Muratov <8bee278@gmail.com> Date: Fri, 7 Apr 2023 06:59:53 +0300 Subject: Handle archival task of deleted post --- bot/exts/help_channels/_channel.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3