diff --git a/royalnet/serf/discord/playable.py b/royalnet/serf/discord/playable.py index e7f678a6..e9b202d5 100644 --- a/royalnet/serf/discord/playable.py +++ b/royalnet/serf/discord/playable.py @@ -59,3 +59,7 @@ class Playable: should ``yield`` once before doing anything else.""" yield raise NotImplementedError() + + async def destroy(self): + """Clean up the Playable, as it is about to be replaced or deleted.""" + raise NotImplementedError() diff --git a/royalnet/serf/discord/voiceplayer.py b/royalnet/serf/discord/voiceplayer.py index 73a15ba8..b5468542 100644 --- a/royalnet/serf/discord/voiceplayer.py +++ b/royalnet/serf/discord/voiceplayer.py @@ -110,3 +110,7 @@ class VoicePlayer: log.error(error) return self._playback_ended_event.set() + + async def change_playing(self, value: Playable): + await self.playing.destroy() + self.playing = value