My discord bot goes offline


#1

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!


#2

Hello @ItsJustpk

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"));

Discord bot going offline
#3

Will that keep my bot online?


#4

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


#5

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


#6

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


#7

With uptimerobot you can receive notifications directly to your discord server:


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)


#8

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♡