Skip to content

Commit

Permalink
Add closing reason for when OP closes uses ative Discord close option
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Jan 18, 2025
1 parent 83bdf16 commit bed9788
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bot/exts/help_channels/_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.C
close_title = f"Python help channel closed by OP with {constants.Bot.prefix}close"
elif closing_reason == _stats.ClosingReason.INACTIVE:
close_title = "Python help channel closed for inactivity"
elif closing_reason == _stats.ClosingReason.NATIVE:
close_title = "Python help channel closed by OP"
else:
close_title = "Python help channel closed"

Expand Down Expand Up @@ -138,7 +140,7 @@ async def help_post_archived(archived_post: discord.Thread) -> None:
if thread_update.user.id == bot.instance.user.id:
return

await _close_help_post(archived_post, _stats.ClosingReason.INACTIVE)
await _close_help_post(archived_post, _stats.ClosingReason.NATIVE)


async def help_post_deleted(deleted_post_event: discord.RawThreadDeleteEvent) -> None:
Expand Down
1 change: 1 addition & 0 deletions bot/exts/help_channels/_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class ClosingReason(Enum):

COMMAND = "command"
INACTIVE = "auto.inactive"
NATIVE = "auto.native"
DELETED = "auto.deleted"
CLEANUP = "auto.cleanup"

Expand Down

0 comments on commit bed9788

Please sign in to comment.