Question

How do i make my discord bot run 24/7?

When i close the terminal the bot closes how do i make it not close, So it can run all night all day.

Subscribe
Share

@andreijcornejo. Do you make Bot Code , Paste Bot Token ?

@RealDK I send you a friend request because I also want help with that. If you can, DM me.

@RealDK Where do i paste the bot token at?

This comment has been deleted

@andreijcornejo Add me on discord at DK#0001 I Can help

@andreijcornejo Add me On Discord DK#0001 I Can Show you.

Hello there i made a discord app and i invited it on my server and it is offline and i want it to turn it online?

So question how do I get DigitalOcean to run my discord bot?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You need some node module that would allow to run it forever.

I can recommend you two - pm2 or forever. I’m more on side of pm2 as it have better process management. Also there are tutorials on DO for setting it up.

Follow PM2 part of Set Up Node.js App for Production. It’ll show you how to make it run always and as a service (e.g. automatically run it when servers reboot or after power on)

Hi there,

Just came across this question and wanted to mention that in addition to using PM2 by following the steps here: Set Up Node.js App for Production., I could also suggest going through this tutorial here on How To Build a Discord Bot with Node.js.

Regards, Bobby

You need to host the script somewhere at all times, this is what a server is typically used for, I have bought a VPS (Virtual Private Server) for my discord bots so I can host them on there and they will always be running, these VPS’s cost around 5$ a month.

This comment has been deleted

Instead of using PM2 or Forever… you can simply use & install SCREEN… just open a new screen, run your process… then close your terminal.

Hey TastyCookies, I had this problem too. If you’re trying to make the bot appear as online, you may need to connect to Discord’s sockets, which will make the dot appear and the bot will show as online. Just connecting and making REST calls isn’t enough. This is what we did with Guilded’s Discord bot (http://www.guilded.gg/discord_bots), and it came online after that. I’d personally recommend discord.io for websockets for this.

Unfortunately there is now 24/7 not for discord music yet. Discord is only 2 years old and is still in development.

Ugh… This did not really help me cause I use a chromebook… Is there a way to get custom bot commands using a chromebook?