How to use the disputils.multiple_choice.MultipleChoice function in disputils

To help you get started, we’ve selected a few disputils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiBa001 / disputils / disputils / View on Github external
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__(, 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 = []

        if self.message is None and channel is None:
            channel =

        return await super().run(users, channel, **kwargs)


Some utilities for Making Discord bot development easier.

Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages