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