My discord bot is offline, but few seconds ago it worked. Help

Few seconds ago my bot worked, and now it is offline no matter what I do and I keep getting this error. I don’t know if my discord bot is banned or what :confused:

I tried curl -I https://discordapp.com/api/v7/gateway but it didn’t throw any error.

This isn’t anything related with discord gateaways.

As your error says, it cannot get the channel which has the ID of process.env.DISCORD_CHANNEL_ID.
It is either in a server that the bot is not in, or generally, the bot doesn’t have access to that channel. (Meaning that for the bot, the channel is “invisible”, like it never existed)
So, your problem may be either the mentioned above or you have provided an invalid channel ID.

But I commented out everything expect for discord.login thing and there is no errors, and my bot is still offline. I also tried refreshing it.

var express = require("express");
var app = express();
var server = require("http").createServer(app);
//var io = require("socket.io")(server);
var port = process.env.PORT || 3000;

server.listen(port, function() {
  console.log("Server listening at port %d", port);
});

app.use(express.static("public"));

//const fs = require("fs");
//const request = require("request");

const Discord = require("discord.js");
const client = new Discord.Client();

//client.disconnect()
client.login(process.env.DISCORD_TOKEN);

I see your using pnpm-volume. Try downgrading your discord.js package to 11.6.1 . I had the same problem with the latest discord.js. This is probably due to depreciation of a lot of things

I did it, and it’s still offline. (JavaScript is my second account)
image
image

Have you gotten any more errors since downgrading discord.js?

Nope


Bot uses proper credentials but it doesn’t trigger on client ready and its offline.

My bot is also offline at the moment with it’s page saying either 504 Gateway Timeout or it just getting stuck on starting, I’d say give it a couple of minutes to an hour and see if the issue has been fixed.

I am doing this for 3 hours. I don’t think 3 hours ins’t even to restart. My page doesn’t have any errors. Glitch memory, and other stuff is at lowest values so there is no problem with that.


and yet still my bot is offline.

What is your project’s name?

Try remixing your project. Make sure to manually copy .env file.

Problem has been resolved

I did remix my project, and it didn’t help.

Problem has been resolved.