Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
check=lambda r, u: (r.message.id == msg.id) and (u.id == user.id) and (r.emoji in self.emojis),
timeout=20
)
except asyncio.TimeoutError:
self._confirmed = None
return
finally:
await msg.clear_reactions()
confirmed = self.emojis[reaction.emoji]
self._confirmed = confirmed
return confirmed
class BotConfirmation(Confirmation):
def __init__(self, ctx: commands.Context, color: hex = 0x000000, message: discord.Message = None):
self._ctx = ctx
super().__init__(ctx.bot, color, message)
async def confirm(self, text: str, user: discord.User = None, channel: discord.TextChannel = None) \
-> bool or None:
if user is None:
user = self._ctx.author
if self.message is None and channel is None:
channel = self._ctx.channel
return await super().confirm(text, user, channel)