Adding types and changing some messages from class

This commit is contained in:
Rafael Vargas
2022-03-26 21:24:03 -04:00
parent f9b46e13ff
commit b4159c7e86
16 changed files with 154 additions and 359 deletions

View File

@@ -2,11 +2,13 @@ from discord.ext.commands import Context
from discord import Client
from Controllers.AbstractController import AbstractController
from Controllers.ControllerResponse import ControllerResponse
from Utils.Cleaner import Cleaner
class NowPlayingController(AbstractController):
def __init__(self, ctx: Context, bot: Client) -> None:
super().__init__(ctx, bot)
self.__cleaner = Cleaner()
async def run(self) -> ControllerResponse:
if not self.player.playing:
@@ -14,9 +16,10 @@ class NowPlayingController(AbstractController):
return ControllerResponse(self.ctx, embed)
if self.player.playlist.looping_one:
title = self.config.ONE_SONG_LOOPING
title = self.messages.ONE_SONG_LOOPING
else:
title = self.config.SONG_PLAYING
title = self.messages.SONG_PLAYING
await self.__cleaner.clean_messages(self.ctx, self.config.CLEANER_MESSAGES_QUANT)
info = self.player.playlist.current.info
embed = self.embeds.SONG_INFO(info, title)