Answers for "how to leave voice channel discord py"

0

how to leave voice channel discord py

import discord
import pytz
from discord.ext import commands
from datetime import datetime


@bot.command(aliases=['left',  'l'])
async def leave(ctx):
    await ctx.message.delete()
    try:
        if ctx.author.voice.channel and ctx.author.voice.channel == ctx.voice_client.channel:
            await ctx.voice_client.disconnect()
    except AttributeError:
        cfbot=discord.Embed(title='404 ,Not Found', description='The system did not find bot in your channel.\nBot may still be in the Channel, but somewhere!', color=0xFFFF00)
        cfbot.timestamp=datetime.now(pytz.timezone('Asia/Bangkok'))
        await ctx.send(embed=cfbot ,delete_after=7.5)
Posted by: Guest on July-29-2021

Code answers related to "how to leave voice channel discord py"

Python Answers by Framework

Browse Popular Code Answers by Language