Skip to content

Commit a859cda

Browse files
Ensure the bot always closes help channels (#3558)
Channels can be archived/locked by post openers, but that flow doens't go through our flow that renames & records stats. help_post_archived already uses the audit log to check if the bot archived the channel, and if not goes through the close process, so we just reuse that
1 parent 10cad91 commit a859cda

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎bot/exts/help_channels/_channel.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ async def maybe_archive_idle_post(post_id: int, scheduler: scheduling.Scheduler)
199199
return
200200

201201
if post.archived or post.locked:
202-
log.trace(f"Not closing already closed post #{post} ({post.id}).")
202+
# Could have been closed by us already, or manually archived/locked by the owner.
203+
# help_post_archived tells the two apart via the audit log.
204+
await help_post_archived(post, scheduler)
203205
return
204206

205207
log.trace(f"Handling open post #{post} ({post.id}).")

0 commit comments

Comments
 (0)