class TooOldPyrogramVersion(Exception):
    def __init__(
        self,
        version_needed: str,
        pyrogram_version: str,
    ):
        super().__init__(
            f"Needed pyrogram {version_needed}+, " "actually installed is " f"{pyrogram_version}",
        )


class TooOldTelethonVersion(Exception):
    def __init__(
        self,
        version_needed: str,
        telethon_version: str,
    ):
        super().__init__(
            f"Needed telethon {version_needed}+, " "actually installed is " f"{telethon_version}",
        )


class TooOldHydrogramVersion(Exception):
    def __init__(
        self,
        version_needed: str,
        hydrogram_version: str,
    ):
        super().__init__(
            f"Needed hydrogram {version_needed}+, "
            "actually installed is "
            f"{hydrogram_version}",
        )


class InvalidStreamMode(Exception):
    def __init__(self):
        super().__init__(
            "Invalid stream mode",
        )


class NoMTProtoClientSet(Exception):
    def __init__(self):
        super().__init__(
            "No MTProto client set",
        )


class NoActiveGroupCall(Exception):
    def __init__(self):
        super().__init__(
            "No active group call",
        )


class NotInGroupCallError(Exception):
    def __init__(self):
        super().__init__(
            "The userbot there isn't in a group call",
        )


class AlreadyJoinedError(Exception):
    def __init__(self):
        super().__init__(
            "Already joined into group call",
        )


class TelegramServerError(Exception):
    def __init__(self):
        super().__init__(
            "Telegram Server is having some " "internal problems",
        )


class ClientNotStarted(Exception):
    def __init__(self):
        super().__init__(
            "Ensure you have started the process with start() " "before calling this method",
        )


class PyTgCallsAlreadyRunning(Exception):
    def __init__(self):
        super().__init__(
            "PyTgCalls client is already running",
        )


class TooManyCustomApiDecorators(Exception):
    def __init__(self):
        super().__init__(
            "Too Many Custom Api Decorators",
        )


class GroupCallNotFound(Exception):
    def __init__(
        self,
        chat_id: int,
    ):
        super().__init__(
            f"Group call not found with the chat id {chat_id}",
        )


class InvalidMTProtoClient(Exception):
    def __init__(self):
        super().__init__(
            "Invalid MTProto Client",
        )


class NoVideoSourceFound(Exception):
    def __init__(self, path: str):
        super().__init__(
            f'No video source found on "{path}"',
        )


class InvalidVideoProportion(Exception):
    def __init__(self, message: str):
        super().__init__(
            message,
        )


class NoAudioSourceFound(Exception):
    def __init__(self, path: str):
        super().__init__(
            f'No audio source found on "{path}"',
        )


class UnMuteNeeded(Exception):
    def __init__(self):
        super().__init__(
            "Needed to unmute the userbot",
        )


class GpytranslateException(Exception):
    pass


class TranslationError(GpytranslateException):
    def __init__(self, exception: Exception):
        self.args = (exception,)

    def __str__(self) -> str:
        return f"An error occurred while trying to translate/tts: {self.args[0]!r}"
