Skip to content

Commit

Permalink
Only one emoji per person in !summon
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Aug 25, 2021
1 parent 77ae267 commit 20e5470
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions user_commands/summon.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,18 @@ async def __update_message(user: User, emoji_id: str, message: Message):
all_reactions = await __get_summon_reactions(get_guild(message))
reactions: Dict[str, List[str]] = __read_text_reactions(all_reactions, text)

if user.mention in reactions[emoji_id]:
reactions[emoji_id].remove(user.mention)
else:
reactions[emoji_id].append(user.mention)
for emoji in reactions.keys():
if emoji != emoji_id and user.mention in reactions[emoji]:
# Remove at any other place
reactions[emoji].remove(user.mention)

if emoji != emoji_id:
continue

if user.mention in reactions[emoji_id]:
reactions[emoji_id].remove(user.mention)
else:
reactions[emoji_id].append(user.mention)

result_msg = text.split("\n")[0].strip()
summary = ""
Expand Down

0 comments on commit 20e5470

Please sign in to comment.