Heroku Discord Bot is offline

前端 未结 3 1502
无人共我
无人共我 2021-01-22 07:12

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

3条回答
  •  被撕碎了的回忆
    2021-01-22 07:43

    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.

提交回复
热议问题