Jump to content
stanhope

Arma server monitor discord bot

Recommended Posts

Posted (edited)

Arma server monitor discord bot

I recently made a discord bot that is able to monitor arma server to check if they go down.  Additionally it also allows user to check the amount of players on server etc.  There are other noteworthy features that are mentioned bellow.  In this post I'm providing the source code for this bot so you can host your own bot doing this.

 

Features

  • Support for an unlimited amount of arma and teamspeak servers
  • Pings admins if one of those servers goes down
  • The ability to turn those pings of for servers dynamically
  • Logging for the number of players on those servers (can be turned on or off for every individual server)
  • The ability to change how often the status of those servers should be checked
  • The ability for users with certain roles to launch certain queries to those servers
  • The ability for users with certain roles to execute admin level commands (change if a server will ping if it goes down, add/remove yourself from the list of users that will be pinged, ...)
  • The ability to alter the config without having to restart the bot
  • The ability to mute all down pings between 2 given hours (for scheduled restarts)
  • The bot is restricted to 1 channel
  • A timeout between pings for the same server being down
  • Uses discord embeds

 

Available commands

Spoiler

Available for most people:
   !servers: list of all servers
   !serverStatus: prints whether a given server is up or down
   !playerCount: prints the number of players on a given server
   !serverdetail / !serverdetails: prints the detail for one given server if a server is given or all servers if no server is given
   !players [server]: prints the players connected to the current server.  Requires a server
   !ping: replies pong
   !commands: / !help: this`;
Commands with limited availability:
   !changeNotifyStatus / !toggleNotify: toggles whether a notification will be send for the given server being down
   !reloadConfig: reloads the config file
   !toggleLogging: toggles whether logs should be kept for a server
   !subscribeForDownPing / !unsubscribeForDownPing: to subscribe/unsubscribe you from mentions when servers go down
   !saveconfig: to save the config (it's strongly advised to run this after running !subscribeForDownPing or!unsubscribeForDownPing)
   

 

Usage

This is simply source code, this is not a bot you can add to your server.  You need to create your own bot and host this code.  To create a bot I suggest googling 'how to create a discord bot', at the time of writing there are several very good tutorials available.  To host the code; download the source from the link provided bellow,  open the readme and read through it carefully, edit the config.json in the \src\config directory (there is a configExplenation.txt available in the same directory with some extra explanation on what each value is/does) and finally start the bot up using the commands provided in the readme.

 

Requirements

This bot requires node.js and a discord bot

 

License

This work is licensed under Apache License 2.0, full license included on the gitlab.

 

Download

You can find and download releases here or view download the source code here

 

Bugs

Please report bugs here or on the issue section of the above linked gitlab

 

Planned features

None at this time, feel free to make suggestions though (but I make no promises about putting them in, all I promise is that I'll try)

 

Updates

Spoiler

26/8/19

   -Added a players command
   -Added an option to specify where to save the logs

   -General code cleanup and improvements to make it a bit more sturdy

 

29/8/19

  -Added discord embeds

  -Fixed several bugs

  -Fixed debug messages that snuck past me have been removed

 

08/9/19

  -Added a line to the config example

  -Added a ping for when the server comes back up (can be configured for each individual server)

  -Fixed some bugs

 

09/9/19

  -Added the typing prompt when the bot is doing a command for all servers

  -Fixed anyone being able to save the config

  -Tried fixing an error some server admins were getting

 

11/9/19

  -Tweaked server back up ping (it now has 3 states, off/on/standard. Off to disable, On to always enable, standard to only enable when the previous down was not a scheduled one)

  -Tweaked message layout a bit

  -Updated documentation

 

14/9/19

  -Added !info command, displays some information about the bot (todo, finish documenting this)

  -Fixed Alphabetically sorted player list is now actually alphabetically sorted

  -Tweaked Layout of some messages

  -Tweaked All messages that do not have their own footer now come with a UTC timestamp as footer 

  -Code cleanup/optimization

 

14/9/19

Hotfix

  -Fixed servers not being recognized

  -Fixed !players command failing if there's too many people on server

 

Edited by stanhope
Updated bot
  • Like 3

Share this post


Link to post
Share on other sites

This is awesome.

 

Could you lis the commands able to use?

Share this post


Link to post
Share on other sites

As a feature, could you add server is up notification?

Share this post


Link to post
Share on other sites
3 hours ago, Capwell said:

This is awesome.

 

Could you lis the commands able to use?

You mean the !help and !commands commands that are in there already or in my original post?

3 hours ago, Capwell said:

As a feature, could you add server is up notification?

Like a notification when it detects that the server is up?  Or just the first time it detects it has gone up after it has gone down?

Share this post


Link to post
Share on other sites

I've pushed an update, changelog is in the original post and new version is available at the download link that is also in the original post. 

  • Like 1

Share this post


Link to post
Share on other sites
On 8/25/2019 at 10:36 PM, stanhope said:

Like a notification when it detects that the server is up?  Or just the first time it detects it has gone up after it has gone down?

First time it detects it has gone up after it has gone down

Share this post


Link to post
Share on other sites

I'll add that when I get a chance, probably not this week

  • Like 1

Share this post


Link to post
Share on other sites

Added the requested feature and fixed some bugs, full changelog and download link in the original post.

Share this post


Link to post
Share on other sites

Released 2 more versions since my last reply here, full changelog and download link in the original post.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×