Heroku Discord Bot is offline

前端 未结 3 1501
无人共我
无人共我 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:40

    I know it's one year late but for those who are still having this issue, you have a limit of 550 hours per month (about 22 days) to host your bot with the free plan (paid plans get no run time limit)

    This might be the problem, you can check your notifications on heroku to find out.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-22 07:46

    The problem with your bot is that Heroku's free plan makes your application to sleep after 30 minutes of inactivity. The solution would be to select a paid plan to be sure that your bot remains active at all times.

    0 讨论(0)
提交回复
热议问题