Abhinav◗
← All work

2025

Annie

All-in-one Discord bot running in 497 servers for 72k+ users

Built with
Next.jsReactTypeScriptdiscord.jsMongoDBTailwind
Live
Visit site →
annie.monster ↗

Annie replaces the six single-purpose bots most servers end up running. Economy, moderation, music, games, social and community tools, all in one place.

Live right now: 497 servers, 72,567 users, 18 ms gateway latency.

The bot. 313 prefix commands and 104 slash commands across 23 categories, 29 event listeners, roughly 125k lines. It runs sharded through a ShardingManager, with anti-nuke and automod on the moderation side and a simulated coin market with generated charts on the fun side.

The dashboard. A Next.js app of about 41k lines and 128 API routes. Discord OAuth2 login, per-guild config panels so nobody has to memorise command syntax, premium checkout with IPN callbacks, and rendered ticket transcripts. The status page tracks eight services separately, each with its own latency and incident history.

How it fits together: the sharded bot and the dashboard share one database
How it fits together: the sharded bot and the dashboard share one database

The bug I'm proudest of fixing. The shards leaked memory on a 2-core container. RSS climbed steadily while the JS heap stayed flat, so it was never JavaScript. glibc's mmap threshold is dynamic and ratchets upward every time a large buffer is freed, so canvas and sharp image buffers started coming from the arena heap instead of mmap, and arena memory never goes back to the OS. Pinning MALLOC_MMAP_THRESHOLD_ and capping MALLOC_ARENA_MAX fixed it. Both have to be set in code before the shards spawn, because glibc reads them at process start, before dotenv ever runs.

What I'd do differently

Build the status page in month one, not month six. Every incident in Annie's history that I can show you starts the day the status page shipped; everything before that lives only in my memory and in users' complaints. The same goes for the memory leak: it took weeks to notice because nothing was graphing RSS. Observability first, features second.

Next: DailyOS → Building something like it? Get in touch →