From 48002fc453d9875c9caa444a4e5556d46221f5dc Mon Sep 17 00:00:00 2001 From: insert Date: Fri, 20 Dec 2024 17:24:14 -0500 Subject: [PATCH] Update --- misc.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/misc.py b/misc.py index 936e656..ac91367 100644 --- a/misc.py +++ b/misc.py @@ -63,6 +63,21 @@ class misc(commands.Cog): else: await interaction.response.send_message("You don't have permission in this context", ephemeral=True) + @nextcord.slash_command( + name="threadsummery", + description="Generate a list of created threads with the owner", + default_member_permissions=nextcord.Permissions(manage_messages=True), + ) + async def threadsummery(self, interaction: nextcord.Interaction): + if interaction.message.channel.type != nextcord.ChannelType.text: + await interaction.response.send_message("This is not a text channel", ephemeral=True) + return + message = "" + for t in interaction.message.channel.threads: + if t.archived: + continue + message = message + f"<@{t.owner_id}>: {t.jump_url}\n" + await interaction.response.send_message(message, allowed_mentions=nextcord.AllowedMentions.none()) def setup(bot: commands.Bot):