How to use the twitchio.dataclasses.Context function in twitchio

To help you get started, we’ve selected a few twitchio 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 TwitchIO / TwitchIO / twitchio / commands / bot.py View on Github external
Parameters
        ------------
        message: :class:`.Message`
            The message to create context from.
        cls: Optional
            The optional custom class to create Context.

        Returns
        ---------
        :class:`.Context`
            The context created.
        """
        prefix = await self.get_prefix(message)

        if not cls:
            cls = Context

        ctx = cls(message=message, channel=message.channel, user=message.author, prefix=prefix)
        return ctx
github TwitchIO / TwitchIO / twitchio / ext / commands / bot.py View on Github external
Parameters
        ------------
        message: :class:`.Message`
            The message to create context from.
        cls: Optional[Type]
            The optional custom class to create Context.

        Returns
        ---------
        :class:`.Context`
            The context created.
        """
        prefix = await self.get_prefix(message)

        if not cls:
            cls = Context

        ctx = cls(message=message, channel=message.channel, user=message.author, prefix=prefix)
        return ctx