Monitor the player count and current map of your Counter-Strike GO/2 server and display this information as your Discord application's status. This project is written in Python, utilizing the discord.py and python-a2s libraries. Feel free to modify the code to suit your specific requirements.
- Python >=
3.13.5 - discord.py >=
2.5.2 - python-a2s >=
1.4.1
- Pythonic code style
- Code linted with Ruff (a Rust-powered VS Code extension)
- No useless memory allocations
- Minimal terminal output
- Rotating logging handler for exceptions
- Consistent logging template for Discord client runtime
- Graceful exits with status code
1for critical failures
To configure general settings of the application:
TOKEN = ""- Replace the string value with your Discord application tokenSERVER_IPv4 = "0.0.0.0"- Replace the string value with the server's IPv4 addressSERVER_PORT = 27015- Replace the numeric value with the server's port
OFFLINE_STATUS = "Server unreachable"- Application status when the server is unreachableUPDATE_INTERVAL_SECONDS = 60- Application updates frequency for status in seconds
Caution
- Ensure the UPDATE_INTERVAL_SECONDS value is set to
60or greater. - In case of application startup issues, a code refactoring may be necessary.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Star this project if it helped you.
MIT.