Class CommandCooldownBucket
Represents a cooldown bucket for commands.
Inheritance
Namespace: DSharpPlus.CommandsNext.Attributes
Assembly: cs.temp.dll.dll
Syntax
public sealed class CommandCooldownBucket : IEquatable<CommandCooldownBucket>
Properties
BucketId
Gets the ID of the bucket. This is used to distinguish between cooldown buckets.
Declaration
public string BucketId { get; }
Property Value
Type | Description |
---|---|
System.String |
ChannelId
Gets the ID of the channel with which this cooldown is associated.
Declaration
public ulong ChannelId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
GuildId
Gets the ID of the guild with which this cooldown is associated.
Declaration
public ulong GuildId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
MaxUses
Gets the maximum number of times this command can be used in given timespan.
Declaration
public int MaxUses { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
RemainingUses
Gets the remaining number of uses before the cooldown is triggered.
Declaration
public int RemainingUses { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Reset
Gets the time after which this cooldown resets.
Declaration
public TimeSpan Reset { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
ResetsAt
Gets the date and time at which the cooldown resets.
Declaration
public DateTimeOffset ResetsAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
UserId
Gets the ID of the user with whom this cooldown is associated.
Declaration
public ulong UserId { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Methods
Equals(CommandCooldownBucket)
Checks whether this CommandCooldownBucket is equal to another CommandCooldownBucket.
Declaration
public bool Equals(CommandCooldownBucket other)
Parameters
Type | Name | Description |
---|---|---|
CommandCooldownBucket | other | CommandCooldownBucket to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the CommandCooldownBucket is equal to this CommandCooldownBucket. |
Equals(Object)
Checks whether this CommandCooldownBucket is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the object is equal to this CommandCooldownBucket. |
GetHashCode()
Gets the hash code for this CommandCooldownBucket.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code for this CommandCooldownBucket. |
MakeId(UInt64, UInt64, UInt64)
Creates a bucket ID from given bucket parameters.
Declaration
public static string MakeId(ulong userId = 0UL, ulong channelId = 0UL, ulong guildId = 0UL)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | userId | ID of the user with which this cooldown is associated. |
System.UInt64 | channelId | ID of the channel with which this cooldown is associated. |
System.UInt64 | guildId | ID of the guild with which this cooldown is associated. |
Returns
Type | Description |
---|---|
System.String | Generated bucket ID. |
ToString()
Returns a string representation of this command cooldown bucket.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | String representation of this command cooldown bucket. |
Operators
Equality(CommandCooldownBucket, CommandCooldownBucket)
Gets whether the two CommandCooldownBucket objects are equal.
Declaration
public static bool operator ==(CommandCooldownBucket bucket1, CommandCooldownBucket bucket2)
Parameters
Type | Name | Description |
---|---|---|
CommandCooldownBucket | bucket1 | First bucket to compare. |
CommandCooldownBucket | bucket2 | Second bucket to compare. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two buckets are equal. |
Inequality(CommandCooldownBucket, CommandCooldownBucket)
Gets whether the two CommandCooldownBucket objects are not equal.
Declaration
public static bool operator !=(CommandCooldownBucket bucket1, CommandCooldownBucket bucket2)
Parameters
Type | Name | Description |
---|---|---|
CommandCooldownBucket | bucket1 | First bucket to compare. |
CommandCooldownBucket | bucket2 | Second bucket to compare. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the two buckets are not equal. |