herokuslackbotkit

Slackbot + Heroku: Have to keep logging in


I'm having an issue with my botkit slack bot hosted on Heroku. The bot itself is just the "starter kit."

https://github.com/howdyai/botkit-starter-slack

After a little while, the bot stops working. The logs complain of not being able to find the team. I hit the /login path of my heroku-deployed app and allow it and it works again for a bit.

Is there a heroku configuration that I need to change to keep it from going idle or something? Or is this an issue with the starter kit? Could there be something I need to do in the slack configuration?


Solution

  • I am pretty sure that you run your bot on a hobby dyno. Heroku sends hobby dynos to sleep if they dont receive any requests.

    What had happened:

    1. You deployed the bot -> the bot is running and working
    2. Everybody can write with the bot -> so great!
    3. After a few minutes, while the bot is not used, the dyno falls asleep
    4. At this moment the bot is not working
    5. You hit the /login request and yeah -> the dyno starts again and the bot is running and working

    Read more about free dynos here: https://devcenter.heroku.com/articles/free-dyno-hours.

    Solution: Switch to Standard Dynos