mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
24 lines
851 B
Python
24 lines
851 B
Python
from discord.ext.commands import Context
|
|
from discord import Client
|
|
from Controllers.AbstractController import AbstractController
|
|
from Exceptions.Exceptions import BadCommandUsage
|
|
from Controllers.ControllerResponse import ControllerResponse
|
|
|
|
|
|
class SkipController(AbstractController):
|
|
def __init__(self, ctx: Context, bot: Client) -> None:
|
|
super().__init__(ctx, bot)
|
|
|
|
async def run(self) -> ControllerResponse:
|
|
if self.player.playlist.looping_one:
|
|
embed = self.embeds.ERROR_DUE_LOOP_ONE_ON()
|
|
error = BadCommandUsage()
|
|
return ControllerResponse(self.ctx, embed, error)
|
|
|
|
voice = self.controller.get_guild_voice(self.guild)
|
|
if voice is None:
|
|
return ControllerResponse(self.ctx)
|
|
else:
|
|
voice.stop()
|
|
return ControllerResponse(self.ctx)
|