Skip to content
← Back to Community
Won't host
Profile icon
ItsEditsss

So, I have 3 bots and it is suppose to be hosted for 24/7 without going on it and I did everything properly, All of a sudden it won't stay on for 24/7 and I have to click run and stay on the page. Please someone help me

Voters
Profile icon
ItsEditsss
Comments
hotnewtop
Profile icon
Coder100

Hello, try this. But basically the problem is probably your repl ran out of memory.

Profile icon
CodeLongAndPros

@Coder100 OOM killer or storage?

Profile icon
Coder100

probably the killer @CodeLongAndPros

Profile icon
CodeLongAndPros

@Coder100 echo 'f' > /proc/sysrq-trigger

Profile icon
ItsEditsss

@Coder100 Still goes down

Profile icon
Coder100

hmmm strange @VDiscordbot

Profile icon
ItsEditsss

@Coder100 Yeah, It is, Now it says error in my code when everything is fine

Profile icon
ItsEditsss

@Coder100 Could you fix it?, It used to work though

Profile icon
Coder100

hmm, can you send a screenshot of all your files? @VDiscordbot

Profile icon
ItsEditsss
Profile icon
ItsEditsss

@Coder100
Annotation 2020-06-20 183601

Profile icon
Coder100

hello, as you can see there is no .env file. @VDiscordbot

Profile icon
ItsEditsss

@Coder100 I could fix that but I have a .env file in my Other bot and it works but then stops running

Profile icon
ItsEditsss

@Coder100 I added the .env file but now it won't still run

Profile icon
Coder100

hmmm... what is inside the .env? @VDiscordbot

Profile icon
ItsEditsss

@Coder100 My discord token

Profile icon
Coder100

so it's like in the format

DISCORD_BOT_TOKEN=[whatever]

right?
@VDiscordbot

Profile icon
ItsEditsss
Profile icon
Coder100

alright, everything appears to be working, however there is another method we can do before we contact repl.it. Create a .replit file in the root directory and inside, put

run = "npm install ; node ."

@VDiscordbot

Profile icon
ItsEditsss
Profile icon
Coder100

OH WAIT I FOUND YOUR ERROR!!!

You are missing a script creating an HTTP server! Here's the solution for you:

  1. Insert this code anywhere (usually at the top)
require("http").createServer((_, r) => r.end("ALIVE")).listen(8080)

Enjoy!

@VDiscordbot

Profile icon
ItsEditsss

@Coder100 Where do I put it?

Profile icon
ItsEditsss

@Coder100 Do I replace anything?