Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @client.command(pass_context=True, aliases=['j'])
- async def join(ctx):
- global voice
- channel = ctx.message.author.voice.channel
- voice = get(client.voice_clients, guild=ctx.guild)
- if voice and voice.is_connected():
- await voice.move_to(channel)
- print(voice)
- else:
- await ctx.message.channel.send(f'Joined {channel}')
- voice = await channel.connect()
- @client.command(pass_context=True, aliases=['l'])
- async def leave(ctx):
- global voice
- channel = ctx.message.author.voice.channel
- print(voice)
- voice = get(client.voice_clients, guild=ctx.guild)
- if voice and voice.is_connected():
- await voice.disconnect()
- else:
- await ctx.message.channel.send("I'm not in a voice channel")
- print(voice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement