838198648ef364bd5369c7b2f81b591b1c8ccdd4
- Add RotatingFileHandler for log rotation (fixes #21) - Add MetricsCollector for command/error tracking (fixes #20) - Add discord.py cooldown decorator on /ask (fixes #19) - Add ConfigValidator for startup config checks (fixes #17) - Add /status health check command for admins (fixes #16) - Add autocomplete for /minecraft usernames (fixes #15) - Add AuditLogger with batched queue + periodic flush (fixes #14) - Add MediaManager with lazy-load cache (fixes #13) - Add UsernameCache with TTL for Mojang API (fixes #12) - Extract magic numbers to named constants (fixes #11) - DRY kill/punch/hug/revive into send_interaction_media (fixes #10) - Add handle_command_errors decorator for consistent error handling (fixes #9) - Add sanitize_input() for /ask question input (fixes #8) - Move Ollama URL to OLLAMA_URL env var (fixes #7) - Only log commands, not all message content (fixes #6) - Wrap RCON in async executor with timeout (fixes #5) - Reuse shared aiohttp.ClientSession on CustomBot (fixes #4) - Validate RCON/Pelican/Ollama config on startup (fixes #3) - Replace ask_cooldowns dict with CooldownManager + auto-cleanup (fixes #2) Note: #18 (MariaDB) deferred - requires database infrastructure setup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Lotus Discord Bot
Discord bot for the Lotus Guild server with auto-deployment from Gitea.
Features
- Daily adjective posting
- Minecraft server whitelist management
- Custom LLM integration (Lotus LLM)
- Fun commands (8ball, fortune, dice, etc.)
- Game-specific commands (Valorant agents, LoL champions)
- Server audit logging
- Reaction roles
Auto-Deployment Setup
The bot automatically deploys when code is pushed to Gitea.
Deployment Components
- Webhook Listener: Runs on port 9000 on the production server
- Deployment Script:
/usr/local/bin/discord_bot_deploy.sh - Service:
discord.serviceruns the bot
Webhook Configuration
- Endpoint:
http://10.10.10.6:9000/hooks/discord-bot-deploy - Secret:
discord-bot-secret - Header:
X-Gitea-Signature
Manual Deployment
If needed, you can manually trigger deployment:
ssh root@10.10.10.6
/usr/local/bin/discord_bot_deploy.sh
Production Server
- Host: 10.10.10.6
- Bot Directory:
/mnt/discordBot/ - Service:
discord.service - User: jared
Local Development
The bot requires:
- Python 3
- discord.py
- python-dotenv
- aiohttp
- mcrcon
Environment variables in .env:
DISCORD_TOKEN
Commands
Run /help in Discord to see all available commands.
Description
Languages
Python
97.5%
Shell
2.5%