Finishing PrevController

This commit is contained in:
Rafael Vargas
2022-03-26 18:45:40 -04:00
parent f09568bd69
commit f9b46e13ff
3 changed files with 10 additions and 24 deletions

View File

@@ -1,7 +1,7 @@
from discord.ext.commands import Context
from discord import Client
from Controllers.AbstractController import AbstractController
from Exceptions.Exceptions import ImpossibleMove, UnknownError
from Exceptions.Exceptions import BadCommandUsage, ImpossibleMove, UnknownError
from Controllers.ControllerResponse import ControllerResponse
@@ -27,6 +27,11 @@ class PrevController(AbstractController):
embed = self.embeds.UNKNOWN_ERROR()
return ControllerResponse(self.ctx, embed, error)
if self.player.playlist.looping_all or self.player.playlist.looping_one:
error = BadCommandUsage()
embed = self.embeds.FAIL_DUE_TO_LOOP_ON()
return ControllerResponse(self.ctx, embed, error)
await self.player.play_prev(self.ctx)
def __user_connected(self) -> bool: