Building Clark: Discord Bot with Web Dashboard
I built Clark, a Discord bot with a complete web dashboard for server management. Here's the stack and approach.
Tech Stack
- Bot: Python + discord.py
- Database: MySQL (async via aiomysql)
- Dashboard Backend: FastAPI
- Dashboard Frontend: Next.js + TypeScript
- Cache: Redis
Why Python + discord.py?
- Mature, well-documented library
- Excellent async/await support
- Handles sharding at scale automatically
class ClarkBot(commands.AutoShardedBot):
def __init__(self):
super().__init__(
intents=discord.Intents.all(),
shard_count=10
)Web Dashboard
The dashboard at clarkai.pro lets server admins:
- Manage moderation settings visually
- Configure auto-mod filters
- Create custom commands
- View logs and analytics
Key Challenges
Bot-Web Sync: Used WebSocket + Redis for real-time config updates between bot and dashboard.
Rate Limiting: Discord's API is strict. Implemented Redis-backed rate limiting across services.
Permissions: Mirror Discord's permission system exactly in the web layer.
Current Scale
- Thousands of Discord servers
- Hundreds of thousands of users
- 70% of admins use the web dashboard
Check out ClarkAI to see it in action.
Related: About Me • Building Basedrop
