【发布时间】:2020-12-01 18:34:40
【问题描述】:
我将如何提及语音频道,以便我可以让用户指定它希望机器人在哪个频道中播放音乐?
任何关于能够做到这一点的见解都会很好,因为你不能提及语音频道,所以你不能做 message.channels.mentions.first()
【问题讨论】:
-
您实际上可以提及 VoiceChannel。
<#ChannelID>.
标签: discord.js
我将如何提及语音频道,以便我可以让用户指定它希望机器人在哪个频道中播放音乐?
任何关于能够做到这一点的见解都会很好,因为你不能提及语音频道,所以你不能做 message.channels.mentions.first()
【问题讨论】:
<#ChannelID>.
标签: discord.js
您可以指定语音频道的名称,或直接创建对该频道的邀请,以便他们只需单击它并加入语音频道。
const channelToFind = "general"; //name of the voice channel you wanna find, MUST be a VC.
const channel = message.guild.channels.cache.find(x => x.name == channelToFind);
const inv = await channel.createInvite();
message.channel.send(`Click on the link to join the VC: ${inv}`)
【讨论】:
args?如果是这样,请在那里使用它。