add comment + fix vérification message du bot + au moins 1 embed
This commit is contained in:
parent
05de1704f9
commit
d3c609f21b
1 changed files with 3 additions and 2 deletions
|
@ -113,13 +113,14 @@ async def embedListe(utilisateur, guildID, page, color = None, refresh_message =
|
|||
|
||||
async def listReaction(client, payload):
|
||||
"""Gère le changement de page du reminderlist avec les réactions."""
|
||||
print(payload)
|
||||
if payload.emoji.name in ["⬅️", "🔄", "➡️"]:
|
||||
if payload.event_type == "REACTION_ADD":
|
||||
if payload.member.bot == True:
|
||||
if payload.member.bot == True: # vérifie que c'est pas un bot qui a réagit
|
||||
return False, False
|
||||
channel = client.get_channel(payload.channel_id)
|
||||
message = await channel.fetch_message(payload.message_id)
|
||||
if message.author.id != client.user.id and len(message.embeds) == 0: # vérification message du bot + au moins 1 embed
|
||||
if message.author.id != client.user.id or len(message.embeds) == 0: # vérification message du bot + au moins 1 embed
|
||||
return False, False
|
||||
embed = message.embeds[0].to_dict()
|
||||
if "description" in embed: # si c'est un embed avec une description
|
||||
|
|
Reference in a new issue