Knightbot-MD is a WhatsApp bot framework that connects through the multi-device protocol to automate group management, moderation, and interactive features. It provides a modular system for running turn-based multiplayer games like Tic-Tac-Toe within group conversations, converting images into WebP stickers for chat sharing, and synthesizing text messages into audio clips through text-to-speech conversion.
The bot includes a link-detection moderation engine that scans incoming messages against blocklisted domains and triggers automated warnings or muting. It enforces role-based command authorization, restricting sensitive operations to group administrators only, and uses prefix-triggered command parsing to match messages against registered handlers. Group management capabilities cover member permissions, muting, warnings, all-member tagging, and group settings control.
The system maintains in-memory game state for turn-based interactions and processes media through an image-to-sticker conversion pipeline that resizes and encodes uploaded images. The bot is implemented in JavaScript and connects as a WhatsApp client using the WebSocket-based multi-device protocol for message synchronization and sending.