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

32
Views/AbstractView.py Normal file
View File

@@ -0,0 +1,32 @@
from abc import ABC, abstractmethod
from Controllers.ControllerResponse import ControllerResponse
from discord.ext.commands import Context
from discord import Client, Message
class AbstractView(ABC):
def __init__(self, response: ControllerResponse) -> None:
self.__response: ControllerResponse = response
self.__context: Context = response.ctx
self.__message: Message = response.ctx.message
self.__bot: Client = response.ctx.bot
@property
def response(self) -> ControllerResponse:
return self.__response
@property
def bot(self) -> Client:
return self.__bot
@property
def message(self) -> Message:
return self.__message
@property
def context(self) -> Context:
return self.__context
@abstractmethod
async def run(self) -> None:
pass