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

View File

@@ -0,0 +1,27 @@
from typing import Union
from discord.ext.commands import Context
from Exceptions.Exceptions import Error
from discord import Embed
class ControllerResponse:
def __init__(self, ctx: Context, embed: Embed = None, error: Error = None) -> None:
self.__ctx: Context = ctx
self.__error: Error = error
self.__embed: Embed = embed
self.__success = False if error else True
@property
def ctx(self) -> Context:
return self.__ctx
@property
def embed(self) -> Union[Embed, None]:
return self.__embed
def error(self) -> Union[Error, None]:
return self.__error
@property
def success(self) -> bool:
return self.__success