我有必要使用id连接到语音频道。经过一些研究,我发现了这样的东西:-
channel: discord.channel.VoiceChannel = ctx.message.author.voice.channel
但我找不到一种方法来获得信道使用它的id。
感谢
您可以使用guild.get_channel
方法通过id获取语音通道。
voicechannel = guild.get_channel(123456789012345678)
如果你还没有公会,你可以从消息中获得。
voicechannel = message.guild.get_channel(123456789012345678)