discord py join and leave call

Solutions on MaxInterview for discord py join and leave call by the best coders in the world

showing results for - "discord py join and leave call"
Francisco
13 Jul 2017
1# Join command, joins the voice channel of whoever sent the command
2@bot.command()
3	async def join(context):
4        channel = context.author.voice.channel
5        await channel.connect()
6
7# Leave command, leaves the voice channel
8@bot.command()
9    async def leave(context):
10        await context.voice_client.disconnect()
11
12# Note that these are made to be run in main and not a cog, 
13# will still work in cog with minor edits