我想獲取機器人連接到的語音通道的語音通道 ID。有什么命令嗎?
uj5u.com熱心網友回復:
您可以訪問discord.ext.commands.Bot的語音客戶端,它可以讓您查看語音活動。
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
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/483175.html
上一篇:大熊貓資料框中貢獻最大值的列
