Discord.js: Can't start bot because of "unavailable guilds"

Created on 9 Dec 2019  Â·  4Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
When I try to log my bot in, I get this:
There are 1 unavailable guilds. Waiting for their GUILD_CREATE packets
Consequently, the bot's "ready" event is not called and it just disconnects after a few seconds.

Include a reproducible code sample here, if possible:


const botSettings = require("./bot_settings.json");
const Discord = require("discord.js");
const client = new Discord.Client();

// Set the prefix
let prefix = "!";
client.on("message", (message) => {
    console.log("a message was sent")
});


client.on("ready", async () => {
    console.log(`${client.user.username} is ready!`)
})

client.on("debug", async (err) => {
    console.log(err)
})

client.login(botSettings.token).then((tok) => {
    console.log('Bot logged in successfully!')
  }, err => {
    console.log(`The bot failed to login due to an error! The error follows:\n\n${err}\n\n`)
    client.destroy()
  })

Further details:

  • discord.js version: master
  • Node.js version: 10.15.3
  • Operating system: Windows 10
  • Priority this issue should have – please be realistic and elaborate if possible: High Priority - Can't Start Bot
  • [x] I have also tested the issue on latest master, commit hash: 123713305ad5a6aa1e5205a53713494009740aef
gateway bug

Most helpful comment

This seems to have helped for me.

All 4 comments

Please try updating your discord.js version
npm update discordjs/discord.js
This should have been fixed by #3393 which was just merged 20 Minutes ago.

This seems to have helped for me.

Yep, it has helped me, as well. I reinstalled Discord.js entirely.

@CryptAlchemy So if it helped you why dont you close the Issue?
Or am I understanding something wrong?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dmitry221060 picture Dmitry221060  Â·  3Comments

Alipoodle picture Alipoodle  Â·  3Comments

smchase picture smchase  Â·  3Comments

shukriadams picture shukriadams  Â·  3Comments

iCrawl picture iCrawl  Â·  3Comments