I am working on a bot and am building an Audit Logging system based on a tutorial from The North Solution on YouTube. I keep getting this error when an audit log event is generated. I’ve spent hours looking through the code and using the debugger to track it down. The debugger points to a line of code that is for sure not wrong as it is identical to the tutorial video.
const { EmbedBuilder } = require("discord.js");
const loggingSchema = require("../../schemas/auditLogging");
const mConfig = require("../../messageConfig.json");
const aConfig = require("../../auditConfig.json");
module.exports = async (client, auditLogEntry, guild) => {
let dataGD = await loggingSchema.findOne({ GuildID: guild.id });
if (!dataGD) return;
const auditActionValue = auditLogEntry.action;
Is there a better way to track down the error? I can provide any additional info as needed.
https://pastebin.com/U6YRHis6[The file the error seems to be coming from.]3