UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
UnhandledPromiseRejectionWarning: ReferenceError: message is not defined
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on("messageUpdate", async (oldMessage, newMessage) => {
var logchannel = client.channels.cache.get("736913251274719273");
let logembed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.avatarURL)
.setThumbnail(message.author.avatarURL)
.setColor("RED")
.setDescription(":wastebasket: Message Deleted")
.addField("Message", message.content, true)
.setTimestamp()
logchannel.send(logembed)
})
client.login('token');
你的错误是说出了你的问题所在。
message.author.tag
message
函数中多处使用了变量,但你没有定义变量
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on("messageUpdate", async (oldMessage, newMessage) => {
var logchannel = client.channels.cache.get("736913251274719273");
let logembed = new Discord.MessageEmbed()
.setAuthor(message.author.tag, message.author.avatarURL)
.setThumbnail(message.author.avatarURL)
.setColor("RED")
.setDescription(":wastebasket: Message Deleted")
.addField("Message", message.content, true)
.setTimestamp()
logchannel.send(logembed)
})
client.login('token');
你的错误是说出了你的问题所在。
message.author.tag
message
函数中多处使用了变量,但你没有定义变量