Skip to content

@robojs/cooldown - Cooldowns & Rate-Limiting Plugin Implementation - #453

Draft
sorabhlahoti wants to merge 4 commits into
Wave-Play:mainfrom
sorabhlahoti:feature/cooldown-plugin
Draft

@robojs/cooldown - Cooldowns & Rate-Limiting Plugin Implementation#453
sorabhlahoti wants to merge 4 commits into
Wave-Play:mainfrom
sorabhlahoti:feature/cooldown-plugin

Conversation

@sorabhlahoti

Copy link
Copy Markdown

Overview

This PR introduces the initial implementation structure for the @robojs/cooldown plugin as requested in issue #448. This plugin provides comprehensive cooldown and rate-limiting functionality for Robo.js Discord bot commands.

What's Included

This initial commit establishes the foundational structure:

Files Added:

  • package.json - Package configuration with dependencies, scripts, and metadata
  • README.md - Comprehensive documentation covering features, installation, usage examples, and API reference
  • tsconfig.json - TypeScript configuration for ES2022 module compilation
  • src/index.ts - Main entry point with exports for middleware, cooldown manager functions, and type definitions

Features (as documented):

  • 🕐 Flexible cooldown durations per command
  • 👥 Multi-scope support (user, channel, guild, global)
  • ⚡ Easy integration via middleware pattern
  • 🔧 Configurable error messages and bypass roles
  • 📊 Built-in management commands and API endpoints

Implementation Status

✅ Package structure established
✅ Documentation complete
✅ Entry point defined

⚠️ Still Required: The complete TypeScript implementation files need to be added:

  • src/middleware/index.ts - Middleware implementation for automatic cooldown application
  • src/lib/cooldown-manager.ts - Core cooldown management logic (applyCooldown, getCooldown, setCooldown, resetCooldown, clearAllCooldowns)
  • src/lib/types.ts - Type definitions (CooldownConfig, CooldownScope, CooldownResult)
  • src/commands/ - Built-in slash commands (/cooldown check, reset, list)
  • src/api/ - API endpoints for @robojs/server integration
  • src/lib/storage.ts - Cooldown data storage implementation

Next Steps

The next PR will add the complete TypeScript implementation files to make this plugin fully functional. This structural foundation ensures the plugin follows Robo.js conventions and provides a clear development roadmap.

Related Issue

Closes #448

@waveplay-sage

waveplay-sage commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@sorabhlahoti

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

waveplay-sage added a commit that referenced this pull request Oct 6, 2025
@sorabhlahoti

Copy link
Copy Markdown
Author

recheck

@Pkmmte

Pkmmte commented Oct 7, 2025

Copy link
Copy Markdown
Member

Hello, please make sure to scaffold plugins using npx create-robo or via our plugin template. Thanks!

@sorabhlahoti
sorabhlahoti marked this pull request as draft October 9, 2025 08:13
@Pkmmte

Pkmmte commented Oct 20, 2025

Copy link
Copy Markdown
Member

Hi @sorabhlahoti! Just checking to see if there are any updates on this.

@Pkmmte

Pkmmte commented Nov 29, 2025

Copy link
Copy Markdown
Member

Hey @sorabhlahoti , is it alright if we assign this to someone else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@robojs/cooldown - Cooldowns & Rate-Limiting

3 participants