Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get id of voice channel where bot is connected to

I Want to get the voice channel ID of the voice channel where the bot is connected to. is there any command for it ?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You are able to access discord.ext.commands.Bot‘s Voice Clients, which can allow you to see voice activity.

from discord.utils import get

@client.command(name="voice")
async def voice(ctx):
    voice_client = get(client.voice_clients, guild=ctx.guild)

    if not voice_client:
        return await ctx.reply("I am not currently connected to a voice channel!")

    voice_channel = voice_client.channel
    voice_channel_id = voice_channel.id
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading