better pagination controls
@@ -202,7 +202,11 @@ class Useful(commands.Cog):
return r_user == ctx.author and ctx.channel == react.message.channel and msg.id == react.message.id
# wait for reaction from message author (1 min)
- react, r_user = await self.bot.wait_for("reaction_add", check=author_check, timeout=30)
+ for react, r_user in await asyncio.as_completed(
+ self.bot.wait_for("reaction_add", check=author_check, timeout=30),
+ self.bot.wait_for("reaction_remove", check=author_check, timeout=30)
+ ):
+ break
except asyncio.TimeoutError:
return
