@@ -53,7 +53,7 @@ namespace Discord | |||||
/// Gets the localized name of this command. | /// Gets the localized name of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
string? NameLocalized { get; } | string? NameLocalized { get; } | ||||
@@ -61,7 +61,7 @@ namespace Discord | |||||
/// Gets the localized description of this command. | /// Gets the localized description of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
string? DescriptionLocalized { get; } | string? DescriptionLocalized { get; } | ||||
@@ -76,7 +76,7 @@ namespace Discord | |||||
/// Gets the localized name of this command. | /// Gets the localized name of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
string? NameLocalized { get; } | string? NameLocalized { get; } | ||||
@@ -26,7 +26,7 @@ namespace Discord | |||||
/// Gets the localized name of this command. | /// Gets the localized name of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
string? NameLocalized { get; } | string? NameLocalized { get; } | ||||
} | } | ||||
@@ -1,5 +1,6 @@ | |||||
using Discord.Net; | using Discord.Net; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | |||||
using System.Threading; | using System.Threading; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
@@ -19,7 +20,7 @@ namespace Discord | |||||
/// Gets or sets the maximum time to wait for this request to complete. | /// Gets or sets the maximum time to wait for this request to complete. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Gets or set the max time, in milliseconds, to wait for this request to complete. If | |||||
/// Gets or set the max time, in milliseconds, to wait for this request to complete. If | |||||
/// <c>null</c>, a request will not time out. If a rate limit has been triggered for this request's bucket | /// <c>null</c>, 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. | /// and will not be unpaused in time, this request will fail immediately. | ||||
/// </remarks> | /// </remarks> | ||||
@@ -53,7 +54,7 @@ namespace Discord | |||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// This property can also be set in <see cref="DiscordConfig"/>. | /// This property can also be set in <see cref="DiscordConfig"/>. | ||||
/// On a per-request basis, the system clock should only be disabled | |||||
/// On a per-request basis, the system clock should only be disabled | |||||
/// when millisecond precision is especially important, and the | /// when millisecond precision is especially important, and the | ||||
/// hosting system is known to have a desynced clock. | /// hosting system is known to have a desynced clock. | ||||
/// </remarks> | /// </remarks> | ||||
@@ -64,6 +65,8 @@ namespace Discord | |||||
/// </summary> | /// </summary> | ||||
public Func<IRateLimitInfo, Task> RatelimitCallback { get; set; } | public Func<IRateLimitInfo, Task> RatelimitCallback { get; set; } | ||||
public IEnumerable<KeyValuePair<string, IEnumerable<string>>> RequestHeaders { get; } = new Dictionary<string, IEnumerable<string>>(); | |||||
internal bool IgnoreState { get; set; } | internal bool IgnoreState { get; set; } | ||||
internal BucketId BucketId { get; set; } | internal BucketId BucketId { get; set; } | ||||
internal bool IsClientBucket { get; set; } | internal bool IsClientBucket { get; set; } | ||||
@@ -71,7 +74,7 @@ namespace Discord | |||||
internal bool IsGatewayBucket { get; set; } | internal bool IsGatewayBucket { get; set; } | ||||
internal static RequestOptions CreateOrClone(RequestOptions options) | internal static RequestOptions CreateOrClone(RequestOptions options) | ||||
{ | |||||
{ | |||||
if (options == null) | if (options == null) | ||||
return new RequestOptions(); | return new RequestOptions(); | ||||
else | else | ||||
@@ -97,7 +100,7 @@ namespace Discord | |||||
{ | { | ||||
Timeout = DiscordConfig.DefaultRequestTimeout; | Timeout = DiscordConfig.DefaultRequestTimeout; | ||||
} | } | ||||
public RequestOptions Clone() => MemberwiseClone() as RequestOptions; | public RequestOptions Clone() => MemberwiseClone() as RequestOptions; | ||||
} | } | ||||
} | } |
@@ -1193,7 +1193,8 @@ namespace Discord.API | |||||
{ | { | ||||
options = RequestOptions.CreateOrClone(options); | options = RequestOptions.CreateOrClone(options); | ||||
return await SendAsync<ApplicationCommand[]>("GET", () => $"applications/{CurrentApplicationId}/commands?with_localizations={withLocalizations}", | |||||
//with_localizations=false doesnt return localized names and descriptions | |||||
return await SendAsync<ApplicationCommand[]>("GET", () => $"applications/{CurrentApplicationId}/commands{(withLocalizations ? "?with_localizations=true" : string.Empty)}", | |||||
new BucketIds(), options: options).ConfigureAwait(false); | new BucketIds(), options: options).ConfigureAwait(false); | ||||
} | } | ||||
@@ -1265,7 +1266,8 @@ namespace Discord.API | |||||
var bucket = new BucketIds(guildId: guildId); | var bucket = new BucketIds(guildId: guildId); | ||||
return await SendAsync<ApplicationCommand[]>("GET", () => $"applications/{CurrentApplicationId}/guilds/{guildId}/commands?with_localizations={withLocalizations}", | |||||
//with_localizations=false doesnt return localized names and descriptions | |||||
return await SendAsync<ApplicationCommand[]>("GET", () => $"applications/{CurrentApplicationId}/commands{(withLocalizations ? "?with_localizations=true" : string.Empty)}", | |||||
bucket, options: options).ConfigureAwait(false); | bucket, options: options).ConfigureAwait(false); | ||||
} | } | ||||
@@ -46,7 +46,7 @@ namespace Discord.Rest | |||||
/// Gets the localized name of this command. | /// Gets the localized name of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? NameLocalized { get; private set; } | public string? NameLocalized { get; private set; } | ||||
@@ -54,7 +54,7 @@ namespace Discord.Rest | |||||
/// Gets the localized description of this command. | /// Gets the localized description of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? DescriptionLocalized { get; private set; } | public string? DescriptionLocalized { get; private set; } | ||||
@@ -24,7 +24,7 @@ namespace Discord.Rest | |||||
/// Gets the localized name of this command option choice. | /// Gets the localized name of this command option choice. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? NameLocalized { get; } | public string? NameLocalized { get; } | ||||
@@ -62,7 +62,7 @@ namespace Discord.Rest | |||||
/// Gets the localized name of this command option. | /// Gets the localized name of this command option. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? NameLocalized { get; private set; } | public string? NameLocalized { get; private set; } | ||||
@@ -70,7 +70,7 @@ namespace Discord.Rest | |||||
/// Gets the localized description of this command option. | /// Gets the localized description of this command option. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? DescriptionLocalized { get; private set; } | public string? DescriptionLocalized { get; private set; } | ||||
@@ -58,7 +58,7 @@ namespace Discord.WebSocket | |||||
/// Gets the localized name of this command. | /// Gets the localized name of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? NameLocalized { get; private set; } | public string? NameLocalized { get; private set; } | ||||
@@ -66,7 +66,7 @@ namespace Discord.WebSocket | |||||
/// Gets the localized description of this command. | /// Gets the localized description of this command. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? DescriptionLocalized { get; private set; } | public string? DescriptionLocalized { get; private set; } | ||||
@@ -24,7 +24,7 @@ namespace Discord.WebSocket | |||||
/// Gets the localized name of this command option choice. | /// Gets the localized name of this command option choice. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? NameLocalized { get; private set; } | public string? NameLocalized { get; private set; } | ||||
@@ -62,7 +62,7 @@ namespace Discord.WebSocket | |||||
/// Gets the localized name of this command option. | /// Gets the localized name of this command option. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? NameLocalized { get; private set; } | public string? NameLocalized { get; private set; } | ||||
@@ -70,7 +70,7 @@ namespace Discord.WebSocket | |||||
/// Gets the localized description of this command option. | /// Gets the localized description of this command option. | ||||
/// </summary> | /// </summary> | ||||
/// <remarks> | /// <remarks> | ||||
/// Only returned when the `withLocalizations` query parameter is set to true when requesting the command. | |||||
/// Only returned when the `withLocalizations` query parameter is set to <see langword="false"/> when requesting the command. | |||||
/// </remarks> | /// </remarks> | ||||
public string? DescriptionLocalized { get; private set; } | public string? DescriptionLocalized { get; private set; } | ||||