【发布时间】:2021-04-12 07:39:58
【问题描述】:
在为我的机器人发出命令时遇到错误
"TypeError: Cannot read property 'send' of undefined"
使用命令时,因为完整的代码有点长,我不想包含不必要的细节,我认为问题出在这一行
client.users.cache.get(customer).send(`Your order has been claimed and will be delivered soon.`);
因为当我删除该行时命令正常工作,但我不太确定它有什么问题,顺便说一句,“客户”是在代码开头定义的
let customer = message.author.id
【问题讨论】:
-
console this part
client.users.cache.get(customer)如果没有,问题就在这里。
标签: node.js discord.js