A Python-based utility that monitors your network ping in real-time and sends alerts to Discord when latency exceeds a specified threshold.
Made this out of boredom from high ping, which made me rage in competitive games.
Total time spent on this project:
- Real-time ping monitoring to a specified host (default: google.com)
- Discord notifications when ping exceeds the threshold
- Custom status on your Discord bot showing your current ping condition
- Configurable thresholds to match your needs
- Robust error handling to prevent crashes
- User-friendly setup and startup scripts with batch files
- Python 3.11+ (recommended)
- Discord bot token and permissions
- Internet connection
-
Download LATEST RELEASE zip (always called after the version)
- Unzip it into your desired directory
-
Install dependencies:
- Open the
ping-monitor-x-discord
folder - Simply double-click
setup.bat
- Open the
Run the script with:
- Double-click
start.bat
- If this is your first time running it, a
.env_vars
file will be created. Open it with a text editor and specifyDISCORD_TOKEN
,CHANNEL_ID
, andUSER_NAME
(optional).
- If this is your first time running it, a
Edit the following variables in .env_vars to customize your experience:
DISCORD_TOKEN=xxx.yyy.zzz # Replace with bot token
CHANNEL_ID=1234567890 # Replace with channel ID
USER_NAME=@xxxxxx # Replace with your username (optional)
HOST_TO_PING=google.com # The host to monitor
PING_INTERVAL=5 # Check interval in seconds
PING_THRESHOLD=120 # Alert threshold in milliseconds (ms)
The program will:
- Connect to Discord using your bot token
- Start monitoring ping to the specified host
- Send notifications when ping exceeds your threshold
- Update the bot's status to reflect current ping conditions
- The script uses
ping3
library to measure network latency to a target host - When latency exceeds the threshold, a Discord webhook is triggered
- A rich embed is sent to your specified Discord channel with ping information
- The Discord bot status is updated to reflect the current situation
- When ping returns to normal levels, the status is updated accordingly
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Feel free to open issues or submit pull requests.
- ping3 for the ping implementation
- discord.py for the Discord API wrapper
Planned features and improvements for upcoming releases:
- More user friendly setup and startup
- Bot mentions discord user in high ping alert message
- Docker container support
- Cross-platform compatibility (Linux, Windows)
Got an idea or feature request? Feel free to open an issue
Made with ❤️ by Kexe while waiting for better ping.