Bot shutting down if not pinged/used


Idk if this is glitch help or discord bot help but ok.

Since glitch only has 3000 as a port i can’t use it to ping the bot with uptimerobot since i have the port used somewhere else. So could i add this code down bellow so that the project doesn’t die/sleep. Idk how it works. Maybe someone who knows discord.js can help

bot.on(“error”, async (err) => {
let channel = bot.channels.get(“571352423818330123”)


Hello @ramoth123! I’m sorry you’re having trouble with your project. I’m going to re-categorize your question into the “Discord Help” category so others can find it more easily.



Can you invite me to your project so I can take a closer look?


I think we have found a to make it work


What was the eventual solution?


Why won’t you be able to ping, add an file bot.js:
const express = require(“express”);
const app = express();

app.get("/", (request, response) => {
console.log(“Ping received!”);

// listen for requests :slight_smile:
const listener = app.listen(process.env.PORT, function() {
console.log('Your app is listening on port ’ + listener.address().port);


Well, i am had that already but then i needed my port somewhere else in my project so i used port 3000 in 2 places which gave me an error, so i had to remove the ping request thing. But we found a way to have both. Idk how my dev did it but he did. So its fixed for now