Skip to content

GameStatsBot is an open-source project that includes the code for a Discord bot designed to add Source and GoldSource servers to a MongoDB database and provide statistics for those servers. The bot is programmed in Python, utilizing the Discord API and dependencies for database integration.

License

Notifications You must be signed in to change notification settings

Fraaq/GameStatsBot

Repository files navigation

GameStatsBot

GameStatsBot is an open-source project that includes the code for a Discord bot designed to add Source and GoldSource servers to a MongoDB database and provide statistics for those servers. The bot is programmed in Python, utilizing the Discord API and dependencies for database integration.

📋Table of contents

⭐Features

  • Easy to customize
  • MongoDB database
  • Multiple servers support
  • Send server's name, ip, map, map thumbnail, player count
  • Send all players and their names, scores and playtime
  • Send stored information about server

📌How to use it

  1. Install python
  2. Install and setup Mongodb or use MongoDB Atlas
  3. Download and unzip this repository
  4. Install required modules
    pip install -r requirements.txt
  5. Create file .env and put there your discord token and mongodb login details
    If you are using mongodb atlas:
    MONGODB_STRING='Your-Monhodb-Connection-String'
    If you are using normal mongodb
MONGODB_IP_AND_PORT='MongodbIpAndPort'
MONGODB_PASSWORD='MongodbPassword'

The final .env file should looks like something like this:

DISCORD_TOKEN='YourDiscordToken'
MONGODB_IP_AND_PORT='MongodbIpAndPort'
MONGODB_PASSWORD='MongodbPassword'
  1. Run bot.py

🔧Players list fix for CS2

  1. Install AuthSessionFix on your CS2 server
  2. Install ServerListPlayersFix on your CS2 server

💎Commands

!add_server (Add game server to the database) | Required role to use this command is games server manager
!del_server (Delete server from the database) | Required role to use this command is games server manager
!servers (List of all servers from the database)
!info (Stored information about the server from the database)
!players (All players of the server with their names, scores and playtime)
!stats (Stats of the server like game, name, description, map, player count, map thumbnail)

🛠️How to customize the bot

  • Add thumbnails

  • Add thumbnails for more games

    • You need to create new folder in map-thumbnails/ and the folder should have name exactly same as your game name without this characters \, /, :, *, ?, ", <, >, |
      If you don't know exactly the game name you can write !stats and the name is in field game.
    • For example if my game is CS2 I will write !stats and there is this name: Counter-Strike 2 I will remove the special characters so my game folder inside map-thumbnails/ should look like this map-thumbnails/Counter-Strike 2
  • Help messages

  • Discord role for managing servers

🖼️Screenshots

Help command

Add server and servers command

Stats command

Players command

Info command

About

GameStatsBot is an open-source project that includes the code for a Discord bot designed to add Source and GoldSource servers to a MongoDB database and provide statistics for those servers. The bot is programmed in Python, utilizing the Discord API and dependencies for database integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages