In the latest version of discord.py, the pins are handled with the on_guild_channels_pins_update
event. Your events you have in your code snippet don’t exist, so they will never be called.
https://discordpy.readthedocs.io/en/latest/api.html#discord.on_guild_channel_pins_update
@bot.event
async def on_guild_channel_pins_update(channel, last_pin):
if last_pin is None:
# This means that all pins have been removed, or the last pin was removed
await channel.send(f"The pins in {channel.mention} have been cleared.")
else:
# A new pin was added or an existing pin was modified
await channel.send(f"The pins in {channel.mention} were updated. Last pin at: {last_pin}")