Search Results for

    Show / Hide Table of Contents

    Class BaseRateLimitAttribute

    A base for all the rate limit attributes.

    Inheritance
    System.Object
    System.Attribute
    InteractionRequirementAttribute
    BaseRateLimitAttribute
    GuildRateLimitAttribute
    UserRateLimitAttribute
    Inherited Members
    InteractionRequirementAttribute.CheckRequirementAsync(IInteractionContext, IServiceProvider)
    System.Attribute.Equals(System.Object)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.GetHashCode()
    System.Attribute.IsDefaultAttribute()
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
    System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type)
    System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
    System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
    System.Attribute.Match(System.Object)
    System.Attribute.TypeId
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Color_Chan.Discord.Commands.Attributes
    Assembly: Color-Chan.Discord.Commands.dll
    Syntax
    public abstract class BaseRateLimitAttribute : InteractionRequirementAttribute

    Constructors

    | Improve this Doc View Source

    BaseRateLimitAttribute(Int32, Int32)

    Initializes a new instance of BaseRateLimitAttribute.

    Declaration
    protected BaseRateLimitAttribute(int max, int resetAfterSeconds)
    Parameters
    Type Name Description
    System.Int32 max

    The max amount of time the command could be used during the time period.

    System.Int32 resetAfterSeconds

    The timeframe in which the command can be used a certain amount of times.

    Methods

    | Improve this Doc View Source

    CheckRateLimitAsync(IInteractionContext, IServiceProvider, UInt64)

    Check whether or not a rate limit has been hit.

    Declaration
    protected async Task<Result> CheckRateLimitAsync(IInteractionContext context, IServiceProvider services, ulong uniqueId)
    Parameters
    Type Name Description
    IInteractionContext context

    The IInteractionContext of the current request.

    System.IServiceProvider services

    The service.

    System.UInt64 uniqueId

    A unique ID that will be used to store the rate limit objects.

    Returns
    Type Description
    System.Threading.Tasks.Task<Result>

    A Result containing if the rate limit was successfully passed or not.

    Exceptions
    Type Condition
    System.NullReferenceException

    When the RateLimitInfo is not found after creating it.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX