Skip to main content

Class BucketId

Represents a ratelimit bucket.

Assembly: Discord.Net.Core.dll​
View Source​
Declaration
public class BucketId : IEquatable<BucketId>

Properties​

HttpMethod​

Gets the http method used to make the request if available.

View Source​
Declaration
public string HttpMethod { get; }

Endpoint​

Gets the endpoint that is going to be requested if available.

View Source​
Declaration
public string Endpoint { get; }

MajorParameters​

Gets the major parameters of the route.

View Source​
Declaration
public IOrderedEnumerable<KeyValuePair<string, string>> MajorParameters { get; }

BucketHash​

Gets the hash of this bucket.

View Source​
Declaration
public string BucketHash { get; }

IsHashBucket​

Gets if this bucket is a hash type.

View Source​
Declaration
public bool IsHashBucket { get; }

Methods​

Create(String, String, Dictionary<String, String>)​

Creates a new Discord.Net.BucketId based on the Discord.Net.BucketId.HttpMethod and Discord.Net.BucketId.Endpoint.

View Source​
Declaration
public static BucketId Create(string httpMethod, string endpoint, Dictionary<string, string> majorParams)
Returns​

Discord.Net.BucketId: A Discord.Net.BucketId based on the Discord.Net.BucketId.HttpMethod and the Discord.Net.BucketId.Endpoint with the provided data.

Parameters​
TypeNameDescription
System.StringhttpMethodHttp method used to make the request.
System.StringendpointEndpoint that is going to receive requests.
System.Collections.Generic.Dictionary<System.String,System.String>majorParamsMajor parameters of the route of this endpoint.

Create(String, BucketId)​

Creates a new Discord.Net.BucketId based on a Discord.Net.BucketId.BucketHash and a previous Discord.Net.BucketId.

View Source​
Declaration
public static BucketId Create(string hash, BucketId oldBucket)
Returns​

Discord.Net.BucketId: A Discord.Net.BucketId based on the Discord.Net.BucketId.BucketHash and Discord.Net.BucketId.MajorParameters.

Parameters​
TypeNameDescription
System.StringhashBucket hash provided by Discord.
Discord.Net.BucketIdoldBucketDiscord.Net.BucketId that is going to be upgraded to a hash type.

GetBucketHash()​

Gets the string that will define this bucket as a hash based one.

View Source​
Declaration
public string GetBucketHash()
Returns​

System.String: A System.String that defines this bucket as a hash based one.

GetUniqueEndpoint()​

Gets the string that will define this bucket as an endpoint based one.

View Source​
Declaration
public string GetUniqueEndpoint()
Returns​

System.String: A System.String that defines this bucket as an endpoint based one.

Equals(Object)​

View Source​
Declaration
public override bool Equals(object obj)
Returns​

System.Boolean

Parameters​
TypeName
System.Objectobj

GetHashCode()​

View Source​
Declaration
public override int GetHashCode()
Returns​

System.Int32

ToString()​

View Source​
Declaration
public override string ToString()
Returns​

System.String

Equals(BucketId)​

View Source​
Declaration
public bool Equals(BucketId other)
Returns​

System.Boolean

Parameters​
TypeName
Discord.Net.BucketIdother

Implements​

  • System.IEquatable<Discord.Net.BucketId>