My discord bot goes offline

Hello dear glitch staff.

it took me months to make a Discord.js bot and now that i managed to have time to put it on glitch i would love if it staid online. it stays online for loke 10min and then goes offline. i heard some people talking about a watch.json thing. i dont know what that is but if it can help i would love to have some more info. Please help me i love my bot and i have people who need it to moderate on my discord. Please Help!

Hello @depressed_chip

It’s cool to hear that you’re moving to Glitch!’

When a project does not get any requests it will forcefully be shutdown, what I’m meaning to say is, if you don’t have e.g. a server listening for requests and responding with 200 or something then it will be shutdown, your server needs to be requested at least per 5-10 minutes. That action can be done by using uptimerobot.

Creating a server can be done with this single line in the top of your code.

require("http").createServer(async (req,res) => { res.statusCode = 200; res.write("ok"); res.end(); }).listen(3000, () => console.log("Now listening on port 3000"));
1 Like

Will that keep my bot online?

That’s right - when used along side a service like https://uptimerobot.com/

Thanks for the tip. What tipe do i need to select? And btw you have discord? Do its easier to talk

Select the HTTP(s) option. No, we don’t have a Discord - just this forum.

With uptimerobot you can receive notifications directly to your discord server:
2018-08-15%2022-16-12%20%23playground%20-%20Discord
Just add Slack Alert Contact to monitor with your discord webhook URL with appended /slack at the end of it (https://discordapp.com/api/webhooks/WEBHOOK_ID/WEBHOOK_TOKEN/slack)

Hello, i would like to tank everyone for the help you are giving me. I really like this community. Tho I found an old post on how to do it and it seems to be working great. Again, thanks anyway♡

1 Like

Can you share me the post??

@Pixel_Pie,

Glitch no longer allows UptimeRobot or any pinging service for that matter. The best way to keep your glitch project alive is to upgrade to a boosted plan. There is still a workaround, which if you’d like please message me.

you know i read this right lol

6 Likes

:eyes: i was never here

2 Likes