def wait_for_reaction_remove(bot, emoji=None, *, user=None,
timeout=None, message=None, check=None):
"""Waits for a reaction to be removed by a user from a message within a time period.
Made to act like other discord.py wait_for_* functions but is not fully implemented.
Because of that, wait_for_reaction_remove(self, emoji: list, user, message, timeout=None)
is a better representation of this function's def
returns the actual event or None if timeout
"""
if not (emoji and message) or isinstance(emoji, str):
raise NotImplementedError("wait_for_reaction_remove(self, emoji, "
"message, user=None, timeout=None, "
"check=None) is a better representation "
"of this function definition")
remove_event = ReactionRemoveEvent(emoji, user, check=check)
_reaction_remove_events[message.id] = remove_event
done, pending = await asyncio.wait([remove_event.wait()],
timeout=timeout)
res = _reaction_remove_events.pop(message.id)
try:
return done.pop().result() and res
except:
return None
评论列表
文章目录