【发布时间】:2021-07-13 04:18:40
【问题描述】:
我正在使事件和命令处理程序看起来不错,但是当我运行 ,hello 命令时出现错误,这是错误:
if(!message.content.startsWith(Prefix) || message.author.bot) 返回; ^
TypeError: 无法读取未定义的属性“startsWith”
代码如下:
module.exports = (Discord, Client, message) => {
const Prefix = ',';
if(!message.content.startsWith(Prefix) || message.author.bot) return;
const args = message.content.slice(Prefix.length).split(/ +/);
const cmd = args.shift().toLowerCase();
const Command = Client.commands.get(cmd);
if(Command) Command.execute(Client, message, args, Discord, Random, RadnomPuppy);
}
我没有发现任何问题
【问题讨论】:
-
,hello命令是我目前唯一的命令
标签: javascript discord discord.js