Please describe the problem you are having in as much detail as possible:
When passing in the 'channel' param in the event, .id returns a error. I have gone to a help server and I am the only one with this issue
Include a reproducible code sample here, if possible:
// Place your code here
bot.on("channelDelete", (message, channel) => {
const deletedChannel = channel.id;
channel.guild.fetchAuditLogs({'type': 'CHANNEL_DELETE'})
.then(logs => logs.entries.find(entry => entry.target.id == deletedChannel))
.then(entry => {
let author = entry.executor;
let serverembed = new Discord.MessageEmbed()
.setDescription("Channel Updated")
.setColor("#db25db")
.addField("Channel", channel)
.addField("Moderator", author)
message.guild.channels.cache.find(ch => ch.name == "staff-logs").send(serverembed);
});
})
Further details:
Client#channelDelete does not have a message parameter
This would have been easily spotted by anyone half-competent on the server.
Hi, thank you. I do not fully remember adding that code however I am getting a new error:
TypeError: fields.flat is not a function
It directs me to discord.js's MessageEmbed.js file
Discord.js v12 requires at least Node v12.
Duplicate of #3949, #3913, #3910, #3888, #3887, #3883 and #4341
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.
Thank you so much for the help, I will move my error there!