Chaging the folders and creating a separeted class for messages

This commit is contained in:
Rafael Vargas
2022-03-22 17:53:21 -04:00
parent 2240c7535a
commit a828350201
27 changed files with 145 additions and 85 deletions

39
Exceptions/Exceptions.py Normal file
View File

@@ -0,0 +1,39 @@
from Config.Config import Configs
class Error(Exception):
def __init__(self, message='', title='', *args: object) -> None:
self.__message = message
self.__title = title
super().__init__(*args)
@property
def message(self) -> str:
return self.__message
@property
def title(self) -> str:
return self.__title
class ImpossibleMove(Error):
def __init__(self, message='', title='', *args: object) -> None:
config = Configs()
if title == '':
title = config.IMPOSSIBLE_MOVE
super().__init__(message, title, *args)
class MusicUnavailable(Error):
def __init__(self, message='', title='', *args: object) -> None:
super().__init__(message, title, *args)
class BadCommandUsage(Error):
def __init__(self, message='', title='', *args: object) -> None:
super().__init__(message, title, *args)
class UnknownError(Error):
def __init__(self, message='', title='', *args: object) -> None:
super().__init__(message, title, *args)