Skip to content

Commit fcc3fad

Browse files
committed
add documentation and fix timestamp related bugs
1 parent 0ebf364 commit fcc3fad

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ v3.10 adds group conversations while resolving other bugs and QOL changes. It is
2121
- Snippets are invoked case insensitively. ([GH #3077](https://github.com/kyb3r/modmail/issues/3077), [PR #3080](https://github.com/kyb3r/modmail/pull/3080))
2222
- Default tags now use top hoisted role. ([GH #3014](https://github.com/kyb3r/modmail/issues/3014))
2323
- New thread-related config - `thread_show_roles`, `thread_show_account_age`, `thread_show_join_age`, `thread_cancelled`, `thread_creation_contact_title`, `thread_creation_self_contact_response`, `thread_creation_contact_response`. ([GH #3072](https://github.com/kyb3r/modmail/issues/3072))
24+
- `use_timestamp_channel_name` config to create thread channels by timestamp.
2425

2526
### Fixed
2627

core/config_help.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,22 @@
105105
"`{prefix}config set use_user_id_channel_name no`"
106106
],
107107
"notes": [
108-
"This config is suitable for servers in Server Discovery to comply with channel name restrictions."
108+
"This config is suitable for servers in Server Discovery to comply with channel name restrictions.",
109+
"This cannot be applied with `use_timestamp_channel_name`.",
110+
"See also: `use_timestamp_channel_name`."
111+
]
112+
},
113+
"use_timestamp_channel_name": {
114+
"default": "No",
115+
"description": "When this is set to `yes`, new thread channels will be named with the recipient's account creation date instead of the recipient's name.",
116+
"examples": [
117+
"`{prefix}config set use_timestamp_channel_name yes`",
118+
"`{prefix}config set use_timestamp_channel_name no`"
119+
],
120+
"notes": [
121+
"This config is suitable for servers in Server Discovery to comply with channel name restrictions.",
122+
"This cannot be applied with `use_user_id_channel_name`.",
123+
"See also: `use_user_id_channel_name`."
109124
]
110125
},
111126
"mod_typing": {

core/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import base64
2-
from datetime import datetime
32
import functools
43
import re
54
import string
@@ -375,7 +374,7 @@ def format_channel_name(bot, author, exclude_channel=None, force_null=False):
375374
if bot.config["use_user_id_channel_name"]:
376375
name = new_name = str(author.id)
377376
elif bot.config["use_timestamp_channel_name"]:
378-
name = new_name = datetime.utcnow().isoformat(sep="-", timesep="minutes")
377+
name = new_name = author.created_at.isoformat(sep="-", timespec="minutes")
379378
else:
380379
name = author.name.lower()
381380
if force_null:

0 commit comments

Comments
 (0)