Class CooldownAttribute
- Namespace
- DisCatSharp.CommandsNext.Attributes
- Assembly
- DisCatSharp.CommandsNext.dll
Defines a cooldown for this command. This allows you to define how many times can users execute a specific command
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class CooldownAttribute : CheckBaseAttribute, ICooldown<CommandContext, CooldownBucket>
- Inheritance
-
CooldownAttribute
- Implements
- Inherited Members
Remarks
Defines a cooldown for this command. This means that users will be able to use the command a specific number of times before they have to wait to use it again.
Constructors
- CooldownAttribute(int, double, CooldownBucketType, Type?)
Defines a cooldown for this command. This allows you to define how many times can users execute a specific command
Properties
- BucketType
Gets the type of the cooldown bucket. This determines how cooldowns are applied.
- MaxUses
Gets the maximum number of uses before this command triggers a cooldown for its bucket.
- Reset
Gets the time after which the cooldown is reset.
- ResponderType
Gets the responder type.
Methods
- ExecuteCheckAsync(CommandContext, bool)
Executes a check.
- GetBucket(CommandContext)
Gets a cooldown bucket for given command context.
- GetRemainingCooldown(CommandContext)
Calculates the cooldown remaining for given command context.
- RespondRatelimitHitAsync(CommandContext, bool, CooldownBucket)
Responds to a ratelimit hit.