internal RestRequest(BaseDiscordClient client, RateLimitBucket bucket, Uri url, RestRequestMethod method, string route, IReadOnlyDictionary <string, string> headers = null, string payload = null, double?ratelimitWaitOverride = null) : base(client, bucket, url, method, route, headers, ratelimitWaitOverride) { this.Payload = payload; }
/// <summary> /// Attempts to create an emoji object from emote name that includes colons (eg. :thinking:). This method also /// supports skin tone variations (eg. :ok_hand::skin-tone-2:), standard emoticons (eg. :D), as well as guild /// emoji (still specified by :name:). /// </summary> /// <param name="client"><see cref="BaseDiscordClient"/> to attach to the object.</param> /// <param name="name">Name of the emote to find, including colons (eg. :thinking:).</param> /// <param name="emoji">Resulting <see cref="DiscordEmoji"/> object.</param> /// <returns>Whether the operation was successful.</returns> public static bool TryFromName(BaseDiscordClient client, string name, out DiscordEmoji emoji) => TryFromName(client, name, true, out emoji);
internal LavalinkRestClient(LavalinkConfiguration config, BaseDiscordClient client) { this.RestEndpoint = config.RestEndpoint; this._logger = client.Logger; this.ConfigureHttpHandling(config.Password, client); }
internal RestClient(BaseDiscordClient client) : this(client.Configuration.Proxy) { this.Discord = client; this.HttpClient.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", Utilities.GetFormattedToken(client)); }