Case study

WonderBot — Modular Discord Bot

A modular Discord bot built with TypeScript and Node.js featuring music playback, queue management, administrative commands, gaming-related features, and voice channel integration. The application uses Discord.js, FFmpeg, yt-dlp, and a Docker-based runtime environment.

Jan 2026Feb 2026
wonder-bot

Technologies

TypeScriptDiscord.jsNode.jsFFmpegyt-dlp

The problem

Discord bots containing multiple features can quickly become difficult to maintain when commands, events, audio playback, and integrations are concentrated within a single code structure. Music playback also introduces additional complexity, including per-server state management, playback queues, voice connections, media processing, and interaction with external services.

The solution

A modular bot was developed using TypeScript and Discord.js, separating features into independent domains such as music, administration, general commands, RPG features, and gaming integrations. The music module implements independent queues for each Discord server and provides commands for playing, pausing, resuming, skipping, removing, looping, and inspecting tracks. Music metadata is retrieved using yt-dlp, while FFmpeg and Discord-compatible audio libraries provide the media processing required for voice playback. The application also includes slash-command deployment scripts and a Docker runtime containing the native dependencies required by the bot.

Responsibilities

Responsible for the architecture and development of the Discord bot, including modular command and event organization, Discord API integration, audio playback implementation, and per-server queue management. Also responsible for integrating external media tooling, handling playback commands, managing voice connection lifecycles, and building the Docker environment containing all required runtime dependencies.

Technical decisions

TypeScript was selected to improve maintainability and predictability in an event-driven application. Discord.js was used as the primary integration layer with the Discord API, while features were separated into independent modules to reduce coupling. Music functionality was divided into commands, services, managers, and interfaces rather than concentrating playback logic directly inside command handlers. yt-dlp is used to retrieve media information, while FFmpeg and Discord-compatible audio libraries handle the processing required for voice playback. Music state is managed independently for each Discord server, allowing separate queues and playback sessions. Docker was used to create a reproducible runtime containing Node.js and additional dependencies such as Python, FFmpeg, Opus, libsodium, yt-dlp, and Chromium.

Results

The project resulted in an extensible Discord bot capable of supporting multiple feature modules across different servers. The music system provides independent playback queues, playback state controls, and track information through native Discord commands. The modular architecture enables additional functionality to be introduced without concentrating all application behavior in a single code path, while containerization simplifies the setup of the multiple media and audio dependencies required by the application.