【发布时间】:2021-05-01 06:59:59
【问题描述】:
我实际上在过去 30 分钟内没有找到任何有效的方法。
当有人执行命令时,我希望我的音乐机器人检查它是否在语音频道中,以及机器人和用户是否在同一个频道中。
这是我最近的尝试:
if (
bot.voiceConnections.get(
bot.guilds.get(message.guild.id).id.channel.id !== 'undefined',
) &&
bot.voiceConnections.get(message.guild.id).channel.id !==
message.member.voice.channel.id
)
return message.channel.send(
'>>> :x: | You need to be in channel together with me.',
);
【问题讨论】:
-
您介意将代码放在代码块中吗?
-
对不起,我放错了```。
标签: discord.js