Search Results for

    Show / Hide Table of Contents

    Class RequestOptions

    Represents options that should be used when sending a request.

    Inheritance
    Object
    RequestOptions
    Namespace: Discord
    Assembly: Discord.Net.Core.dll
    Syntax
    public class RequestOptions : object

    Constructors

    | Improve this Doc View Source

    RequestOptions()

    Initializes a new RequestOptions class with the default request timeout set in DiscordConfig.

    Declaration
    public RequestOptions()

    Properties

    | Improve this Doc View Source

    AuditLogReason

    Gets or sets the reason for this action in the guild's audit log.

    Declaration
    public string AuditLogReason { get; set; }
    Property Value
    Type Description
    String
    Remarks

    Gets or sets the reason that will be written to the guild's audit log if applicable. This may not apply to all actions.

    | Improve this Doc View Source

    CancelToken

    Gets or sets the cancellation token for this request.

    Declaration
    public CancellationToken CancelToken { get; set; }
    Property Value
    Type Description
    CancellationToken

    A for this request.

    | Improve this Doc View Source

    Default

    Creates a new RequestOptions class with its default settings.

    Declaration
    public static RequestOptions Default { get; }
    Property Value
    Type Description
    RequestOptions
    | Improve this Doc View Source

    HeaderOnly

    Declaration
    public bool HeaderOnly { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    RatelimitCallback

    Gets or sets the callback to execute regarding ratelimits for this request.

    Declaration
    public Func<IRateLimitInfo, Task> RatelimitCallback { get; set; }
    Property Value
    Type Description
    Func<IRateLimitInfo, Task>
    | Improve this Doc View Source

    RetryMode

    Gets or sets the retry behavior when the request fails.

    Declaration
    public RetryMode? RetryMode { get; set; }
    Property Value
    Type Description
    Nullable<RetryMode>
    | Improve this Doc View Source

    Timeout

    Gets or sets the maximum time to wait for this request to complete.

    Declaration
    public int? Timeout { get; set; }
    Property Value
    Type Description
    Nullable<Int32>

    A in milliseconds for when the request times out.

    Remarks

    Gets or set the max time, in milliseconds, to wait for this request to complete. If null, a request will not time out. If a rate limit has been triggered for this request's bucket and will not be unpaused in time, this request will fail immediately.

    | Improve this Doc View Source

    UseSystemClock

    Gets or sets whether or not this request should use the system clock for rate-limiting. Defaults to true.

    Declaration
    public bool? UseSystemClock { get; set; }
    Property Value
    Type Description
    Nullable<Boolean>
    Remarks

    This property can also be set in DiscordConfig. On a per-request basis, the system clock should only be disabled when millisecond precision is especially important, and the hosting system is known to have a desynced clock.

    Methods

    | Improve this Doc View Source

    Clone()

    Declaration
    public RequestOptions Clone()
    Returns
    Type Description
    RequestOptions

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2023 3.10.0