Table of Contents

Class BucketId

Namespace
Discord.Net
Assembly
Discord.Net.Core.dll

Represents a ratelimit bucket.

public class BucketId : IEquatable<BucketId>
Inheritance
BucketId
Implements
Inherited Members

Properties

BucketHash

Gets the hash of this bucket.

public string BucketHash { get; }

Property Value

string

Remarks

The hash is provided by Discord to group ratelimits.

Endpoint

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

public string Endpoint { get; }

Property Value

string

HttpMethod

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

public string HttpMethod { get; }

Property Value

string

IsHashBucket

Gets if this bucket is a hash type.

public bool IsHashBucket { get; }

Property Value

bool

MajorParameters

Gets the major parameters of the route.

public IOrderedEnumerable<KeyValuePair<string, string>> MajorParameters { get; }

Property Value

IOrderedEnumerable<KeyValuePair<string, string>>

Methods

Create(string, BucketId)

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

public static BucketId Create(string hash, BucketId oldBucket)

Parameters

hash string

Bucket hash provided by Discord.

oldBucket BucketId

BucketId that is going to be upgraded to a hash type.

Returns

BucketId

A BucketId based on the BucketHash and MajorParameters.

Create(string, string, Dictionary<string, string>)

Creates a new BucketId based on the HttpMethod and Endpoint.

public static BucketId Create(string httpMethod, string endpoint, Dictionary<string, string> majorParams)

Parameters

httpMethod string

Http method used to make the request.

endpoint string

Endpoint that is going to receive requests.

majorParams Dictionary<string, string>

Major parameters of the route of this endpoint.

Returns

BucketId

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

Equals(BucketId)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(BucketId other)

Parameters

other BucketId

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetBucketHash()

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

public string GetBucketHash()

Returns

string

A string that defines this bucket as a hash based one.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetUniqueEndpoint()

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

public string GetUniqueEndpoint()

Returns

string

A string that defines this bucket as an endpoint based one.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.