[ERROR] Encountered error on event listener "moderationLog"
Solution:Jump to solution
moreover, looking at the error stack
at ModerationLogListener.run (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\listeners\moderationLog.js:19:8)
the error appears here, maybe your getPunishmentTitle or getAutomodPunishmentTitle is returning null/undefined instead of a string, better fix that...
18 Replies
The problem is with the
webhookEmbed
, since the DM is sent without problemswhere are you emitting the event?
Solution
moreover, looking at the error stack
at ModerationLogListener.run (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\listeners\moderationLog.js:19:8)
the error appears here, maybe your getPunishmentTitle or getAutomodPunishmentTitle is returning null/undefined instead of a string, better fix that
and the other error appears at
at Object.automodBan (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\utils.js:507:27)
(i have no idea what is that 507th line and what you are doing here but that much pretty much explain why you are encountering errors)
inside the automodBan function
return container.client.emit("moderationLog", data, false);
the problem is with the webhook embed, also this only happends if automodBan is triggered@🠷Carlos👑
^
logged both functions, both were defined
so both give a return value for that test "data"?
was this the line 507?
yes for both questions
my question is, where do you use the automodBan, if you are assigning a value to it later on, remove the return before the emit
basically on my messageCreate event I have the automod listener emit
makes no sence because where would you get that "data" inside your messageCreate which automodBan gives you
@🠷Carlos👑 and yes, if possible i want to know how you are invoking the automod listener event inside messageCreate
I meant this, this is my messageCreate event
.
and in the automod listener I use the automodPunish function
wait hold up
well well
now i hope you understand where it went wrong
nvm it was not it
I was confused for a second
Issue was fixed btw
mark this as solved with whatever message helped you solve it
it was answered in the djs server
looking at djs server, the one I diagnosed was right
@Favna please mark this as solution