From d6d02d787331644d429bcb4e18adaea4b031eeb8 Mon Sep 17 00:00:00 2001 From: insert Date: Wed, 23 Oct 2024 20:43:21 -0400 Subject: [PATCH] Update --- misc.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/misc.py b/misc.py index 97fae55..2bb053f 100644 --- a/misc.py +++ b/misc.py @@ -45,6 +45,23 @@ class misc(commands.Cog): async def testcmd(self, interaction: nextcord.Interaction): await interaction.response.send_message("Hey there this is a user installable command!") + @nextcord.message_command( + name="Pin Thread Message", + integration_types=[ + nextcord.IntegrationType.guild_install, + ], + contexts=[ + nextcord.InteractionContextType.guild, + nextcord.InteractionContextType.private_channel, + ], + guild_ids=[732793772697583623], + ) + async def pinthreadmessage(self, interaction: nextcord.Interaction): + if interaction.message.channel.owner_id == interaction.user.id: + await interaction.message.pin() + await interaction.response.send_message("Pinned", ephemeral="True") + else: + await interaction.response.send_message("You don't have permission in this context", ephemeral="True")