When I listen to the guildUpdate event, and a guild is deleted, the guildUpdate event is triggered. Once it's triggered, the functions oldGuild.iconUrl and newGuild.iconUrl result in a "not a function" error. Both newGuild.available and oldGuild.available are true.
client.on("guildUpdate", (oldGuild, newGuild) => {
oldGuild.iconUrl();
}
Further details:
Relevant client options:
Correct, it isn't a function. JavasScript is case-sensitive and the method is <Guild>.iconURL()
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.
@monbrey Oops. However, why is this event being triggered at all? I feel that only guildDelete should be triggered
We can't control which events Discord emits.
Again, the issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.
I was unaware that discord.js was merely forwarding the events that Discord emits, my bad. Thanks for your help