Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Bot leaving and not playing after rejoining #35

Open
Salagean-Mircea-Codrin-Ioan opened this issue Nov 2, 2021 · 1 comment
Open

Bot leaving and not playing after rejoining #35

Salagean-Mircea-Codrin-Ioan opened this issue Nov 2, 2021 · 1 comment

Comments

@Salagean-Mircea-Codrin-Ioan

When the bot leaves and rejoins i get an error when i whant him to play a song: discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Not connected to voice.

@Salagean-Mircea-Codrin-Ioan
Copy link
Author

@client.command()
async def stop(ctx):
player = music.get_player(guild_id=ctx.guild.id)
await player.stop()
await ctx.send("Stopped")

@client.command()
async def leave(ctx):
player = music.get_player(guild_id=ctx.guild.id)
await player.stop()
await ctx.voice_client.disconnect()
await ctx.send("Stopped")

Use this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant