Currently viewing this thread:

Jordan_The_Noble

Sergeant
M&BWBWF&SNWVC
Best answers
0

Hello Everyone!

For the past week I've been working on my first Javascript project; A Discord bot that fetches the current/max player count and displays them on a Discord server, updating regularly. I feel that it is now in a state that I can share it with you all. I will update it over time, but you can change it however you want. It is very primitive and only has one feature at the moment that sets the bots presence status as shown here:


Eventually, you can also expect it to edit a channel with the current player stats, and display the stats in an embed (without uptime, as is Oasis Hosting specific). I just need to rewrite these parts as they work but aren't production grade just yet.



If you're new to Discord bots please follow this tutorial from steps 2 to 4 and set the token in the bot files. You then need to look into Node.js to understand the basics and how and where to host the bot, i.e. a Linux server. Will work fine on either though, as long as you have the dependencies for Node.js installed. Be sure to read the setup.md file as it has important instructions to get the bot working such as setting up environment variables (env).

Any questions or suggestions please do let me know! My Discord details are on the GitHub repo so you can contact me on there if you need anything, or just reply to this thread.

Thanks,
Jordan.
 

Jordan_The_Noble

Sergeant
M&BWBWF&SNWVC
Best answers
0
  • Version 1.0.1
    • Added missing modules because of repl.it commit not including them.

  • If the gameserver goes offline the bot 'playing status' will cease to update. I'm working on adding an error handler that can deal with bad requests that will assume the server is offline. About 70% done. Quick fix is to adjust the refresh timer to 60 seconds so that when a gameserver is restarted it has more time to get up and running. If this doesn't fix it, restart the bot and it will.
 
Last edited:

Jordan_The_Noble

Sergeant
M&BWBWF&SNWVC
Best answers
0
Thanks! I'm not looking for this to compete with the Bladecast bot but more give something to the community that they can change to their needs. Over time, I intend to add more features, but Bladecast bot is definitely the most refined from what I can see. This is my first node.js/js project so it will probably change significantly.
 

Emil

Squire
M&BWBWF&SNWVC
Best answers
0
API down? It broke for us over at the NRP discord but the script seems to still be properly running.