Hey everyone, I’m pretty new to bot development and running into a frustrating issue. I followed all the steps for deploying my bot to Heroku and everything seemed to go smoothly during the deployment process. The deployment completed without any errors, but my bot just shows as offline in Discord.
The weird part is that when I launch the Bot Maker application on my local machine, the bot comes online and works perfectly fine. But as soon as I close the application, it goes back to offline status.
I thought the whole point of deploying to Heroku was to make the bot run independently without needing my local machine running. Am I missing something obvious here? Is there a way to make the bot stay online 24/7 after deployment, or do I need to keep the Bot Maker app running locally? Any help would be appreciated!
This is a classic Heroku deployment issue. Your bot files aren’t configured for Heroku’s environment. Bot Maker handles execution automatically when you run it locally, but Heroku needs specific files to know what to run. First, check if you’ve got a Procfile in your project root. This tells Heroku what command to execute - should look like worker: node index.js or whatever your main bot file is. Also make sure your package.json has the right start scripts. Another common culprit: your bot token and environment variables aren’t set up in Heroku’s config vars. Even if deployment works, the bot won’t connect to Discord without proper auth. Go to your Heroku dashboard > Settings and verify all your environment variables are there. Once you fix the config, your bot will run 24/7 without your local machine. Since it works locally, your code’s fine - just a deployment setup problem.
your heroku dyno’s probably sleeping. free tier apps go to sleep after 30 minutes of no activity, and they’re slow to wake up. you can ping your bot every few minutes with a basic http request to keep it alive, or just upgrade to a paid dyno for real 24/7 uptime.
Had the exact same issue when I first deployed to Heroku. You’re missing the worker dyno configuration. After deployment, you’ve got to manually enable the worker dyno in your Heroku dashboard. Hit the Resources tab in your app dashboard - you’ll see your dynos listed there. The worker dyno’s probably off by default, so click edit and toggle it on. This won’t happen automatically during deployment. Web dynos handle HTTP requests, but Discord bots need worker dynos to run continuously. Once I flipped it on, my bot stayed online no problem. Also check your logs with heroku logs --tail to catch any runtime errors that might be stopping the bot from starting.