Catch error when attempting to remove autoplay
This commit is contained in:
parent
5691d2f058
commit
538c28244f
@ -17,7 +17,10 @@ class Stop(commands.Cog):
|
|||||||
"Disconnects the bot from the voice channel and clears the queue"
|
"Disconnects the bot from the voice channel and clears the queue"
|
||||||
player = self.bot.lavalink.player_manager.get(interaction.guild.id)
|
player = self.bot.lavalink.player_manager.get(interaction.guild.id)
|
||||||
|
|
||||||
self.bot.autoplay.remove(interaction.guild.id)
|
try:
|
||||||
|
self.bot.autoplay.remove(interaction.guild.id)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
player.queue.clear()
|
player.queue.clear()
|
||||||
await player.stop()
|
await player.stop()
|
||||||
await interaction.guild.voice_client.disconnect(force=True)
|
await interaction.guild.voice_client.disconnect(force=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user