H
H
Hanuka32362020-07-21 02:21:46
Python
Hanuka3236, 2020-07-21 02:21:46

How to find out in which voice channel the user who wrote the command is located?

The user writes a certain command and the bot responds with a message with the name of the voice channel in which the user is currently located or writes a message stating that the author of the message is not currently in any of the voice channels. Interested only in how to find out the name of the channel and write it to a variable.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Taruu, 2020-07-21
@Hanuka3236

@bot.command()
async def bb(ctx):
    channel = ctx.message.author.voice.channel
    if not channel:
        await ctx.send("You are not connected to a voice channel")
        return

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question