Source code for pylav.extension.red.errors

from __future__ import annotations

from redbot.core import commands

from pylav.core.context import PyLavContext


[docs] class IncompatibleException(EnvironmentError): """Command raised when an incompatible cog is already loaded"""
[docs] class MediaPlayerError(commands.CommandError): """ Base class for all media player errors. """
[docs] class UnauthorizedChannelError(MediaPlayerError): """ Raised when a command is used in a channel that is not authorized. """ def __init__(self, channel: int): self.channel = channel
[docs] class MediaPlayerCheckError(MediaPlayerError): """ Base class for all check errors. """
[docs] class MediaPlayerNotFoundError(MediaPlayerCheckError, commands.CheckFailure): """ Raised when a media player is not found. """ def __init__(self, context: PyLavContext) -> None: self.context = context
[docs] class NotDJError(MediaPlayerCheckError, commands.CheckFailure): """ Raised when user does not have DJ Perms. """ def __init__(self, context: PyLavContext) -> None: self.context = context