#Fetching audit logs when there is an AutoMod blocked message event throws an error
10 messages · Page 1 of 1 (latest)
Maybe
I just mean, it's not my call
Should be no more than a ? added for optional chaining in AuditLogEntry class. If it‘s such a big deal to you you could make a PR yourself
should be pretty easy to port
I think this is fixed in version 13 too. I noticed the tag says earlier version
#8076 in discordjs/discord.js by Jiralite merged <t:1655143402:R>
fix(AuditLog): default changes to empty array
Fetching audit logs that contain an AutoMod blocked message event throws an error. How can I fix this?
guild.fetchAuditLogs({
limit: 1,
})
--------ERROR-------
C:\Users\proba\OneDrive\Desktop\CreatorBot\node_modules\discord.js\src\structures\GuildAuditLogs.js:489
this.target = this.changes.reduce((o, c) => {
^
TypeError: Cannot read properties of null (reading 'reduce')
at new GuildAuditLogsEntry (C:\Users\proba\OneDrive\Desktop\CreatorBot\node_modules\discord.js\src\structures\GuildAuditLogs.js:489:34)
at new GuildAuditLogs (C:\Users\proba\OneDrive\Desktop\CreatorBot\node_modules\discord.js\src\structures\GuildAuditLogs.js:202:21)
at Function.build (C:\Users\proba\OneDrive\Desktop\CreatorBot\node_modules\discord.js\src\structures\GuildAuditLogs.js:212:18)
at Guild.fetchAuditLogs (C:\Users\proba\OneDrive\Desktop\CreatorBot\node_modules\discord.js\src\structures\Guild.js:796:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.execute (C:\Users\proba\OneDrive\Desktop\CreatorBot\events\guild\guildMemberUpdate.js:13:33)
I think this has been fixed in v14
Awesome, thanks again for the info