A production-ready Discord bot with slash commands, colored logging, and Docker development workflow.
- π Modern Slash Commands - Discord's latest command system
- π¨ Colored Logging - Beautiful console output with file rotation
- π³ Docker Development - Edit locally, run in container
- π Environment Configs - Development/production/minimal modes
- π§ Auto Setup - Smart initialization and file copying
- Docker & Docker Compose
- Discord Bot Token (Create here)
git clone https://github.com/skriptzip/discordbot.git
cd discordbot
# Configure environment
cp .env.example .env
# Edit .env with your DISCORD_TOKEN
# Start bot
docker-compose up -d
# View logs
docker-compose logs -fdiscordbot/
βββ bot/
β βββ bot.py # Main bot file
β βββ example_commands.py # Example slash commands
β βββ bot_logging/ # Colored logging system
β βββ requirements.txt # Dependencies
βββ data/ # Persistent data (volume mapped)
β βββ logs/ # Log files
βββ docker-compose.yml # Development environment
βββ Dockerfile # Container build
| Command | Description |
|---|---|
/ping |
Check bot latency |
/status |
Show bot statistics |
/hello |
Friendly greeting |
/serverinfo |
Server information |
/userinfo [user] |
User information |
/logtest |
Demonstrate colored logging (admin only) |
Edit bot/bot.py or create new files:
@app_commands.command(name="hello", description="Say hello")
async def hello_slash(interaction: discord.Interaction):
await interaction.response.send_message("Hello!")
bot.tree.add_command(hello_slash)DISCORD_TOKEN=your_token_here
LOG_ENVIRONMENT=production # development/production/minimal
FORCE_COLOR=1 # Enable colored logs- Edit
bot/requirements.txt - Rebuild:
docker-compose up --build -d
The bot features a comprehensive colored logging system:
- π DEBUG (cyan) - Detailed debugging info
- βΉοΈ INFO (green) - General information
β οΈ WARNING (yellow) - Important notices- β ERROR (red) - Error conditions
- π¨ CRITICAL (bright red) - Critical failures
# Container logs (colored)
docker-compose logs -f
# File logs
tail -f ./data/logs/bot.log
tail -f ./data/logs/discord.log