Update
This commit is contained in:
parent
443a444a42
commit
a99cceaa8b
1 changed files with 10 additions and 2 deletions
12
misc.py
12
misc.py
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue