我正在制作我的第一个不和谐机器人,现在我正在为我的机器人制作“踢”命令。但是,每当我运行“kick”命令时,它都会告诉我 TypeError: Cannot read property 'get' of undefined 错误。我什么都试过了,有人可以帮我吗?
我的踢球命令:
module.exports = {
name: 'kick',
description: "This command kicks a member!",
execute(message, args){
const target = message.mentions.users.first();
if(target){
const memberTarget = message.guild.member.cache.get(target.id);
memberTarget.kick();
message.channel.send("User has been kicked");
}else{
message.channel.send(`You coudnt kick that member!`);
}
}
}