This commit is contained in:
insert 2024-10-23 20:59:33 -04:00
parent 443a444a42
commit a99cceaa8b
Signed by: insert
GPG key ID: A70775C389ACF105

12
misc.py
View file

@ -47,11 +47,19 @@ class misc(commands.Cog):
@nextcord.message_command( @nextcord.message_command(
name="Pin Thread Message", name="Pin Thread Message",
guild_ids=[732793772697583623],
) )
async def pinthreadmessage(self, interaction: nextcord.Interaction, message: nextcord.Message): async def pinthreadmessage(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 message.channel.owner_id == interaction.user.id: if message.channel.owner_id == interaction.user.id:
await message.pin() if message.pinned:
await interaction.response.send_message("Pinned", ephemeral=True) await message.pin()
await interaction.response.send_message("Pinned", ephemeral=True)
else:
await message.unpin()
await interaction.response.send_message("Unpinned", ephemeral=True)
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)