This commit is contained in:
insert 2024-12-20 17:42:25 -05:00
parent 9e8a12f360
commit 3435502103
Signed by: insert
GPG key ID: A70775C389ACF105

13
misc.py
View file

@ -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))