Skip to content

Commit

Permalink
attempt second fix of duplicate attachments in reactx
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomGuyJCI committed Oct 9, 2024
1 parent dc4f78f commit 5a6c10c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions orchard/bot/handlers/interactions/commands/reactx.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ async def _reactx(body, _):
react["emoji"]["name"] for react in value["reactions"]
]:
continue
reaction_users = await interactor.get_reactions(
reactions = await interactor.get_reactions(
channel_id, message_id, number_reactions[i]
)
for reactor in reaction_users.json():
if bot_id == reactor["id"]:
ignored_rdzips.append(rdzip_attachments[i])
break
if user_id == reactor["id"]:
ignored_rdzips.append(rdzip_attachments[i])
await interactor.react(
channel_id, message_id, number_reactions[i]
)
reaction_users = [react["id"] for react in reactions.json()]
if bot_id in reaction_users:
ignored_rdzips.append(attachment)
continue
if user_id in reaction_users:
ignored_rdzips.append(attachment)
interactor.react(channel_id, message_id, number_reactions[i])
await interactor.react(channel_id, message_id, "🚫")
result = "Done, now ignoring all rdzips."
if len(ignored_rdzips) > 0:
Expand Down

0 comments on commit 5a6c10c

Please sign in to comment.