1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Add a destroy method to Playables

This commit is contained in:
Steffo 2020-03-28 20:43:14 +01:00
parent 49c1b39a53
commit 542c5897a6
2 changed files with 8 additions and 0 deletions

View file

@ -59,3 +59,7 @@ class Playable:
should ``yield`` once before doing anything else.""" should ``yield`` once before doing anything else."""
yield yield
raise NotImplementedError() raise NotImplementedError()
async def destroy(self):
"""Clean up the Playable, as it is about to be replaced or deleted."""
raise NotImplementedError()

View file

@ -110,3 +110,7 @@ class VoicePlayer:
log.error(error) log.error(error)
return return
self._playback_ended_event.set() self._playback_ended_event.set()
async def change_playing(self, value: Playable):
await self.playing.destroy()
self.playing = value