A powerful, feature-rich Discord bot built with discord.py โ moderation, levels, giveaways, minigames, AI integration, and much more.
Documentation: docs.tanjun.bot
Support Server: Discord
Status Page: status.tanjun.bot
- Ban, kick, timeout, warn with configurable warnings
- Purge messages, nuke channels, slowmode management
- Role management (add, remove, create, delete, copy, move)
- Lock/unlock channels, voice channel management
- Custom embed creator and message scheduling
- Ticket system and join-to-create voice channels
- Auto-moderation with triggered messages
- XP tracking with configurable scaling and cooldowns
- Level-up messages with customizable channel and message
- Rank cards with role rewards
- Leaderboards and XP boosts
- Level blacklist for channels/roles/users
- Start, edit, end, and reroll giveaways
- Blacklist management (users and roles)
- Multiple winners support
- GPT-powered chat with custom situation prompts
- Token management system
- Counting (with configurable modes, challenges, and word chain)
- Akinator, Connect 4, Hangman, Tic-Tac-Toe, Wordle
- Rock Paper Scissors, Flag Quiz
- Country flags game
- Resize, rescale, mirror, compress images
- Background removal and filter effects
- Configurable log channels for various events
- Channel/role/user-specific blacklist for logs
- Multi-language support (English, German)
- Crowdin integration for community translations
- AFK status, avatar/banner display
- Boosted channel and role management
- Scheduled messages, Twitch integration
- Brawl Stars stats lookup
- Math tools (calculator, plot function, random numbers)
- Auto-publish announcements
- Feedback and reporting
- Startup validation and periodic health checks
- Database connectivity verification
- External API health checks (OpenAI, Twitch, GIPHY, Brawl Stars, GitHub, ImgBB, bytebin)
- Background loop health monitoring
- Docker healthcheck integration
- Python 3.12+
- MySQL/MariaDB database
- Discord bot token and application ID
-
Clone the repository:
git clone https://github.com/TanjunBot/new_tanjun.git cd new_tanjun -
Copy the environment file and configure it:
cp .env.example .env # Edit .env with your configuration -
Start with Docker Compose:
docker compose up -d
-
Clone the repository:
git clone https://github.com/TanjunBot/new_tanjun.git cd new_tanjun -
Create a virtual environment:
python3.12 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Copy and configure the environment file:
cp .env.example .env # Edit .env with your configuration -
Install pre-commit hooks (recommended for development):
pip install pre-commit pre-commit install
This will run Ruff linting/formatting, mypy type checking, and other checks automatically on every commit. Note that mypy run by pre-commit uses the settings defined in
.pre-commit-config.yamland may be less strict than CI. To ensure identical validation locally, update the mypy configuration in.pre-commit-config.yamlto match CI settings. -
Run the bot:
python main.py
The bot is configured via environment variables in a .env file. See .env.example for all available options:
| Variable | Description |
|---|---|
token |
Discord bot token |
applicationId |
Discord application ID |
adminIds |
Comma-separated list of admin user IDs |
database_* |
MySQL/MariaDB connection settings |
giphyAPIKey |
GIPHY API key |
openAIKey |
OpenAI API key |
twitchId / twitchSecret |
Twitch API credentials |
brawlstarsToken |
Brawl Stars API token |
ImgBBApiKey |
ImgBB API key |
bytebin_* |
bytebin pastebin credentials |
GithubAuthToken |
GitHub personal access token |
prefix |
Command prefix (default: t.) |
The included compose.yaml provides:
- Automatic restarts unless stopped
- Health checks every 30 seconds
- Timezone support (default: Europe/Berlin)
docker compose up -dUpdate scripts for Linux (update.sh) and Windows (update.bat) are included in the repository. The Docker image is automatically built and published to ghcr.io/tanjunbot/new_tanjun:latest via CI on repository pushes.
โโโ ai/ # AI integration (GPT, token management)
โโโ assets/ # Static assets (images, fonts)
โโโ commands/ # Slash command implementations
โ โโโ admin/ # Moderation and administration
โ โโโ ai/ # AI-related commands
โ โโโ channel/ # Channel management
โ โโโ fun/ # Fun commands
โ โโโ games/ # Game commands
โ โโโ giveaway/ # Giveaway commands
โ โโโ image/ # Image manipulation
โ โโโ level/ # Leveling system
โ โโโ logs/ # Logging configuration
โ โโโ math/ # Math utilities
โ โโโ minigames/ # Minigames (counting, word chain)
โ โโโ utility/ # Utility commands
โโโ extensions/ # Bot extension/cog modules
โโโ locales/ # Localization files (en.json, de.json)
โโโ loops/ # Background task loops
โโโ minigames/ # Minigame logic
โโโ tests/ # Test suite
โโโ main.py # Bot entry point
โโโ api.py # API server
โโโ config.py # Configuration loader
โโโ models.py # Database models
โโโ utility.py # Shared utilities
โโโ localizer.py # Localization system
โโโ compose.yaml # Docker Compose configuration
โโโ Dockerfile # Docker build file
We welcome contributions! Please check the issue tracker for open issues or feature requests.
For setup instructions and guidelines, see CONTRIBUTING.md.
This repository includes pre-commit configuration for automated linting and type checking:
- Ruff: Linting and code formatting
- Mypy: Static type checking
- Pre-commit hooks: Trailing whitespace, end-of-file fixes, YAML validation
Install with:
pip install pre-commit && pre-commit installPlease read our Code of Conduct before contributing.
See SECURITY.md for supported versions and vulnerability reporting instructions.
- Documentation: docs.tanjun.bot
- Support Server: discord.arion2000.xyz
- Status Page: status.tanjun.bot
- GitHub: TanjunBot/new_tanjun
This project is licensed under the terms specified in LICENSE.txt.
Built with โค๏ธ by EntchenEric and Arion2000
