This commit is contained in:
insert 2024-12-20 17:24:14 -05:00
parent ae4700ac7b
commit 48002fc453
Signed by: insert
GPG key ID: A70775C389ACF105

15
misc.py
View file

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