ECO server discord status bot


  • Dev Tier

    deprecated

    new version => https://discordbots.org/bot/496764374338240514

    Hey,

    I'm currently starting to create a small bot which allows requesting the servers status on discord. There is already a pre-release-version - feel free to test it. Every exception is collected and will be fixed later. But while I was testing everything seems to work fine already. :D

    Supported commands:
    requires the permission to edit the discord server settings:

    !addserver           - !addserver <name> <ip>:<webport>            - adds a server to the serverlist
    !delserver           - !delserver <name>                           - deletes a server from the serverlist
    !setformat           - !setformat {server_name}                    - variables / examples below
    !subscribemonitoring                                               - subscribe for status change-reports (online / offline)
    !unsubscribemonitoring                                             - stop reprting status changes (online / offline) 
    !setmonitoringformat - !setmonitoringformat offline {ip} offline   - defines the monitoring format
    !setname             - !setname somename                           - sets the discord clients name
    

    no permission check:

    !serverlist   - !serverlist                          - lists all servers added
    !status       - !status [name]                       - if no name provided the server named "main" will be used
    

    Formatting examples / variables for !status !serverlist and monitoring (if online):

        {server_tag}           => tag of the server
        {server_name}          => Server name
        {map_size}             => Map size
        {player_count}         => Current player count
        {max_players}          => Max players / player profiles available on the server
        {version}              => Eco version
        {animals}              => Animal count
        {plants}               => Plant count
        {provider}             => Hosting provider (company owning IP)
        {country}              => Country (location of IP)
        {address}              => IP + Port
        {ip}                   => IP
        {port}                 => Port
        {gametime}             => time since the server is running (ingame)
        {break}                => Line break
    

    Usage example:
    !setformat Server online! Servername: {server_name}{break}Players online: {player_count}

    Print everyting:
    !setformat server_name: {server_name}{break}map_size: {map_size}{break}player_count: {player_count}{break}max_players: {max_players}{break}version: {version}{break}animals: {animals}{break}plants: {plants}{break}provider: {provider}{break}country: {country}{break}address: {address}{break}gametime: {gametime}

    Formatting examples / variables for monitoring:

        {server_tag}          => tag of the server
        {ip}                  => IP of the server
        {port}                => Port of the server
    

    Examples:
    !setmonitoringformat online {server_tag} with the ip {ip} is unavailable!
    !setmonitoringformat online {server_tag} is up and running on version {version}! current gametime: {gametime}

    Todo:
    add further features

    • automatically announce when the server goes offline/online
    • custom status formatting
    • chat mirror (post ingame chat messages in discord)
    • ...
    • validation (especially for addserver command)
    • allow using domains while adding server
    • code cleanup

    You can use the following URL for adding this bot to your discord server:
    https://discordapp.com/oauth2/authorize?client_id=422848824525193216&permissions=2048&scope=bot

    Feel free to contact me on discord if you have any difficulties: msniveau#0719
    Feel free to contribute: https://github.com/msniveau/eco-status-bot



  • Tried to use your BOT, it shows the server as OFFLINE although its up and running. Tried to use both ports - game port and webport.



  • This post is deleted!

  • Dev Tier

    I've fixed the config of the instances currently added - please note:
    addserver command should be formatted like this:
    !addserver <name> <ip>:<port>
    example:
    !addserver main 123.123.213.123:1234

    Another case caused this difficulty was something at my query backend - fixed

    Thanks a lot for your feedback :)



  • Nothing changed, still shows as offline.


  • Dev Tier

    You may let me know which IP you've added to the server or the discords server id so that I'm able to check the difficulty more detailed.
    Please also make sure that you used the webport (not the gameport).

    If you are using the correct port you can verify while using the following service:
    http://query.li/api/eco/123.213.123.123/1234



  • https://discord.gg/JAJgTmJ

    173.249.31.159:3000


  • Dev Tier

    I can't reproduce that. I've used the bot to print the current server status on your discord, that seems to work fine:
    1_1520249087.png

    Edit: nevermind, seen your message now :D Its solved :) Thanks for the feedback


  • Dev Tier

    using domains while adding the server is supported now
    example:
    !addserver main google.com:1337



  • Works awesome thank you.



  • Heya, worked flawlessly, really cool!
    Nitpicky suggestion: Could you maybe enable customizing the formatting of the status message, or at least making line breaks and using bold titles to show the different titles of info? :D
    Thank you!


  • Dev Tier

    Hi Gabeux,

    implemented this feature for you now, updated the main thread.

    Following templating variables are available:

        {server_name}          => Server name
        {map_size}             => Map size
        {player_count}         => Current player count
        {max_players}          => Max players / player profiles available on the server
        {version}              => Eco version
        {animals}              => Animal count
        {plants}               => Plant count
        {provider}             => Hosting provider (company owning IP)
        {country}              => Country (location of IP)
        {address}              => IP + Port
        {gametime}             => time since the server is running (ingame)
        {break}                => Line break
    

    Usage example:
    !setformat Server online! Servername: {server_name}{break}Players online: {player_count}



  • Ohh lovely! Thank you kind sir!! :D



  • This post is deleted!


  • Hi,
    do you have any idea when you try the automatic off/online messages?


  • Dev Tier

    Give me a second, I'll have a look :D



  • I dont know if that works but is that scenario possible:
    Bot automaticly checks server status every X min.
    Then it compares with the current server status with the status in the variable "status" (needs to be declared). If the current status is not the status stored in the variable -> Post status in Discord & set the new status in the variable "status" and that in a loop ?


  • Dev Tier

    Okay, it took a while due to different things I was forced to do before starting working on the eco bot :D
    But now its implemented, just go to the channel you want to receive the messages to and type:
    !subscribemonitoring

    To unsubscribe just type !unsubscribemonitoring



  • @msniveau said:

    !subscribemonitoring

    Hi,
    thx that you did the code.
    One question: which is the interval the bot checks the server status?



  • Just another little thing :=) misspelling of "status"
    image.png