Class RequestOptions
- Namespace
- Kook
- Assembly
- Kook.Net.Core.dll
Represents options that should be used when sending a request.
public class RequestOptions
- Inheritance
-
RequestOptions
- Inherited Members
Constructors
RequestOptions()
Initializes a new RequestOptions class with the default request timeout set in KookConfig.
public RequestOptions()
Properties
AuditLogReason
Gets or sets the reason for this action in the guild's audit log.
public string? AuditLogReason { get; set; }
Property Value
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.
CancellationToken
Gets or sets the cancellation token for this request.
public CancellationToken CancellationToken { get; set; }
Property Value
- CancellationToken
A CancellationToken for this request.
Default
Creates a new RequestOptions class with its default settings.
public static RequestOptions Default { get; }
Property Value
RatelimitCallback
Gets or sets the callback to execute regarding ratelimits for this request.
public Func<IRateLimitInfo, Task>? RatelimitCallback { get; set; }
Property Value
RetryMode
Gets or sets the retry behavior when the request fails.
public RetryMode? RetryMode { get; set; }
Property Value
Timeout
Gets or sets the maximum time to wait for this request to complete.
public int? Timeout { get; set; }
Property Value
- int?
An int 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.
Methods
Clone()
Memberwise clones this RequestOptions object.
public RequestOptions Clone()
Returns
- RequestOptions
A cloned RequestOptions object.