#Fetching audit logs when there is an AutoMod blocked message event throws an error

10 messages · Page 1 of 1 (latest)

foggy harness
thin crypt
#

Maybe

thin crypt
#

I just mean, it's not my call

simple saffron
#

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

hearty summit
#

should be pretty easy to port

floral epoch
#

I think this is fixed in version 13 too. I noticed the tag says earlier version

languid oxideBOT
swift temple
#

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)
thin crypt
#

I think this has been fixed in v14

swift temple