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