Modifying play and prev commands to work with Process

This commit is contained in:
Rafael Vargas
2022-07-23 15:51:13 -03:00
parent 7efed8ab89
commit 56456bf2ed
20 changed files with 178 additions and 150 deletions

View File

@@ -12,11 +12,11 @@ class ClearHandler(AbstractHandler):
async def run(self) -> HandlerResponse:
# Get the current process of the guild
processManager = ProcessManager()
processContext = processManager.getRunningPlayerContext(self.guild)
if processContext:
processInfo = processManager.getRunningPlayerInfo(self.guild)
if processInfo:
# Clear the playlist
playlist = processContext.getPlaylist()
with processContext.getLock():
playlist = processInfo.getPlaylist()
with processInfo.getLock():
playlist.clear()
return HandlerResponse(self.ctx)