Subclassing Button class for each button, changing context interface for handlers

This commit is contained in:
Rafael Vargas
2022-07-27 17:20:57 -03:00
parent 4f11506c2b
commit ca754c6f62
36 changed files with 227 additions and 85 deletions

View File

@@ -0,0 +1,16 @@
from Config.Emojis import VEmojis
from UI.Responses.AbstractCogResponse import AbstractCommandResponse
from Handlers.HandlerResponse import HandlerResponse
class EmoteCommandResponse(AbstractCommandResponse):
def __init__(self, response: HandlerResponse) -> None:
super().__init__(response)
self.__emojis = VEmojis()
async def run(self) -> None:
if self.response.success:
await self.message.add_reaction(self.__emojis.SUCCESS)
else:
await self.message.add_reaction(self.__emojis.ERROR)