Jamppufi

@jamppunet (0)
Hosting discord.js bots on repl.it!! [ Works for both discord.js and Eris ]
posted to Learn by TheDrone7

Ok @TheDrone7 ,
TBH I'm not running it temporarily, but I was doing a test for the keepAlive feature. I need to add some logic to the bot so I need to edit it and that's why I sent the question in the first place.

Thanks to you, that's sorted out now - so when I have my code ready I can set it on as permanent bot!

I started thinking... If I comment out the keep alive call from the main index, then it doesn't create the server at all - even thou the server is included into the project?

Hosting discord.js bots on repl.it!! [ Works for both discord.js and Eris ]
posted to Learn by TheDrone7

@TheDrone7 Oh damn ;) Well luckily I just commented the line totally out, so it doesn't listen to anything :D

Hosting discord.js bots on repl.it!! [ Works for both discord.js and Eris ]
posted to Learn by TheDrone7

@TheDrone7 I haven't changed the ports, it's been 3000 all the time. But there is probably some kind of bug, since it replicates the bot instance...

Hosting discord.js bots on repl.it!! [ Works for both discord.js and Eris ]
posted to Learn by TheDrone7

@TheDrone7 You're the man! This way I can develop the bot, even when it's running. It doubles everything up in Discord thou, but that's expected, since there are several instances running at the moment - one on repl.it browser, another one on the server and there is a mysterious third one - probably the server version on repl.it UI.

I'll just close the browser and leave some time for it and it will reset the extras. But thanks for the tips!

I think rest of you using this do the following when developing your bot:
1) pause uptimerobot monitor
2) comment out the server.listen line in the server.js by adding // in front of the line, like this
//server.listen(3000, ()=>{console.log("Server is Ready!")});

and you can still run your code. In Discord you will be getting several replies until the old server version that uptime robot was keeping up dies, but other than that, this is perfect!

When you are ready to go online and keep it up, just remove the // from the server.listen and run it + activate the uptimerobot

Hosting discord.js bots on repl.it!! [ Works for both discord.js and Eris ]
posted to Learn by TheDrone7

@TheDrone7 thanks mate! It seems like I can't run the code while the server is up, since the port is already in use :D

Error: listen EADDRINUSE: address already in use :::3000

But I'll just pause the robot and wait for a while - it's totally ok. This method Rocks - creating a bot in Repl.it makes finally some sense!

Hosting discord.js bots on repl.it!! [ Works for both discord.js and Eris ]
posted to Learn by TheDrone7

Great tutorial and it seems to be working too :D But what about changing the bot. Do I have control somewhere in repl.it to stop the server, so I could get my new version live?