From 82a682f03a5d42f2bfffb3cc267ef942f956a49e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 19 Aug 2021 09:55:23 +0200 Subject: [PATCH] now remove useless arrows when an update button appears --- src/utils/reminder.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utils/reminder.py b/src/utils/reminder.py index bef2316..0d993e4 100644 --- a/src/utils/reminder.py +++ b/src/utils/reminder.py @@ -151,11 +151,15 @@ async def listReaction(client, payload): return False, False if refresh == True: await message.add_reaction("🔄") + await removeReactions(message, ["⬅️", "➡️"]) else: - for reaction in message.reactions: - if str(reaction) == "🔄": - users = await reaction.users().flatten() - for user in users: - await message.remove_reaction("🔄", user) + await removeReactions(message, ["🔄"]) return message, embed return False, False + +async def removeReactions(message, reactions): + for reaction in message.reactions: + if str(reaction) in reactions: + users = await reaction.users().flatten() + for user in users: + await message.remove_reaction(reaction, user) \ No newline at end of file