mirror of
https://github.com/weyne85/discord_music_bot.git
synced 2025-10-29 16:58:27 +00:00
Chaging the folders and creating a separeted class for messages
This commit is contained in:
27
Controllers/ControllerResponse.py
Normal file
27
Controllers/ControllerResponse.py
Normal 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
|
||||
Reference in New Issue
Block a user