This commit is contained in:
insert 2024-10-23 20:43:21 -04:00
parent 68e415773f
commit d6d02d7873
Signed by: insert
GPG key ID: A70775C389ACF105

17
misc.py
View file

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