Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

ihasTaco/ServerQuery-Deprecated

Repository files navigation

ServerQuery

ServerQuery is a Discord.py bot designed to query game servers that use A2S (Valve Query API), FiveM, Minecraft, and SAMP. This bot provides server and player information, making it an excellent tool for discord server owners who hosts dedicated servers who wants to display server and player information in a fully customizable but beautifully designed way!

Quick Links:
Requirement
Setup
Known Bugs
Coming Soon
Supported Games
License

What's New

  • Stability - this was an issue from my [last bot], and from the start, I aimed to make it as stable as possible
  • JSON Support - I wanted to use something that was easy to setup straight from the beginning, so all server info & customization is stored in a JSON file for easy access
  • Easy Module Installation - The script will take care of most of the installation!
  • You can now add/edit/delete servers right inside the script!
  • Server Specific Customization - again an issue that I saw with my [last bot] was that it lacked specific server customization, so this was an issue that I was looking to fix in this bot!
  • More Customization - now you can finally customize everything in the embed!
    • Change Color of the Embed
    • Set Thumbnail URL
    • Set Footer Text and URL
    • Title
      1. Use Config Name
      2. Use Server Name
      3. Use Custom Name
    • Description
      1. Disable
      2. Show Steam Quick Connect Link
      3. Use Custom Description
    • Fields
      • Enable/Disable every field and reorder them
    • Players
      • Enable/Disable Player Names
    • Graph
      • Enable/Disable Player Graph
      • Title
        • Use a Custom Title for the graph
        • Change Color of the title
      • Labels & Tick Marks
        • Use custom Labels for X & Y axis
        • Change the colors of the Labels
        • Change the color of the Tick Marks
      • Graph Lines
        • Player Count
          • Change Color of Online Player Line
          • Enable/Disable Online Player Fill
          • Change the color of the Online Player Fill
        • Trend Line
          • Enable/Disable Player Trend Line
          • Change the color of the Player Trend Line
      • Grid
        • Enable/Disable Grid Lines
        • Change Color of the Grid Lines
        • Set Opacity of the Grid Lines
      • Legend
        • Enable/Disable the Legend
        • Change Color of the Legend Background and the Legend border
        • Set Opacity of the Legend And this can be customized for every server
  • Logging System
  • Notifications for Server Status Change

Requirements

ServerQuery requires the following Python libraries to function correctly:

  • python-a2s
  • mcstatus
  • requests
  • fivempy
  • samp_client
  • discord
  • fuzzywuzzy - For the check_api search function
  • matplotlib

The script will install any missing and necessary libraries automatically.

Setup

Before you can use ServerQuery, make sure you have Python and pip installed on your machine. You can download Python from the official website and install it on your computer.

Once installed, you can check if pip is installed with the following command:
python -m ensurepip --upgrade

Next, clone the repository:
git clone https://github.com/ihasTaco/ServerQuery/

Don't Forget to set the Graph Image Dump Guild/Channel ID's and Status Change Notification Guild/Channel ID's as well as add your bot token! After that, you can run the bot by executing the following command:
Note: there is no need to install the requirements as they will be installed on first run of the script below! python module_checker.py

Don't Forget the bot requires these permissions in the server channels to work correctly:

  • View Channel
  • Send Messages
  • Embed Links
  • Read Message History

Known Bugs

  • found an issue when trying to run this bot in a virtual environment, it wont install the modules properly.
  • Currently there aren't any known bugs in ServerQuery, if you find one please submit an issue!

Coming Soon

  • Password Field
  • Ability to import/export server customization configs - for faster server customization
  • MariaDB/MySQL Database support - at this time the script is running off of a JSON file for all server information and customization, but I will be adding db support soon
  • Dashboard - I want to make a django dashboard that will allow you to go to your localhost address (127.0.0.1:8000) and be able to customize and manage servers from there
  • Add settings for notifications for each server, including ability to Enable/Disable, set guild/channel id, and set title

And here is some query api's and games support that I will want to add eventually

  • ASE
  • GameSpy 1, 2, & 3
  • Doom 3
  • Nadeo
  • Quake 2, & 3
  • Unreal 2
  • RageMP
  • Terrarria
  • Roblox
  • Teamspeak

Supported Games

Here is the list of games that SHOULD be supported.
I added a Tested section, if that has an ❌, there is a slim chance that it may not be able to be queried or server/player info may not work! (but it should work fine)

But, if you test out a server that hasnt been tested yet, please submit a pull request and I will update the list!
Same thing for games that aren't on the list If you do decide to test a server, and it doesn't work as expected please submit an issue, and I will look into the issue!

If you find a game that isn't on the list, please let me know!

Game App ID API Tested Server Info Player Info
7 Days to Die 251570 A2S
Age of Chivalry 17510 A2S
Alien Swarm 630 A2S
America's Army 3 13140 A2S
America's Army: Proving Grounds 203290 A2S
ARK: Survival Evolved 346110 A2S
Armed Assualt 2: Operation Arrowhead 33930 A2S
Armed Assault 2: DayZ Mod 224580 A2S
Armed Assualt 3 107410 A2S
Battalion Legacy 489940 A2S
Brink 22350 A2S
Call of Duty: Modern Warfare 3 115300 A2S
Conan Exiles 440900 A2S
Counter-Strike 1.5 -- A2S
Counter Strike 1.6 -- A2S
Counter-Strike 2D 666220 A2S
Counter-Strike: Condition Zero 80 A2S
Counter-Strike: Global Offensive 730 A2S
Counter-Strike: Source 240 A2S
Dark and Light 529180 A2S
DayZ Standalone 221100 A2S
Day of Defeat 30 A2S
Day of Defeat: Source 300 A2S
Days of War 454350 A2S
Empyrion - Galactic Survival 383120 A2S
Fortress Forever 253530 A2S
Garry's Mod 4000 A2S
GRAV Online 332500 A2S
Grand Theft Auto San Andreas (SAMP) 12120 SAMP_Client
Grand Theft Auto V (FiveM) 271590 FiveMPy
Half-Life: Deathmatch 360 A2S
Half-Life 2: Deathmatch 320 A2S
Half Life 2: Synergy Mod 17520 A2S
Homefront 55100 A2S
Insurgency 222880 A2S
Just Cause 2 Multiplayer 259080 A2S
Killing Floor 2 232090 A2S
Left 4 Dead 500 A2S
Left 4 Dead 2 550 A2S
Minecraft (Java) -- MCStatus
Minecraft (Bedrock) -- MCStatus
Natural Selection 120 A2S
Natural Selection 2 4920 A2S
PixARK 593600 A2S
Quake Live 282440 A2S
Red Dead Redemption 2 (RedM) 1174180 FiveMPy
Red Orchestra 2: Heroes of Stalingrad 43350 A2S
Rising Storm 234510 A2S
Rust 252490 A2S
Shattered Horizon 18110 A2S
Starbound 211820 A2S
Space Engineers 244850 A2S
Squad 393380 A2S
Team Fortress Classic 20 A2S
Team Fortress 2 440 A2S
The Forest 242760 A2S
The Ship 383790 A2S
Unturned 304930 A2S
Wurm Unlimited 366220 A2S
Zombie Master 90047 A2S
Zombie Panic: Source 17500 A2S

License

ServerQuery is released under the MPL 2.0 license