new file: .gitignore

new file:   Dockerfile
	new file:   README.md
	new file:   app.py
	new file:   index.html
	new file:   projekte des/PROJECT_DESCRIPTION.txt
	new file:   projekte des/WEBSITE_DESCRIPTION.md
	new file:   projekte des/website_project_description_en.txt
	new file:   requirements.txt
	new file:   script.js
	new file:   static/css/styles.css
	new file:   static/js/script.js
	new file:   styles.css
	new file:   templates/about.html
	new file:   templates/base.html
	new file:   templates/contact.html
	new file:   templates/index.html
	new file:   templates/minecraft.html
	new file:   templates/project_detail.html
	new file:   templates/projects.html
This commit is contained in:
SimolZimol
2025-10-26 19:13:18 +01:00
commit 09b0b2f3b7
20 changed files with 4523 additions and 0 deletions

View File

@@ -0,0 +1,160 @@
# Hearts of Iron IV ELO Discord Bot
## Project Overview
A sophisticated Discord bot designed specifically for Hearts of Iron IV multiplayer communities, featuring a complete ELO rating system similar to chess rankings. This bot helps organize competitive matches, track player performance, and maintain fair gameplay through advanced statistical analysis.
## 🎮 Key Features
### ELO Rating System
- **Dual Rating Modes**: Separate ELO ratings for Standard and Competitive gameplay
- **Chess-like Algorithm**: Uses proven ELO formula with HOI4-specific modifications
- **T-Level System**: Country tier-based multipliers (T1: 0.8x, T2: 1.0x, T3: 1.2x points)
- **Draw Support**: Intelligent draw handling with ELO adjustments based on team strength differences
- **Starting Rating**: 800 ELO for all new players
### Game Management
- **Match Creation**: `/hoi4create` - Set up Standard or Competitive games
- **Player Setup**: `/hoi4setup` - Add players with team assignments and T-levels
- **Game Completion**: `/hoi4end` - Process results and calculate ELO changes automatically
- **Live Tracking**: Real-time game status and player management
### Statistics & Analytics
- **Player Profiles**: Comprehensive stats with ELO rankings and percentiles
- **Win/Draw/Loss Records**: Complete match history tracking
- **Leaderboards**: Ranked player lists with detailed performance metrics
- **Match History**: Searchable game archive with filtering options
### Advanced Features
- **Hybrid Commands**: All commands work as both slash (/) and text (!) commands
- **Permission System**: Owner-only administrative commands
- **Error Handling**: Robust error management with detailed logging
- **Database Integration**: MySQL support with automatic table creation
## 🛠 Technical Implementation
### Architecture
- **Framework**: Discord.py 2.3.2 with hybrid command system
- **Database**: MySQL with aiomysql for async operations
- **Deployment**: Docker containerization with Coolify support
- **Environment**: Python 3.10+ with comprehensive dependency management
### Database Schema
```sql
-- Players table with dual ELO ratings
players (discord_id, username, standard_elo, competitive_elo, timestamps)
-- Games with JSON player data and match metadata
games (game_name, game_type, status, players, winner_team, timestamps)
-- Detailed match results for statistical analysis
game_results (game_id, discord_id, team_info, elo_changes, result_type)
```
### ELO Calculation Algorithm
```python
# Standard ELO formula with HOI4 modifications
expected_score = 1 / (1 + 10^((opponent_avg - player_elo) / 400))
elo_change = K_FACTOR * (actual_score - expected_score) * t_level_multiplier
# Result scoring: Win=1.0, Draw=0.5, Loss=0.0
# K-Factor: 32 (standard competitive value)
```
## 🚀 Deployment & Infrastructure
### Docker Configuration
- **Base Image**: Python 3.10-slim for optimal performance
- **Dependencies**: Automated installation with requirements.txt
- **Environment Variables**: Secure configuration through Coolify
- **Health Checks**: Built-in monitoring and error reporting
### Coolify Integration
- **One-Click Deployment**: Seamless integration with Coolify platform
- **Environment Management**: Secure handling of tokens and database credentials
- **Scaling Support**: Ready for multi-server Discord communities
- **Backup Compatible**: Database-driven design supports easy backups
### Security Features
- **Owner Verification**: ID-based permission system (253922739709018114)
- **Input Validation**: Comprehensive parameter checking and sanitization
- **Error Isolation**: Graceful handling of edge cases and database issues
- **Rate Limiting**: Discord API compliance with proper request management
## 📊 Command Reference
### Core Commands
- `/hoi4create <type> <name>` - Create new match (standard/competitive)
- `/hoi4setup <game> <@user> <team> <t-level>` - Add player to match
- `/hoi4end <game> <winner/draw>` - Complete match and process ELO
- `/hoi4stats [@user]` - View detailed player statistics
- `/hoi4leaderboard [type] [limit]` - Display ranked player lists
- `/hoi4history [filters]` - Browse completed matches
- `/hoi4games` - Show active matches in setup phase
### Administrative
- `/reload` - Sync commands and restart bot functions (Owner only)
## 🎯 Use Cases
### Competitive Communities
Perfect for established HOI4 multiplayer groups wanting to:
- Track long-term player improvement and skill development
- Create balanced teams based on statistical performance
- Organize tournaments with proper seeding and brackets
- Maintain historical records of community achievements
### Casual Gaming Groups
Ideal for friends who want to:
- Add competitive elements to regular gaming sessions
- See progression over time with visual feedback
- Settle debates about who's actually the best player
- Encourage consistent participation through gamification
### Content Creators
Valuable for streamers and YouTubers to:
- Create engaging tournament-style content
- Provide viewers with statistical context during matches
- Build narrative around player rivalries and comebacks
- Generate data-driven content about community performance
## 🔮 Future Enhancement Possibilities
### Advanced Analytics
- **Performance Trends**: ELO progression graphs and trend analysis
- **Country Statistics**: Track performance by nation selection
- **Team Synergy**: Analyze optimal team compositions
- **Seasonal Resets**: Periodic ranking resets with historical preservation
### Integration Options
- **Web Dashboard**: Comprehensive statistics portal
- **Match Scheduling**: Calendar integration for planned games
- **Streaming Integration**: OBS overlays with live statistics
- **API Endpoints**: Third-party tool integration capabilities
### Community Features
- **Achievement System**: Unlock rewards for milestones
- **Clan Support**: Team-based rankings and competitions
- **Tournament Brackets**: Automated tournament management
- **Mentorship Matching**: Pair experienced players with newcomers
## 💡 Technical Highlights
This project demonstrates proficiency in:
- **Asynchronous Programming**: Efficient handling of concurrent Discord interactions
- **Database Design**: Normalized schema with performance optimization
- **API Integration**: Discord.py library mastery with modern best practices
- **DevOps Practices**: Containerization and deployment automation
- **Mathematical Algorithms**: Implementation of proven rating systems
- **User Experience**: Intuitive command design with comprehensive error handling
## 🏆 Project Impact
The HOI4 ELO Bot transforms casual gaming communities into structured competitive environments while maintaining the fun and social aspects that make multiplayer gaming enjoyable. By providing objective performance metrics and historical tracking, it helps players improve their skills and creates lasting engagement within gaming communities.
---
**Developer**: simolzimol
**Project Type**: Discord Bot / Community Management Tool
**Technology Stack**: Python, Discord.py, MySQL, Docker, Coolify
**Status**: Production Ready

View File

@@ -0,0 +1,76 @@
# Fly Plugin — Simple flight for survival servers
Author: simolzimol
Project page: https://www.spigotmc.org/resources/fly.83164/
---
## Overview
Fly is a lightweight, reliable Minecraft plugin that restores creative-like flying in survival mode. Its designed to be simple for players and server admins: toggle flight for yourself or others, and optionally adjust flight speed. The plugin focuses on minimalism, performance, and easy customization.
## Key Features
- Toggle flight for yourself: `/fly`
- Toggle flight for others: `/fly <player>`
- Adjustable flight speed: `/fly speed <1-10>` and `/fly <player> speed <1-10>`
- Fully configurable messages and prefix (color codes supported with `&`)
- Live configuration reload: `/flyreload` (no server restart required)
- Optional command and permission-denied logging for admins
- Small footprint and compatibility across many server versions
## Commands & Permissions
- `/fly` — Toggle your own flight. Permission: `fly.fly`
- `/fly <player>` — Toggle another player's flight. Permission: `other.fly`
- `/fly speed <1-10>` — Set your flight speed (1 = slow, 10 = fast). Permission: `fly.speed`
- `/fly <player> speed <1-10>` — Set another player's flight speed. Permissions: `other.fly` and `fly.speed`
- `/flyreload` — Reload plugin config. Permission: `fly.reload`
## Configuration & Customization
The plugin creates a `config.yml` on first run. Main options include:
- `settings.prefix` — message prefix (supports color codes)
- `settings.use_prefix` — enable/disable prefix
- `messages.*` — all messages for toggles, speed changes, errors, etc.
- `settings.log_commands` / `settings.log_permission_denied`
Placeholders supported in messages:
- `{player}` — target player name
- `{sender}` — command sender
- `{prefix}` — configured message prefix
Important upgrade note: when updating to a new major release, delete the old `config.yml` before restarting the server so new keys and defaults are applied cleanly.
## Compatibility
- Native support: Minecraft 1.15
- Tested on: 1.15 — 1.21
- Server types: Spigot, Paper, Bukkit
## Installation
1. Download the latest JAR.
2. Put the JAR into your server `plugins/` folder.
3. Start the server so the plugin can generate `config.yml`.
4. Edit `config.yml` to customize messages and settings.
5. Use `/flyreload` to apply config changes without restarting.
## Use Cases
- Give VIPs temporary flight privileges
- Enable staff to fly for moderation and world-building
- Add creative-like movement to private plots and minigames
## Support & Contact
If you need help or want to request features, contact me on Discord: `simolzimol` or via the Spigot resource page. I welcome bug reports, suggestions, and pull requests.
## License & Source
Include whichever license you prefer (MIT recommended for simple plugins). Link to the project page and, if you publish the source, a GitHub repository.
---
If you want, I can also produce a short set of screenshots and a short changelog section you can paste on the site, or a ready-made HTML snippet for your webpage.

View File

@@ -0,0 +1,95 @@
SimolZimol Discord AI Bot — Moderation, Giveaways, and Web Dashboard
Overview
A production-ready Discord bot built by SimolZimol that combines advanced moderation, a persistent giveaway engine with Steam/Epic game integration, AI-powered utilities, and a lightweight Flask-based admin dashboard. The project focuses on reliability, data persistence, and a great user experience for community servers.
Highlights
- Advanced Moderation System: Warnings, temporary mutes with automatic unmute, role restoration, detailed logs, and user-friendly commands with numeric and UUID identifiers.
- Persistent Giveaways: Robust giveaway engine with UUID-based IDs, sponsor attribution, Steam URL parsing (auto title/image), message auto-updates on edits, and restart-safe state via MySQL.
- Web Dashboard: Flask templates for server admin and user views (leaderboard, user data, settings, logs) to complement Discord commands.
- Reliability & Recovery: Active processes are tracked in the database and restored on startup so running giveaways are never lost.
- Clean UX: Rich embeds, buttons for joining giveaways, clear admin feedback, and helpful list/view commands for transparency.
Key Features
1) Moderation & Safety
- Warn and mute users with clear audit trails
- Temporary mutes stored in user_mutes table; auto-unmute + role restoration
- View/list mutes with status filters (active, completed, expired, cancelled)
- Mod log channel integration and smart notifications
2) Giveaways (Steam/Epic Ready)
- Start giveaways with title, subtitle, prize, duration, platform, sponsor, and optional game URL
- Steam integration via aiohttp: automatic game info extraction (title, image, short description)
- Sponsor handling: mention parsing to display a clean sponsor name in the embed footer
- UUID-based giveaway IDs for reliability across restarts and edits
- Edit giveaways after launch; the original Discord post updates automatically
- List giveaways from memory and database; load any giveaway back into memory on demand
- Full restart safety: active giveaways are restored when the bot starts
3) Web & Admin Experience
- Flask-powered pages (templates folder) for landing, dashboards, settings, users, logs, giveaways
- Complements Discord-first management with a browsable UI for staff and users
4) Observability & Logs
- Structured log files per day to simplify troubleshooting
- Clear status messages for admins after every critical action (create, edit, load)
Architecture at a Glance
- Language: Python
- Frameworks/Libraries: discord.py, Flask, aiohttp, aiomysql, regex, requests
- Data: MySQL (connection pooling) with tables for user data, mutes, and active processes
- Process Orchestration: A process manager persists and restores active tasks (e.g., running giveaways)
- Caching: In-memory maps for hot data with DB as the source of truth
- Background Workers: Queues for AI tasks and live chat processing
How Giveaways Work
1) Creation: Admin triggers a hybrid command; the bot builds a rich embed with join button and (optional) Steam info.
2) Persistence: A process entry is created in MySQL (active_processes) with all metadata and end time.
3) Participation: Users join via button; participants are tracked and persisted.
4) Editing: Admins can modify title/subtitle/prize/sponsor/duration; embeds update automatically.
5) Resilience: If the bot restarts, giveaways are restored from the database (including message IDs) and continue.
6) Completion: Winners are selected and recorded; sponsors and results can be announced.
Notable Technical Decisions
- UUIDs as Giveaway IDs: Avoids collisions and survives restarts; matches process UUIDs in the DB.
- Dual-Source Listing: listgiveaways reads both live memory and DB to present the complete picture.
- Message Update Pipeline: Each giveaway stores its message ID so edits can refresh the original post.
- Sponsor Mentions: Clean display names in embeds even when the raw input is a mention or handle.
Security & Permissions
- Local permission levels (5+ for moderators, higher for admins/owner)
- Command gating for sensitive operations (edit, load, list, config)
- Read-only fallbacks where appropriate to avoid destructive actions
What You Can Do With It
- Run a professional-grade community bot with moderation and giveaway tools
- Host sponsor-backed game key drops integrated with Steam/Epic pages
- Offer a friendly web dashboard for staff and users alongside Discord commands
Getting Started (Local)
- Requirements are listed in requirements.txt (Python 3.10+ recommended)
- Create a virtual environment and install dependencies
- Provide your Discord and database credentials via environment variables or config
- Start the bot (bot.py) and optional Flask app (app.py)
Production Notes
- Use a managed MySQL instance and set up proper connection pooling
- Run the bot in a process manager (e.g., systemd, pm2, or Docker as provided)
- Configure regular backups for the database (active processes, user_mutes, user_data)
- Rotate logs and monitor for rate limits or permission issues
Status & Roadmap
- Completed: Persistent mutes, restart-safe giveaways, Steam integration, sponsor support, message auto-updates, admin listing/editing
- In Progress: Quality-of-life improvements across dashboard and command UX
- Future Ideas: Analytics, multi-language embeds, role-locked giveaways, prize claim portals
About the Author
Built by SimolZimol — I design and operate community-first tooling with a focus on reliability, clear UX, and practical automation.
Contact & Links
- Email/Discord: (your preferred contact)
- Live Demo: (link if hosted)
- Source Code: (GitHub/website link)
Short Blurb (Copy-Paste)
A production-ready Discord bot by SimolZimol featuring advanced moderation, a restart-safe giveaway engine with Steam integration, and a companion Flask dashboard — built for reliability, clarity, and great community UX.