[docs]classGoldyBotError(Exception):"""Raises whenever there's a known error in goldy bot."""def__init__(self,message:str,logger:log.Logger=None):message=Colours.RED.apply_to_string(message)ifloggerisNone:logger=goldy_bot_loggerlogger.error(message)super().__init__(message)
[docs]classInvalidTypeInMethod(GoldyBotError):"""Raises whenever there is an invalid typing being inputted. Is normally is found in GoldyBot methods that default to None in it's arguments."""def__init__(self,message):super().__init__(f"You entered an invalid type in a method >> {message}")
[docs]classInvalidParameter(GoldyBotError):"""Raises whenever there is an invalid parameter in a command. Normally occurs when you have uppercase characters in a command argument."""def__init__(self,command:Command,invalid_param:str):super().__init__(f"The parameter used in the command '{command.name}' is NOT allowed >> {invalid_param}",logger=command.logger)
[docs]classNotSupportedYetForSlash(GoldyBotError):"""Raises whenever there is an operation that isn't supported just yet for slash commands."""def__init__(self,operation,logger:log.Logger=None):super().__init__(f"'{operation}' is not supported yet for slash commands! Will be supported soon...",logger=logger)