I\'m hosting a discord chat bot on heroku, and suddenly it went offline. I am new to hosting on heroku, so i don\'t understand a lot, but, i tried simple things like deploying a
That happens because you're using a web
dyno: a dyno that is put asleep if the application doesn't serve a website for more than 1 hour.
The solution is to switch from a web
dyno to a worker
dyno: this type does not serve websites (and if you're running a Discord bot you don't need it) and never goes to sleep.
Go in your Procfile
file & replace web
with worker
, it should look like this:
worker: npm start //this is the command you use to start your app.
If you want you can take a look at the Heroku article about sleeping apps.