Skip to content

Commit 9343298

Browse files
committed
use_timestamp_channel_name config
1 parent 145788e commit 9343298

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

core/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ConfigManager:
5151
"blocked_emoji": "\N{NO ENTRY SIGN}",
5252
"close_emoji": "\N{LOCK}",
5353
"use_user_id_channel_name": False,
54+
"use_timestamp_channel_name": False,
5455
"recipient_thread_close": False,
5556
"thread_show_roles": True,
5657
"thread_show_account_age": True,
@@ -179,6 +180,7 @@ class ConfigManager:
179180

180181
booleans = {
181182
"use_user_id_channel_name",
183+
"use_timestamp_channel_name",
182184
"user_typing",
183185
"mod_typing",
184186
"reply_without_command",
@@ -203,6 +205,10 @@ class ConfigManager:
203205
"update_notifications",
204206
"thread_contact_silently",
205207
"anonymous_snippets",
208+
"recipient_thread_close",
209+
"thread_show_roles",
210+
"thread_show_account_age",
211+
"thread_show_join_age",
206212
}
207213

208214
enums = {

core/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import base64
2+
from datetime import datetime
23
import functools
34
import re
45
import string
@@ -373,6 +374,8 @@ def format_channel_name(bot, author, exclude_channel=None, force_null=False):
373374
else:
374375
if bot.config["use_user_id_channel_name"]:
375376
name = new_name = str(author.id)
377+
elif bot.config["use_timestamp_channel_name"]:
378+
name = new_name = datetime.utcnow().isoformat(sep='-', timesep='minutes')
376379
else:
377380
name = author.name.lower()
378381
if force_null:

0 commit comments

Comments
 (0)