mirror of
https://github.com/RafaelSolVargas/Vulkan.git
synced 2025-10-29 16:57:23 +00:00
23 lines
882 B
Python
23 lines
882 B
Python
from discord.ext.commands import Context
|
|
from discord import Client
|
|
from Controllers.AbstractController import AbstractController
|
|
from Controllers.ControllerResponse import ControllerResponse
|
|
from Parallelism.ProcessManager import ProcessManager
|
|
from Parallelism.Commands import VCommands, VCommandsType
|
|
|
|
|
|
class PauseController(AbstractController):
|
|
def __init__(self, ctx: Context, bot: Client) -> None:
|
|
super().__init__(ctx, bot)
|
|
|
|
async def run(self) -> ControllerResponse:
|
|
processManager = ProcessManager()
|
|
processContext = processManager.getRunningPlayerContext(self.guild)
|
|
if processContext:
|
|
# Send Pause command to be execute by player process
|
|
command = VCommands(VCommandsType.PAUSE, None)
|
|
queue = processContext.getQueue()
|
|
queue.put(command)
|
|
|
|
return ControllerResponse(self.ctx)
|