@client.event
async def on_raw_reaction_add(payload):
message_id=payload.message_id
if message_id == 0:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g : g.id == guild_id, client.guild) #говорит что тут ошибка
if payload.emoji.name == 'yellow_square':
role=discord.utils.get(guild.roles, name='ChSW LAND')
elif payload.emoji.name == 'purple_square':
role=discord.utils.get(guild.roles, name='LASTTASK')
else:
role=discord.utils.get(guild.roles, name=payload.emoji.name)
if role is not None:
member=discord.utils.find(lambda m : m.id == payload.user.id, guild.members)
if member is not None:
await member.add_roles(role)
print("done")
else:
print("Member not found")
else:
print("Role not found")
@client.event
async def on_raw_reaction_remove(payload):
pass