$ show ERLANRAHMAT/BETABOTZ-MD2
This repository implements a feature-rich WhatsApp bot (BETABOTZ-MD2) built on the @whiskeysockets/baileys library with multi-device support. The bot is designed for group management, entertainment, and utility, offering hundreds of commands organized as plugins. Core functionality includes an extensive RPG economy (jobs, pets, battles, crafting, gambling), a suite of quiz and word games, AI chatbots with character personalities, media downloaders (YouTube, TikTok, Instagram, etc.), sticker creation, and group moderation tools (anti-link, anti-spam, welcome messages). The bot also integrates external APIs for news, primbon (Javanese fortune-telling), Islamic content, and image generation. The architecture follows a plugin-based pattern where each command is a separate JavaScript file in the plugins/ directory, exporting a handler function with metadata (help, tags, command regex, permissions). The core bot logic resides in an obfuscated main.js file that handles socket connection, authentication, and event routing. Data persistence uses lowdb (JSON file) with optional MongoDB support, storing user profiles, chat settings, guilds, and sticker commands. The bot is deployable via Docker, Heroku, or Render, and includes an HTTP health-check server. A critical dependency is the external API at api.betabotz.eu.org, which powers most downloaders, AI, and content features. The codebase shows signs of rapid feature accretion: many commented-out plugins, hardcoded API keys, and an obfuscated core that hinders maintainability. Despite these issues, the plugin system and game logic modules (e.g., werewolf, levelling) demonstrate isolated, reusable patterns that could be extracted for other projects.
The LLM identified 3 files worth highlighting for reuse:
Exports functions to calculate XP thresholds for leveling up using a mathematical growth formula (Math.PI / Math.E exponent). Isolated module with no internal dependencies; can be reused in any game or application that needs a level progression system.
Implements a complete multiplayer Werewolf game engine with roles, voting, night/day cycles, and win conditions. Exports functions like run(), vote(), skill(), win(). Self-contained and could be extracted to power a standalone game server or integrated into other chat platforms.
Provides a custom Image class for reading, demuxing, and muxing WebP files, including animated WebP support. Uses low-level buffer manipulation and RIFF chunk parsing. Reusable in any Node.js project requiring WebP encoding/decoding without external native dependencies.