Skip to content

1.1.0

Latest

Choose a tag to compare

@ilsyaa ilsyaa released this 18 Jun 17:12

✨ New Features & Enhancements

  • Persistent Message Storage (Database Integration):
    • Added database migrations for contacts, groups, messages, and chats tables.
    • Introduced MessageBatcher for efficient batch insertions, drastically reducing database load during high traffic or message spikes.
    • Seamlessly integrated with Baileys event listeners to automatically sync contact histories, group details, and chat records.
    • Added a new CacheService.remember() method, allowing developers to easily cache the results of functions or queries for a specified duration.
  • MessageContext & Improved Serialization:
    • Introduced the new MessageContext class. Developers can now natively use convenient helper methods directly on messages, such as reply(), sendImage(), sendVideo(), react(), and delete().
    • Better detection for animated stickers via the newly refined isStickerAnimated attribute.
    • Optimized bot connection stability by forcing ipv4first DNS resolution logic.
  • Expanded Plugin Execution Context:
    • Every plugin now receives a dedicated scoped logger instance. Logs generated by plugins will automatically have their own namespace prefix, making debugging much easier.
    • Middleware and Event contexts now have direct access to the database instance (db) and the plugin's configuration methods (config.get() / config.set()).
  • Media & WebP Conversion Utilities:
    • Comprehensive media manipulation utilities have been added out-of-the-box: imageToWebp, videoToWebp, meme text overlays, audio/PTT conversions, and video compression.
    • Added support for writing EXIF metadata to WebP stickers directly via FFmpeg and ImageMagick fallbacks.
  • Rate Limiter Utility:
    • Introduced a new RateLimiter utility integrated with CacheService. This is highly useful for developers who want to restrict command spam or API requests using a time-based decay calculation system.
  • CLI & Environment Configuration:
    • API_BASE_URL can now be configured dynamically via .env.
    • Fixed make:plugin command behavior: It now displays a clean error message and gracefully exits if invoked by an unauthenticated user.
    • Auto-creation of the devices_auth database table during the initial setup process.

🛠️ Bug Fixes

  • Bulletproof Plugin Hot-Reload: Addressed critical bugs related to ghost events and memory leaks. Now, if a syntax error or typo occurs while reloading a plugin code (during npm run dev), the PluginManager uses a try...finally block to guarantee that memory and execution caches are properly cleared and updated.
  • Smart Cache Busting (Build Mode):
    • The hot-reload system can now differentiate between the TSX environment (Development) and standard Node.js (Production).
    • In production (build mode), the system no longer creates abstraction temporary files (.tmp.js). Instead, it uses pure ES Module query string cache busting, making Stack Trace Errors much more accurate and easier to maintain.
  • Ignored .env in Build Output: The build process now reads the .gitignore file and automatically strips out the .env ignore rule before writing it to the build/ directory, ensuring environment files are correctly handled in production deployments.

🏗️ Refactoring & Housekeeping

  • Utility Consolidation: Simplified and decluttered the project structure by merging primitive utility collections (array.ts, string.ts, object.ts, etc.) into a single, centralized helpers.ts file.
  • Robust Message Extraction: Refactored the getTextMessage function into extractMessageText. Parsing text from various WhatsApp structures (media, polls, nested structures, etc.) is now guaranteed to be safe from anomalies or empty arguments.
  • Refined Infrastructure Classes: Introduced the Http class (featuring timeout systems & auto header injections) and the Storage class (for temporary file cleanup management) natively into the core utilities.
  • Cleaned up TS6133 warnings related to unused variables (e.g., _cursor in loadMessages).
  • Added ES6 module type declaration support to generated package.json stubs and adjusted the README to accurately reflect the new workspace and plugin architecture descriptions.