是否可以通过命令显示我的 Discord 机器人当前连接了多少个语音通道?

Is it possible to show by command how many voice channels my Discord bot is currently connected to?

我想通过命令显示我的机器人当前有多少个语音通道,这可能吗?也许还有额外的东西,比如服务器 ID/channel ID。但这不是必需的,只需命令和数量就可以了。 我已经为 js 找到了方法,但没有为 Discord.py.

找到方法

您可以使用 Bot.voice_clients 属性

voice_states = bot.voice_clients # or client, however you named your instance

await ctx.send(f'I am currently in {len(voice_states)} voice channels')