From 87ba68f13e128548ccfc9c71a5eeb1f9ac69cb42 Mon Sep 17 00:00:00 2001 From: insert Date: Sun, 2 Feb 2025 10:18:36 -0500 Subject: [PATCH] Update --- misc.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/misc.py b/misc.py index 2c96881..a511a7e 100644 --- a/misc.py +++ b/misc.py @@ -62,9 +62,22 @@ class misc(commands.Cog): await interaction.response.send_message("Unpinned", ephemeral=True) else: await interaction.response.send_message("You don't have permission in this context", ephemeral=True) - - - + + @nextcord.message_command( + name="Pin Thread Message", + guild_ids=[1247883904178978927], + ) + async def pinthreadmessagenoowner(self, interaction: nextcord.Interaction, message: nextcord.Message): + if message.channel.type != nextcord.ChannelType.public_thread and message.channel.type != nextcord.ChannelType.private_thread: + await interaction.response.send_message("You don't have permission in this context", ephemeral=True) + return + if not message.pinned: + await message.pin() + await interaction.response.send_message("Pinned", ephemeral=True) + else: + await message.unpin() + await interaction.response.send_message("Unpinned", ephemeral=True) + def setup(bot: commands.Bot): bot.add_cog(misc(bot)) \ No newline at end of file