CooldownType class Null safety
An enum that represents the different ways to sort contexts into buckets.
Coolown types can be combined with the binary OR operator (|
). For details on how this affects
how contexts are sorted into buckets, see CooldownCheck.getKey.
You might also be interested in:
- CooldownCheck, the check that uses this enum.
Constructors
- CooldownType(int value)
-
Create a new CooldownType.
const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
dynamic other) → bool -
The equality operator.
inherited
-
operator |(
CooldownType other) → CooldownType - Combine two cooldown types.
Static Methods
-
applies(
CooldownType instance, CooldownType check) → bool -
Return whether
check
applies toinstance
.
Constants
- category → const CooldownType
-
A cooldown type that sorts contexts depending on the category they were invoked from.
CooldownType(1 << 0)
- channel → const CooldownType
-
A cooldown type that sorts contexts depending on the channel they were invoked from.
CooldownType(1 << 1)
- command → const CooldownType
-
A cooldown type that sorts contexts depending on the command being invoked.
CooldownType(1 << 2)
- global → const CooldownType
-
A cooldown type that sorts all contexts into the same bucket.
CooldownType(1 << 3)
- guild → const CooldownType
-
A cooldown type that sorts contexts depending on the guild they were invoked from.
CooldownType(1 << 4)
- role → const CooldownType
-
A cooldown type that sorts contexts depending on the highest-level role the user invoking the
command has.
CooldownType(1 << 5)
- user → const CooldownType
-
A cooldown type that sorts contexts depending on the user that invoked them.
CooldownType(1 << 6)