Skip to content

Commit b912cc7

Browse files
authored
Modlog: explicitly write thread names
It seems like there could be some caching issue with threads causing to appear as deleted channels. Beside, we also want to keep the name of deleted threads around.
1 parent 816f73f commit b912cc7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bot/exts/moderation/modlog.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,10 @@ async def on_thread_update(self, before: Thread, after: Thread) -> None:
800800
icon,
801801
colour,
802802
f"Thread {action}",
803-
f"Thread {after.mention} (`{after.id}`) from {after.parent.mention} (`{after.parent.id}`) was {action}"
803+
(
804+
f"Thread {after.mention} ({after.name}, `{after.id}`) from {after.parent.mention} "
805+
f"(`{after.parent.id}`) was {action}"
806+
)
804807
)
805808

806809
@Cog.listener()
@@ -810,7 +813,10 @@ async def on_thread_delete(self, thread: Thread) -> None:
810813
Icons.hash_red,
811814
Colours.soft_red,
812815
"Thread deleted",
813-
f"Thread {thread.mention} (`{thread.id}`) from {thread.parent.mention} (`{thread.parent.id}`) deleted"
816+
(
817+
f"Thread {thread.mention} ({thread.name}, `{thread.id}`) from {thread.parent.mention} "
818+
f"(`{thread.parent.id}`) deleted"
819+
)
814820
)
815821

816822
@Cog.listener()
@@ -825,7 +831,10 @@ async def on_thread_join(self, thread: Thread) -> None:
825831
Icons.hash_green,
826832
Colours.soft_green,
827833
"Thread created",
828-
f"Thread {thread.mention} (`{thread.id}`) from {thread.parent.mention} (`{thread.parent.id}`) created"
834+
(
835+
f"Thread {thread.mention} ({thread.name}, `{thread.id}`) from {thread.parent.mention} "
836+
f"(`{thread.parent.id}`) created"
837+
)
829838
)
830839

831840
@Cog.listener()

0 commit comments

Comments
 (0)