Class SlashCommandCooldownAttribute
- Namespace
- DisCatSharp.ApplicationCommands.Attributes
- Assembly
- DisCatSharp.ApplicationCommands.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 SlashCommandCooldownAttribute : ApplicationCommandCheckBaseAttribute, ICooldown<BaseContext, CooldownBucket>
- Inheritance
-
SlashCommandCooldownAttribute
- 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
- SlashCommandCooldownAttribute(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
- ExecuteChecksAsync(BaseContext)
Executes a check.
- GetBucket(BaseContext)
Gets a cooldown bucket for given command context.
- GetRemainingCooldown(BaseContext)
Calculates the cooldown remaining for given command context.
- RespondRatelimitHitAsync(BaseContext, bool, CooldownBucket)
Responds to a ratelimit hit.