Почему payload.member возвращает None?
Код
@bot.event
async def on_raw_reaction_remove(payload):
channel_id = payload.channel_id
if channel_id == 1007740471549902858:
guild_id = payload.guild_id
guild = discord.utils.find(lambda g: g.id == guild_id, bot.guilds)
if payload.emoji.name == '':
role = discord.utils.get(guild.roles, id=1007716319124267008)
elif payload.emoji.name == '':
role = discord.utils.get(guild.roles, id=1007716671185760338)
elif payload.emoji.name == '':
role = discord.utils.get(guild.roles, id=1007744141716901988)
else:
role = discord.utils.get(guild.roles, name=payload.emoji.name)
print(payload.emoji, payload.emoji.name)
if role is not None:
member = payload.member
if member is not None:
await member.remove_roles(role)
print(f"Пользователю {member} была снята роль {Roles_name[payload.emoji.name]}")
else:
print("Пользователь не найден")
else:
print("Роль не найдена")