Class CooldownAttribute
- Namespace
- DSharpPlus.CommandsNext.Attributes
- Assembly
- DSharpPlus.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
- Inheritance
-
objectAttributeCooldownAttribute
Constructors
- CooldownAttribute(int, double, CooldownBucketType)
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.
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.
Methods
- ExecuteCheckAsync(CommandContext, bool)
Asynchronously checks whether this command can be executed within given context.
- GetBucket(CommandContext)
Gets a cooldown bucket for given command context.
- GetRemainingCooldown(CommandContext)
Calculates the cooldown remaining for given command context.