Search Results for

    Show / Hide Table of Contents

    Class CommandCooldownBucket

    Represents a cooldown bucket for commands.

    Inheritance
    System.Object
    CommandCooldownBucket
    Namespace: DisCatSharp.CommandsNext.Attributes
    Assembly: DisCatSharp.CommandsNext.dll
    Syntax
    public sealed class CommandCooldownBucket : IEquatable<CommandCooldownBucket>

    Properties

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    ChannelId

    Gets the ID of the channel with which this cooldown is associated.

    Declaration
    public ulong ChannelId { get; }
    Property Value
    Type Description
    System.UInt64
    | Improve this Doc View Source

    GuildId

    Gets the ID of the guild with which this cooldown is associated.

    Declaration
    public ulong GuildId { get; }
    Property Value
    Type Description
    System.UInt64
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    RemainingUses

    Gets the remaining number of uses before the cooldown is triggered.

    Declaration
    public int RemainingUses { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Reset

    Gets the time after which this cooldown resets.

    Declaration
    public TimeSpan Reset { get; }
    Property Value
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    ResetsAt

    Gets the date and time at which the cooldown resets.

    Declaration
    public DateTimeOffset ResetsAt { get; }
    Property Value
    Type Description
    System.DateTimeOffset
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Gets the hash code for this CommandCooldownBucket.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    The hash code for this CommandCooldownBucket.

    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    Overrides
    System.Object.ToString()

    Operators

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems