机器人未加入语音通道

时间:2018-10-20 12:22:03

标签: javascript node.js

当我使用此代码让我的机器人加入我的语音通道时,它没有起作用,他一直说我不在语音通道中,有人可以帮助我,因为当我运行命令时我没有错误或其他提示。

exports.run = async (client, message) => {
  const voiceChannel = message.member.voiceChannel;
  if (!message.member.voiceChannel) { return message.channel.send("You are not in a voice channel, Don't force me to be lonely!"); }

  const permissions = message.member.voiceChannel.permissionsFor(message.guild.me);
  if (permissions.has("CONNECT") === false) { return message.channel.send(":x: I do not have enough permissions to connect to your voice channel. I am missing the Connect permission."); }
  if (permissions.has("SPEAK") === false) { return message.channel.send("Wow. Invite me to play music for you, yet I can't speak in the channel. You're more heartless than my owner. Give me the channel permission to speak and then come back and invite me."); }

  message.member.voiceChannel.join();
  return message.channel.send(`Now tuned into: ${message.member.voiceChannel}. Ready and awaiting orders!`);
};

exports.conf = {
  enabled: true,
  runIn: ["text"],
  aliases: [],
  permLevel: 0,
  botPerms: [],
  requiredFuncs: [],
};

exports.help = {
  name: "join",
  description: "Joins the VC that you are in.",
  usage: "",
  usageDelim: "",
};

0 个答案:

没有答案