Originally published on esnoffical.com .
What "online 24/7" really means
A Discord bot is a program that keeps a live connection open to Discord (the gateway). Your bot shows as online only while that program is running on a computer that is switched on and connected to the internet. Close the laptop, let the PC go to sleep, or lose Wi-Fi, and the bot goes offline with it. So hosting a bot 24/7 is really one question: which computer will run your code all day, every day, and restart it when something goes wrong? There are four common answers, and each one trades money against effort.
Option 1: your own PC or a Raspberry Pi
Running the bot on your own machine costs nothing extra and is the best place to build and test it. Bots connect out to Discord, so you do not need to open ports or forward anything on your router. The catch is that the machine must stay on and awake, and the bot drops whenever your power, internet or Windows updates do.…