Work / Discord music bot
Miko Radio
A Discord music bot with a web dashboard, running in more than 20,000 servers.
Open mikoradio.comHow it works
- Role
- Design, development, hosting and support
- Status
- Live since 2023. Passed 20,000 servers in October 2026.
- Platform
- Discord, with a web dashboard
- Stack
- TypeScript, discord.js 14, Lavalink 4, MySQL, Next.js, PM2, IIS, Cloudflare

The problem
Most music bots are driven by commands typed into chat. That works for one person and gets messy for a busy server: nobody can see the queue, settings are hard to find, and one bot can only be in one voice channel.
Miko Radio set out to give a server a music system that people can manage from a web page as well as from Discord, and that stays online around the clock.
What I built
- Six sources. Spotify, Apple Music, YouTube Music, Deezer, SoundCloud and Tidal.
- A web dashboard. Manage the queue with drag-to-reorder, filters and server settings from a browser.
- 20+ audio filters, including 8D and bass boost.
- Listen Together. A Discord Activity that shares what is playing and the queue with everyone in the voice channel.
- Up to three Mikos per server. Premium servers can play in three voice channels at once, each with its own queue.
- The rest. Last.fm scrobbling, smart autoplay, 24/7 mode, song-request channels, 11 music card designs and 15 interface languages.
Playback is free. A vote unlocks extras for 12 hours, and Premium removes the vote. Premium is sold as User Premium, Server Premium and Lifetime.
How it works
A play request can start in three places. All of them end up on the one cluster that owns the server, because that is where its player and queue live.
Where a request starts
Slash commandTyped in DiscordWeb dashboardNext.js site; its API calls are passed to the botListen TogetherA Discord Activity in the voice channelBot API
HTTP and WebSocket layerChecks who is asking, then pushes live player state back to open dashboardsCluster manager
Finds the owning clusterEach server maps to one shard. A request that lands elsewhere is forwarded to the right cluster over worker RPCCluster
discord.js shardsTen clusters of ten shards. Holds the player, the queue and the settings from MySQLAudio
Lavalink 4Resolves the track, applies filters and streams to the Discord voice channel
A watchdog in the cluster manager restarts a cluster that stops answering. Health endpoints for the bot, the database, Lavalink and the clusters feed the public status page.
Hard problems and the decisions made
Dashboard buttons that reached the wrong cluster
Problem A dashboard request can arrive at any cluster, but only one of them holds the server’s player. Controls failed with “player not found” or claimed the user was not in voice.
Decision Resolve the owning cluster first, then run the voice check and the play action there through cross-cluster RPC.
Result The dashboard behaves the same no matter which cluster answers the web request.
Owning the audio client
Problem Playback fixes, Lavalink recovery and autoplay all depended on a vendored third-party client.
Decision Replace it with an in-house client package behind the same interface (June 2026). It ignores stale Lavalink events and fails over when a node is unhealthy.
Result A regression found on the way: Spotify playlists stopped after the first track until track-end handling was restored to the event-driven model.
A watchdog that killed healthy clusters
Problem The first watchdog restarted clusters that were only idle, so it was removed in October 2025.
Decision Bring it back with a five-minute startup grace, a 90-second stale threshold and restarts that back off from 5 to 120 seconds.
Result Clusters that really hang get restarted; quiet ones are left alone.
Every cluster writing the same row
Problem On restart, each cluster read, changed and rewrote one shared database row. The value grew until it overflowed its column.
Decision Give that state its own per-server table and widen the columns.
A Discord Activity behind Discord’s proxy
Problem Activities load through Discord’s proxy, where cookies across domains are unreliable. Turning Activities on also added an entry command that made bulk command deploys fail.
Decision Sign in with a bearer token instead of cookies, poll for state instead of holding a socket, and merge the entry command into every deploy.
Result Listen Together shipped in October 2026.
Checking who gets what
Problem Vote unlocks, user premium and server premium were checked in several places, each with its own calls.
Decision One shared, cached access check. A single vote unlocks the whole server for 12 hours.
The stack, and what each part is for
- TypeScript, discord.js 14
- The bot itself: commands, events, players and queues.
- Custom cluster manager
- Built on Node’s cluster module. Kept instead of the stock sharding manager because that one has no watchdog, restart backoff or cross-cluster RPC.
- Lavalink 4 and an in-house client
- Lavalink does the audio work. The client package is in-house for control over playback fixes, node recovery and autoplay. It also turns Spotify, Apple Music, Deezer and Tidal links into playable tracks.
- MySQL
- Server settings and other lasting data.
- @napi-rs/canvas
- Draws the music cards. The elapsed time on a card is a Discord timestamp, so the image is not redrawn every second.
- Next.js and React
- The website and dashboard. They call the bot’s own API.
- PM2, IIS, Cloudflare
- PM2 keeps the processes up on a Windows VPS. IIS is the reverse proxy and Cloudflare sits in front.
- Tests
- 59 test files, including failover tests for the audio client.
Screens


Timeline and what is next
- 2023Miko Radio launches
- 2024Reaches 10,000 servers and gets its dashboard and premium tier
- Feb 2026Premium linked to Patreon automatically
- Mar 2026New website and dashboard, with a self-service premium panel
- May 2026The Discord Activity works end to end
- Jun 2026In-house audio client replaces the vendored one
- Sep 2026Music card designs, and a status checker of its own
- Oct 2026Passes 20,000 servers. Miko 2 and 3 and Listen Together ship
- Oct 2026A support bot that answers from the product docs
- NextListen Together: a participant list and a prompt when Miko is not in voice yet
- NextStricter TypeScript settings and graceful shutdown in the bot
Status and links
Live since 2023. Passed 20,000 servers in October 2026.