15
15
16
16
ASKING_GUIDE_URL = "https://pythondiscord.com/pages/asking-good-questions/"
17
17
BRANDING_REPO_RAW_URL = "https://raw.githubusercontent.com/python-discord/branding"
18
- POST_TITLE = "Python help channel"
19
18
20
19
NEW_POST_MSG = """
21
20
**Remember to:**
29
28
NEW_POST_ICON_URL = f"{ BRANDING_REPO_RAW_URL } /main/icons/checkmark/green-checkmark-dist.png"
30
29
31
30
CLOSED_POST_MSG = f"""
32
- This help channel has been closed and it's no longer possible to send messages here . \
33
- If your question wasn't answered, feel free to create a new post in <#{ constants .Channels .python_help } >. \
31
+ This help channel has been closed. \
32
+ Feel free to create a new post in <#{ constants .Channels .python_help } >. \
34
33
To maximize your chances of getting a response, check out this guide on [asking good questions]({ ASKING_GUIDE_URL } ).
35
34
"""
36
35
CLOSED_POST_ICON_URL = f"{ BRANDING_REPO_RAW_URL } /main/icons/zzz/zzz-dist.png"
@@ -48,7 +47,18 @@ async def _close_help_post(closed_post: discord.Thread, closing_reason: _stats.C
48
47
closed_post = await get_or_fetch_channel (bot .instance , closed_post .id )
49
48
50
49
embed = discord .Embed (description = CLOSED_POST_MSG )
51
- embed .set_author (name = f"{ POST_TITLE } closed" , icon_url = CLOSED_POST_ICON_URL )
50
+ close_title = "Python help channel closed"
51
+ if closing_reason == _stats .ClosingReason .CLEANUP :
52
+ close_title += " as OP left server"
53
+ elif closing_reason == _stats .ClosingReason .COMMAND :
54
+ close_title += f" with { constants .Bot .prefix } close"
55
+ elif closing_reason == _stats .ClosingReason .INACTIVE :
56
+ close_title += " for inactivity"
57
+ elif closing_reason == _stats .ClosingReason .NATIVE :
58
+ close_title += " using Discord native close action"
59
+
60
+
61
+ embed .set_author (name = close_title , icon_url = CLOSED_POST_ICON_URL )
52
62
message = ""
53
63
54
64
# Include a ping in the close message if no one else engages, to encourage them
@@ -83,7 +93,7 @@ async def send_opened_post_message(post: discord.Thread) -> None:
83
93
color = constants .Colours .bright_green ,
84
94
description = NEW_POST_MSG ,
85
95
)
86
- embed .set_author (name = f" { POST_TITLE } opened" , icon_url = NEW_POST_ICON_URL )
96
+ embed .set_author (name = "Python help channel opened" , icon_url = NEW_POST_ICON_URL )
87
97
embed .set_footer (text = NEW_POST_FOOTER )
88
98
await post .send (embed = embed , content = post .owner .mention )
89
99
@@ -130,7 +140,7 @@ async def help_post_archived(archived_post: discord.Thread) -> None:
130
140
if thread_update .user .id == bot .instance .user .id :
131
141
return
132
142
133
- await _close_help_post (archived_post , _stats .ClosingReason .INACTIVE )
143
+ await _close_help_post (archived_post , _stats .ClosingReason .NATIVE )
134
144
135
145
136
146
async def help_post_deleted (deleted_post_event : discord .RawThreadDeleteEvent ) -> None :
0 commit comments