I think I've done it...

I’ve driven myself insane. Finally.
I’m kidding, that comes later.
I’ve found a way to keep Discord bots online 24/7. You can shut down your computer, anything.
So you use https://repl.it to host a bot, and then make a new HTTP(S) host by making a new file called server.js.
In that file, put this script:

const express = require('express');
const server = express();
server.all('/', (req, res)=>{
    res.send('This bot is alive.')
})
function keepAlive(){
    server.listen(3000, ()=>{console.log("Server is Ready!")});
}
module.exports = keepAlive;

At the top of the bot login file, put this string:

const keepAlive = require(’./server’);

After that, you go into the file in which your bot logs in with a token. Go one line above that, put in this string of code.

keepAlive();

Then, use https://uptimerobot.com/, create an account, create an HTTP(S) pinger, go to the repl.co link at the top of your REPL once you stop and start it, and put that link + the HTTPS in the slot it is supposed to be in.
The name can be anything. Make sure you’re setting the ping interval to under 30 minutes, if not 30 min.
Yes, I know I said that I was going inactive, but I never said that I could not stay on the forums :wink:
You’re welcome,
Codex10

1 Like

but, did i ask?

Uh no, you didn’t, I mainly made this post for @Electfalcon23 because if I posted it in his post asking for a 24/7 IDE, it would be necroposting and would get me forum banned.

YOOOOO YOUR A LIFE SAVER. THANKS SOO MUCH DUDE.

No problem, coders get each other’s backs when time calls :wink:
Sorry it took so long for me to find you a solution, though. I promise the next time you have an issue, it will be quicker.

1 Like

Nah man. I was already really happy you gave me a solution. it doesn’t matter how long it takes.

No problem. REPL will probably ban my account for hacking their stupid restrictions, but I don’t care. I only care that I helped out so many people.