nextcord-v3
nextcord-v3 copied to clipboard
feat: Generic cooldowns
This pull request aims to introduce generic-based cooldowns to the library. The aims of which are the following:
- A class-based approach, with easy to use decorators
- The ability to use multiple cooldowns at once, a feature discord.py sadly lacked.
- 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.
- 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
- Optional persistence. I.e. exposing an API through which end users can easily hook their own storage mediums into
- Easy toggling of cooldown application through a
check=Callablemedium
This pr also introduces test dependencies for pytest-asyncio
Do we really need cooldowns? Feels more like something for a command handler to do
Answered in discord.
Could you give a summary of what you discussed on Discord?
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.