Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
reaction, user = await self._client.wait_for('reaction_add', check=check, timeout=timeout)
except asyncio.TimeoutError:
self._choice = None
return None, self.message
if closable and reaction.emoji == self.close_emoji:
self._choice = None
return None, self.message
index = self._emojis.index(reaction.emoji)
self._choice = self.options[index]
return self._choice, self.message
class BotMultipleChoice(MultipleChoice):
def __init__(self, ctx: Context, options: list, title: str, description: str = "", **kwargs):
super().__init__(ctx.bot, options, title, description, **kwargs)
self._ctx = ctx
async def run(self, users: List[User] = None, channel: TextChannel = None, **kwargs)\
-> Tuple[Optional[str], Message]:
if users is None:
users = [self._ctx.author]
if self.message is None and channel is None:
channel = self._ctx.channel
return await super().run(users, channel, **kwargs)