Class BucketId
Represents a ratelimit bucket.
Assembly: Discord.Net.Core.dll​
View Source​
public class BucketId : IEquatable<BucketId>
Properties​
HttpMethod​
Gets the http method used to make the request if available.
View Source​
public string HttpMethod { get; }
Endpoint​
Gets the endpoint that is going to be requested if available.
View Source​
public string Endpoint { get; }
MajorParameters​
Gets the major parameters of the route.
View Source​
public IOrderedEnumerable<KeyValuePair<string, string>> MajorParameters { get; }
BucketHash​
Gets the hash of this bucket.
View Source​
public string BucketHash { get; }
IsHashBucket​
Gets if this bucket is a hash type.
View Source​
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​
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​
Type | Name | Description |
---|---|---|
System.String | httpMethod | Http method used to make the request. |
System.String | endpoint | Endpoint that is going to receive requests. |
System.Collections.Generic.Dictionary<System.String,System.String> | majorParams | Major 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​
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​
Type | Name | Description |
---|---|---|
System.String | hash | Bucket hash provided by Discord. |
Discord.Net.BucketId | oldBucket | Discord.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​
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​
public string GetUniqueEndpoint()
Returns​
System.String
:
A System.String
that defines this bucket as an endpoint based one.
Equals(Object)​
View Source​
public override bool Equals(object obj)
Returns​
System.Boolean
Parameters​
Type | Name |
---|---|
System.Object | obj |
GetHashCode()​
View Source​
public override int GetHashCode()
Returns​
System.Int32
ToString()​
View Source​
public override string ToString()
Returns​
System.String
Equals(BucketId)​
View Source​
public bool Equals(BucketId other)
Returns​
System.Boolean
Parameters​
Type | Name |
---|---|
Discord.Net.BucketId | other |
Implements​
System.IEquatable<Discord.Net.BucketId>