CompuGenuis Programs
CompuGenuis Programs

Reputation: 430

How can I keep a python discord bot running online without the command prompt?

I have a discord bot coded with Python that runs when the command prompt is open, but if I close it, the bot appears offline. I need this bot active 24/7 because it's a greeting bot that greets new members. I don't want my command prompt running forever. Is there a way I can host the bot remotely online? Thanks in advance.

Upvotes: 1

Views: 10127

Answers (2)

Pointless
Pointless

Reputation: 21

Just use Heroku. People hate it for some reason. Works perfectly for me, with 100% uptime. Even if it says it has around 500 hours of uptime per month, that is only for websites, not bots. Just look up a tutorial on how to set one up. It's kind of complicated for people who use heroku for the first time but once you do it, you'll understand it instantly.

Upvotes: 1

Bilal Saleem
Bilal Saleem

Reputation: 633

You need to host your program on a server and not your computer.

A server is basically a computer that waits for other computers to contact it. Once they do, it'll provide them with some sort of response. But they can also initiate the contact themselves (which is what your program will do when it's running on a server).

The data and logic behind a website are all hosted on a web server. Since servers dont go down too often, websites are always accessible by other computers.

More info on servers here.

Here are some free hosts for python where you can have your program running.

Upvotes: 6

Related Questions