这是代码和错误消息它不仅适用于createvoicechannel命令,其他一切都有效。[![在此输入图像描述][1]][1]
module.exports = {
name: 'createtextchannel',
description: "this is a command!",
execute(message, args){
if(!message.member.hasPermission('MANAGE_CHANNELS')) return message.channel.send('You do not have the `MANAGE_CHANNELS` permission.');
let channelName = args.slice(0).join(' ');
message.guild.channels.create(channelName, {
type: "voice",
})
}
}```
[1]: https://i.stack.imgur.com/N6HRN.png
您确定有一个名称为"的命令吗;createvoicechannel";?在您发布的代码中,name: ""
是另一回事。"Cannot read property of undefined"
表示.get('createvoicechannel')
返回undefined,因此没有可调用的.execute
方法。