Class SlashCooldownAttribute
- Namespace
- DSharpPlus.SlashCommands.Attributes
- Assembly
- DSharpPlus.SlashCommands.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 SlashCooldownAttribute : SlashCheckBaseAttribute
- Inheritance
-
objectAttributeSlashCooldownAttribute
Constructors
- SlashCooldownAttribute(int, double, SlashCooldownBucketType)
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
- ExecuteChecksAsync(InteractionContext)
Checks whether this command can be executed within the current context.
- GetBucket(InteractionContext)
Gets a cooldown bucket for given command context.
- GetRemainingCooldown(InteractionContext)
Calculates the cooldown remaining for given command context.