#GuildDeleteEvent called at bot start

11 messages · Page 1 of 1 (latest)

mild tree
#

When I start the bot, the GuildDeleteEvent is always called for the same guilds. The bot is also no longer on these servers. But this happens every time I start the bot. Could it be that the guilds are still somehow wrong in the cache or something?

hushed badgerBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
  • Marked as resolved by OP
glacial marlin
#

Sounds like that guild might be quarantined and your bot actually is still in that guild but the guild is acting as if it didn’t exist anymore because of quarantine

mild tree
#

But when I request the API directly, I get an “Unknown Guild” back. It's just strange that it's always for the same few guilds. And it's been like this for more than a week.

#

So should I return directly if (!guild.available) in the GuildDeleteEvent above? Or can this break something? Because it is important that we do not save any data from guilds that we are not on.

glacial marlin
#

Yes. Unavailable guilds are not the same as guilds your bot actually left

mild tree
#

Does that mean I can include if (!guild.available) in the GuildDeleteEvent without any problems?

#

But does that really make sense, since it happens every time the bot restarts for the same guilds, and it's happened over 10 times now. It can't be that the guilds are unavailable for so long, can it?

glacial marlin
mild tree
glacial marlin
#

Yes (it should, but you could just… check)