discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.36k stars 3.97k forks source link

audit logs INTEGRATION_DELETE : cannot read property id #4690

Closed 0xMecha closed 4 years ago

0xMecha commented 4 years ago

hello when im trying guild.fetchAuditLogs({type: "INTEGRATION_DELETE"}) or guild.fetchAuditLogs({type: 82}) its return

TypeError: Cannot read property 'id' of undefined

and thats all of the error 2020-08-11T23:13:16.872330+00:00 app[worker.1]: at UserManager.add (/app/node_modules/discord.js/src/managers/BaseManager.js:45:48) 2020-08-11T23:13:16.872331+00:00 app[worker.1]: at new Integration (/app/node_modules/discord.js/src/structures/Integration.js:65:35) 2020-08-11T23:13:16.872336+00:00 app[worker.1]: at new GuildAuditLogsEntry (/app/node_modules/discord.js/src/structures/GuildAuditLogs.js:466:9) 2020-08-11T23:13:16.872336+00:00 app[worker.1]: at new GuildAuditLogs (/app/node_modules/discord.js/src/structures/GuildAuditLogs.js:164:21) 2020-08-11T23:13:16.872336+00:00 app[worker.1]: at Function.build (/app/node_modules/discord.js/src/structures/GuildAuditLogs.js:174:18) 2020-08-11T23:13:16.872336+00:00 app[worker.1]: at /app/node_modules/discord.js/src/structures/Guild.js:837:36 2020-08-11T23:13:16.872337+00:00 app[worker.1]: at runMicrotasks () 2020-08-11T23:13:16.872338+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:97:5)

qwright10 commented 4 years ago

Please ask in the Discord.js support server before opening an issue here. https://discord.gg/bRCvFy9

0xMecha commented 4 years ago

Please ask in the Discord support server before opening an issue here. https://discord.gg/bRCvFy9

i didnt ask that server but i asked some discord bot servers and they have same issue

advaith1 commented 4 years ago

ah, this is an issue due to a recent Discord update; integration.user may now be not present, i've made a docs PR reflecting this (discord/discord-api-docs#1886) but Discord.js should be updated to not assume that user will exist.

advaith1 commented 4 years ago

hey @0xtokuchi can you please test my PR (npm i advaith1/discord.js#integration-fix) and see if it fixes your issue?

0xMecha commented 4 years ago

hey @0xtokuchi can you please test my PR (npm i advaith1/discord.js#integration-fix) and see if it fixes your issue?

sure, i will try thanks!

0xMecha commented 4 years ago

hey @0xtokuchi can you please test my PR (npm i advaith1/discord.js#integration-fix) and see if it fixes your issue?

yeah its fixed !

advaith1 commented 4 years ago

thanks!

advaith1 commented 4 years ago

@0xtokuchi can you re-open this issue? as the PR hasn't been merged yet (github will auto-close this issue when the PR is merged)

PR merged, switch from the fork to djs master (npm i discordjs/discord.js)