nextcord-v3 icon indicating copy to clipboard operation
nextcord-v3 copied to clipboard

feat: Generic cooldowns

Open Skelmis opened this issue 3 years ago • 5 comments

This pull request aims to introduce generic-based cooldowns to the library. The aims of which are the following:

  1. A class-based approach, with easy to use decorators
  2. The ability to use multiple cooldowns at once, a feature discord.py sadly lacked.
  3. Easy interop between usage areas, such that these can be used for standard functions, slash, ext.commands, etc. With the only requirement being a change to the callable bucket being provided to the decorator.
  4. Extending that, the end-user should be able to define there own buckets for cooldowns rather then being limited to the built in buckets. This should also be extremely easy
  5. Optional persistence. I.e. exposing an API through which end users can easily hook their own storage mediums into
  6. Easy toggling of cooldown application through a check=Callable medium

Skelmis avatar Jan 09 '22 08:01 Skelmis

This pr also introduces test dependencies for pytest-asyncio

Skelmis avatar Jan 09 '22 08:01 Skelmis

Do we really need cooldowns? Feels more like something for a command handler to do

VincentRPS avatar Jan 09 '22 08:01 VincentRPS

Answered in discord.

Skelmis avatar Jan 09 '22 08:01 Skelmis

Could you give a summary of what you discussed on Discord?

sairam4123 avatar Jan 09 '22 17:01 sairam4123

Could you give a summary of what you discussed on Discord?

That they are going to be needed regardless. So why not implement them nicely and unbound from anything specific, such as command processing.

Skelmis avatar Jan 15 '22 02:01 Skelmis