This repository contains multiple Discord bots designed for various automation tasks, including GitHub monitoring, CI/CD notifications, and interactive features.
/discord_automation
β-- /github_monitor_bot # GitHub monitoring bot (tracks commits, stars, PRs)
β β-- bot.py # Main bot script
β β-- requirements.txt # Dependencies for this bot
β β-- .env # Environment variables (ignored in Git)
β β-- bot_data.json # Persistent data storage
β β-- README.md # Bot-specific documentation
β
β-- /ci_alert_bot # CI/CD monitoring bot
β β-- bot.py # Tracks CI/CD build status
β β-- requirements.txt
β β-- .env
β β-- README.md
β
β-- /fun_game_bot # A daily game bot for the Discord server
β β-- bot.py
β β-- requirements.txt
β β-- .env
β β-- README.md
β
β-- /shared # Shared utilities (if needed)
β β-- utils.py # Helper functions used by multiple bots
β
β-- /scripts # Maintenance scripts (optional)
β β-- restart_bots.sh # Script to restart all bots
β
β-- README.md # General documentation for all bots
β-- .gitignore # Ignore sensitive files
git clone https://github.com/your-org/discord_automation.git
cd discord_automationEach bot lives in its own directory. Navigate to the bot you want to set up:
cd github_monitor_botCreate a virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtEach bot requires a .env file for credentials. Example .env:
DISCORD_BOT_TOKEN=your-bot-token
DISCORD_GITHUB_CHANNEL_ID=your-channel-id
GITHUB_API_TOKEN=your-github-token
GITHUB_ORG=your-organization-name
π¨ Never commit .env files! This repository includes a .gitignore rule to prevent that.
Each bot runs independently. Start a bot manually with:
cd github_monitor_bot
source venv/bin/activate
python bot.pyFor automatic startup on reboot, use systemd services:
sudo systemctl start github_monitor_botTo enable startup on boot:
sudo systemctl enable github_monitor_botTo check the bot's status:
sudo systemctl status github_monitor_botYou can automate bot management with a script. Example restart_bots.sh:
#!/bin/bash
source /home/discordbot/discord_automation/github_monitor_bot/venv/bin/activate
python /home/discordbot/discord_automation/github_monitor_bot/bot.py &
source /home/discordbot/discord_automation/ci_alert_bot/venv/bin/activate
python /home/discordbot/discord_automation/ci_alert_bot/bot.py &Make it executable:
chmod +x restart_bots.shRun with:
./restart_bots.sh- Add more bots for different functionalities.
- Implement logging and error handling.
- Use a single
.envmanagement system for all bots.
π οΈ Contributions welcome! Fork and improve the bots!
π Neumann's Workshop - Making Automation Smarter!