Fix auto-pin

This commit is contained in:
EEKIM10 2022-10-10 18:15:48 +01:00
parent 34fd911e63
commit 907f16763e

View file

@ -58,13 +58,13 @@ class Events(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_message(self, message: discord.Message): async def on_message(self, message: discord.Message):
if message.channel.name == "pinboard": if message.channel.name == "pinboard":
try: if message.type == discord.MessageType.pins_add:
await message.pin(reason="Automatic pinboard pinning") await message.delete(delay=0.01)
except discord.HTTPException as e: else:
return await message.reply(f"Failed to auto-pin: {e}", delete_after=10) try:
await message.pin(reason="Automatic pinboard pinning")
if message.type == discord.MessageType.pins_add: except discord.HTTPException as e:
await message.delete(delay=0.01) return await message.reply(f"Failed to auto-pin: {e}", delete_after=10)
def setup(bot): def setup(bot):