我正在设置一个新的不和谐机器人,并想加入一个语音频道。当我编写命令!join
时,终端向我发送此消息:
DeprecationWarning: Collection#filterArray: use Collection#filter instead.
const commando = require('discord.js-commando');
class JoinChannelCommand extends commando.Command {
constructor(client) {
super(client, {
name: 'join',
group: 'music',
memberName: 'join',
description: 'Joins the voice channel of the commander'
});
}
async run(message, args) {
if (message.member.voiceChannel) {
if (!message.guild.voiceConnection) {
message.member.voiceChannel.join()
.then(connection => {
message.reply("Successfully Joined!");
});
}
} else {
message.reply("You must be in a vocie channel to summon me!");
}
}
}
module.exports = JoinChannelCommand;