Student projects
Host a Discord bot 24/7
A bot has to be online when someone in the server needs it, not fifteen minutes after the next message. Awake keeps the process running around the clock, and restarts it on its own if it crashes, so a bad unhandled exception at 2am does not need you awake too.
What you get.
Host a Discord bot that never sleeps, from ₹249 a month.
How it fits
- Discord.js, discord.py, or anything else that holds a gateway connection open
- Awake never sleeps, unlike Nap, which is built for a request-response web app instead
- Crashes restart the process automatically, on the same machine, with the same environment
- A database on the same machine if the bot needs to remember anything
- Logs stream live, so a bad deploy is obvious before someone in the server notices
Deploy it, step by step
The dashboard flow is the same for every project:
- Sign in with GitHub. Go to the dashboard and sign in. Your first sign-in puts 30 days of Nap credit in your balance, with no card and nothing to cancel.
- Create an application. Press New app and give it a name: three characters or more, letters, numbers and hyphens. The address is shown under the field as you type, and it is yourapp-yourlogin.dormhost.app.
- Pick the plan. Nap sleeps when nobody is using it. Awake never sleeps, which is what a bot, a worker or a scheduled job needs. Either way, you choose Mumbai, London or Ashburn.
- Point it at your repository. Paste the GitHub URL and the branch. Press Connect GitHub to pick from a list instead, which is also how a private repository is deployed. Then press Create and deploy.
- Watch the build log. The application opens on Overview, and Live logs streams the build. Listen on the port in the PORT variable we set, or EXPOSE one port in your Dockerfile, and the address answers as soon as the build finishes.
What is different about Discord bot
- Push the bot to GitHub. Node.js and Python are detected and built automatically; anything else needs a Dockerfile.
- Create the app on Awake, not Nap. Nap would put the bot to sleep after 15 minutes with no web requests, and a bot gets none.
- Put the bot token in the Environment section, never in the repository, and read it from the environment in code.
- A bot has nothing to listen on, so it does not need to bind to the PORT variable the way a web app does.
- Watch Live logs after the first deploy to confirm it logged in, then invite it to a server.
This needs Awake, ₹249 a month: it has to stay running, and Nap would put it to sleep after 15 minutes idle. All in: the build, the process, the database and the storage, nothing metered separately. Start with 30 days of free credit, no card required. The docs cover databases, domains and what to do when a build fails.