Skip to content

Commit c680f67

Browse files
committed
fix: id extraction for clean database.
1 parent e3f9f73 commit c680f67

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

core/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ async def set(self, key: str, item: typing.Any, convert=True) -> None:
397397
if not convert:
398398
return self.__setitem__(key, item)
399399

400+
if "channel" in key or "category" in key:
401+
if isinstance(item, str) and item not in {"thread", "NONE"}:
402+
item = item.strip("<#>")
403+
400404
if key in self.colors:
401405
try:
402406
hex_ = str(item)

core/thread.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@ async def _safe_send_to_channel(*, content=None, embeds=None, allowed_mentions=N
635635
if notify_channel == "thread":
636636
await _safe_send_to_channel(content=notify_text, allowed_mentions=discord.AllowedMentions.none())
637637
else:
638-
ch = self.bot.get_channel(int(notify_channel))
638+
# Extract channel ID from mention format <#123> or use raw ID
639+
channel_id = str(notify_channel).strip("<#>")
640+
ch = self.bot.get_channel(int(channel_id))
639641
if ch:
640642
await ch.send(
641643
f"⏰ Thread for user <@{self.id}> has been unsnoozed and restored in {channel.mention}",

0 commit comments

Comments
 (0)