【发布时间】:2020-09-24 00:57:37
【问题描述】:
我正在创建一个不和谐的机器人。在我的message 事件中,我使用message.content.toLowerCase() 将消息文本与另一个字符串进行比较。但是,它给了我这个错误:
TypeError: message.content.toLowerCase is not a function
我也试过message.content,结果给了我:
TypeError: message.content is not a function
我的代码:
client.on('message', (message) => {
if (message.content('ping')) {
message.send('pong');
}
});
【问题讨论】:
-
并且,所有其他命令也停止工作并出现相同的错误
-
尝试在事件中记录
message,看看会发生什么 -
怎么样?,抱歉我是新手
-
我强烈建议先学习 Javascript,然后再学习
-
:(((((((((((((((((((((((((((((((((((())))
标签: javascript node.js discord discord.js