How to use the twitchio.ext.commands.errors.CommandError 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 / ext / commands / errors.py View on Github external
class MissingRequiredArgument(CommandError):
    """Exception raised when a required argument is not passed to a command.

    Attributes
    ----------
    param: :class:`inspect.Parameter`
        The argument that is missing.
    """
    def __init__(self, param):
        self.param = param
        super().__init__(f'{param.name} is a required argument that is missing.')


class BadArgument(CommandError):
    """Exception raised when a bad argument is passed to a command."""
github TwitchIO / TwitchIO / twitchio / ext / commands / errors.py View on Github external
class CommandError(TwitchIOBException):
    """Base Exception for errors raised by commands."""
    pass


class CommandNotFound(CommandError):
    """Exception raised when a command is not found."""
    pass


class CheckFailure(CommandError):
    """Exception raised when a check fails."""


class MissingRequiredArgument(CommandError):
    """Exception raised when a required argument is not passed to a command.

    Attributes
    ----------
    param: :class:`inspect.Parameter`
        The argument that is missing.
    """
    def __init__(self, param):
        self.param = param
        super().__init__(f'{param.name} is a required argument that is missing.')


class BadArgument(CommandError):
    """Exception raised when a bad argument is passed to a command."""
github TwitchIO / TwitchIO / twitchio / ext / commands / errors.py View on Github external
from twitchio.errors import TwitchIOBException


class CommandError(TwitchIOBException):
    """Base Exception for errors raised by commands."""
    pass


class CommandNotFound(CommandError):
    """Exception raised when a command is not found."""
    pass


class CheckFailure(CommandError):
    """Exception raised when a check fails."""


class MissingRequiredArgument(CommandError):
    """Exception raised when a required argument is not passed to a command.

    Attributes
    ----------
    param: :class:`inspect.Parameter`
        The argument that is missing.
    """
    def __init__(self, param):
        self.param = param
        super().__init__(f'{param.name} is a required argument that is missing.')
github TwitchIO / TwitchIO / twitchio / ext / commands / errors.py View on Github external
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

__all__ = ('CommandError', 'CommandNotFound', 'MissingRequiredArgument', 'BadArgument', 'CheckFailure',)


from twitchio.errors import TwitchIOBException


class CommandError(TwitchIOBException):
    """Base Exception for errors raised by commands."""
    pass


class CommandNotFound(CommandError):
    """Exception raised when a command is not found."""
    pass


class CheckFailure(CommandError):
    """Exception raised when a check fails."""


class MissingRequiredArgument(CommandError):
    """Exception raised when a required argument is not passed to a command.

    Attributes
    ----------
    param: :class:`inspect.Parameter`
        The argument that is missing.
    """