[ERROR] Encountered error on event listener "moderationLog"

Full Error: https://pastebin.com/GnkxtJqe moderationLog Listener: https://pastebin.com/DLgksCHN I'm calling the moderationLog Listener on the automodBan function:
return container.client.emit("moderationLog", data, false);
return container.client.emit("moderationLog", data, false);
No idea why it saying something about Line 17, the DM embed is sent without problems, the problem must be at the webhookEmbed since the webhook is not being sent, I have another function which does the same as automodBan except instead of banning it just adds a warn to the user's record, in this function both dm and webhook are sent without problems Part of the error i'm talking about: at ModerationLogListener.run (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\listeners\moderationLog.js:17:8)
Pastebin
Full Error - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
moderationLog.js - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
5 Replies
d.js toolkit
d.js toolkit•12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna•12mo ago
you pass in undefined in setTitle
-Carlos👑
-Carlos👑OP•12mo ago
You mean this?
.setTitle(
automod ? getAutomodPunishmentTitle(data) : getPunishmentTitle(data)
)
.setTitle(
automod ? getAutomodPunishmentTitle(data) : getPunishmentTitle(data)
)
If yes I logged both functions and both were defined
treble/luna
treble/luna•12mo ago
your error disagrees
-Carlos👑
-Carlos👑OP•12mo ago
yeah that was it, since it was a ban it returned undefined because there was no ban option in the function and it was defined because I was trying it while the punishment type being warn
Want results from more Discord servers?
Add your server