Update
This commit is contained in:
parent
ae4700ac7b
commit
48002fc453
1 changed files with 15 additions and 0 deletions
15
misc.py
15
misc.py
|
@ -63,6 +63,21 @@ class misc(commands.Cog):
|
||||||
else:
|
else:
|
||||||
await interaction.response.send_message("You don't have permission in this context", ephemeral=True)
|
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):
|
def setup(bot: commands.Bot):
|
||||||
|
|
Loading…
Reference in a new issue