Skip to content

Commit

Permalink
[Discord] Pass tasks to asyncio.wait in Bot method
Browse files Browse the repository at this point in the history
Pass tasks to asyncio.wait in Bot.wait_for_raw_reaction_add_or_remove method
  • Loading branch information
Harmon758 committed Dec 17, 2023
1 parent 7509c30 commit 6c9afc3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,15 @@ def raw_reaction_check(payload):

done, pending = await asyncio.wait(
(
self.wait_for("raw_reaction_add", check = raw_reaction_check),
self.wait_for(
"raw_reaction_remove", check = raw_reaction_check
asyncio.create_task(
self.wait_for(
"raw_reaction_add", check = raw_reaction_check
)
),
asyncio.create_task(
self.wait_for(
"raw_reaction_remove", check = raw_reaction_check
)
)
),
return_when = asyncio.FIRST_COMPLETED,
Expand Down

0 comments on commit 6c9afc3

Please sign in to comment.