From 3435502103f0239647faa8437f6ac9075a8e1347 Mon Sep 17 00:00:00 2001 From: insert Date: Fri, 20 Dec 2024 17:42:25 -0500 Subject: [PATCH] Update --- misc.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/misc.py b/misc.py index b49fec4..2c0faf6 100644 --- a/misc.py +++ b/misc.py @@ -79,6 +79,19 @@ class misc(commands.Cog): message = message + f"<@{t.owner_id}>: {t.jump_url}\n" await interaction.response.send_message(message, allowed_mentions=nextcord.AllowedMentions.none()) + @commands.Cog.listener('on_thread_update') + async def threadupdatehandler(self, before: nextcord.Thread, after: nextcord.Thread): + pins = await after.parent.pins() + for t in pins: + if t.author.id == self.bot.application_id and t.content.split("\n")[0] == f"Active threads in {after.parent.jump_url}": + message = f"Active threads in {after.parent.jump_url}\n" + for p in after.parent.threads: + if p.archived: + continue + message = message + f"<@{p.owner_id}>: {p.jump_url}\n" + await message.edit(message) + return + def setup(bot: commands.Bot): bot.add_cog(misc(bot)) \ No newline at end of file