【发布时间】:2021-06-11 17:14:57
【问题描述】:
我在运行时收到此错误:(node:7112) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
const Discord = require("discord.js");
exports.run = async (client, message, member, args) => {
let Help = new Discord.RichEmbed()
.setAuthor(`[client] Help - ${message.author.username}#${message.author.discriminator}`)
.addField(`.help `, `bring up help list.`)
.setColor("#ff1100");
message.channel.send(Help);
/* Command Logger */
var DateTime = new Date();
var Hours = DateTime.getHours();
Hours = (Hours < 10 ? "0" : "") + Hours;
var Minutes = DateTime.getMinutes();
Minutes = (Minutes < 10 ? "0" : "") + Minutes;
var Seconds = DateTime.getSeconds();
Seconds = (Seconds < 10 ? "0" : "") + Seconds;
let CommandLog = new Discord.RichEmbed()
.addField(`Command: Help`)
member.guild.cache.channels.cache.get('820470375602847745').send(CommandLog);
/* Command Logger */
message.delete();
};
exports.help = {
name: 'help',
};
【问题讨论】:
-
我给你加的
-
我确实添加了它,它在第 2 行
-
我很确定这无关紧要,因为它可以在没有命令记录器的情况下工作。
-
我只需要帮助使用 id 向特定频道发送消息。
标签: javascript node.js discord discord.js