Browse Source

inline docs correction (Name/Description Localized properties)

pull/2211/head
Cenngo 3 years ago
parent
commit
65bb459942
11 changed files with 25 additions and 20 deletions
  1. +2
    -2
      src/Discord.Net.Core/Entities/Interactions/IApplicationCommand.cs
  2. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOption.cs
  3. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOptionChoice.cs
  4. +7
    -4
      src/Discord.Net.Core/RequestOptions.cs
  5. +4
    -2
      src/Discord.Net.Rest/DiscordRestApiClient.cs
  6. +2
    -2
      src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommand.cs
  7. +1
    -1
      src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandChoice.cs
  8. +2
    -2
      src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandOption.cs
  9. +2
    -2
      src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommand.cs
  10. +1
    -1
      src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommandChoice.cs
  11. +2
    -2
      src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommandOption.cs

+ 2
- 2
src/Discord.Net.Core/Entities/Interactions/IApplicationCommand.cs View File

@@ -53,7 +53,7 @@ namespace Discord
/// Gets the localized name of this command.
/// </summary>
/// <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>
string? NameLocalized { get; }

@@ -61,7 +61,7 @@ namespace Discord
/// Gets the localized description of this command.
/// </summary>
/// <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>
string? DescriptionLocalized { get; }



+ 1
- 1
src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOption.cs View File

@@ -76,7 +76,7 @@ namespace Discord
/// Gets the localized name of this command.
/// </summary>
/// <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>
string? NameLocalized { get; }



+ 1
- 1
src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOptionChoice.cs View File

@@ -26,7 +26,7 @@ namespace Discord
/// Gets the localized name of this command.
/// </summary>
/// <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>
string? NameLocalized { get; }
}


+ 7
- 4
src/Discord.Net.Core/RequestOptions.cs View File

@@ -1,5 +1,6 @@
using Discord.Net;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

@@ -19,7 +20,7 @@ namespace Discord
/// Gets or sets the maximum time to wait for this request to complete.
/// </summary>
/// <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
/// and will not be unpaused in time, this request will fail immediately.
/// </remarks>
@@ -53,7 +54,7 @@ namespace Discord
/// </summary>
/// <remarks>
/// 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
/// hosting system is known to have a desynced clock.
/// </remarks>
@@ -64,6 +65,8 @@ namespace Discord
/// </summary>
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 BucketId BucketId { get; set; }
internal bool IsClientBucket { get; set; }
@@ -71,7 +74,7 @@ namespace Discord
internal bool IsGatewayBucket { get; set; }

internal static RequestOptions CreateOrClone(RequestOptions options)
{
{
if (options == null)
return new RequestOptions();
else
@@ -97,7 +100,7 @@ namespace Discord
{
Timeout = DiscordConfig.DefaultRequestTimeout;
}
public RequestOptions Clone() => MemberwiseClone() as RequestOptions;
}
}

+ 4
- 2
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -1193,7 +1193,8 @@ namespace Discord.API
{
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);
}

@@ -1265,7 +1266,8 @@ namespace Discord.API

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);
}



+ 2
- 2
src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommand.cs View File

@@ -46,7 +46,7 @@ namespace Discord.Rest
/// Gets the localized name of this command.
/// </summary>
/// <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>
public string? NameLocalized { get; private set; }

@@ -54,7 +54,7 @@ namespace Discord.Rest
/// Gets the localized description of this command.
/// </summary>
/// <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>
public string? DescriptionLocalized { get; private set; }



+ 1
- 1
src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandChoice.cs View File

@@ -24,7 +24,7 @@ namespace Discord.Rest
/// Gets the localized name of this command option choice.
/// </summary>
/// <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>
public string? NameLocalized { get; }



+ 2
- 2
src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandOption.cs View File

@@ -62,7 +62,7 @@ namespace Discord.Rest
/// Gets the localized name of this command option.
/// </summary>
/// <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>
public string? NameLocalized { get; private set; }

@@ -70,7 +70,7 @@ namespace Discord.Rest
/// Gets the localized description of this command option.
/// </summary>
/// <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>
public string? DescriptionLocalized { get; private set; }



+ 2
- 2
src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommand.cs View File

@@ -58,7 +58,7 @@ namespace Discord.WebSocket
/// Gets the localized name of this command.
/// </summary>
/// <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>
public string? NameLocalized { get; private set; }

@@ -66,7 +66,7 @@ namespace Discord.WebSocket
/// Gets the localized description of this command.
/// </summary>
/// <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>
public string? DescriptionLocalized { get; private set; }



+ 1
- 1
src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommandChoice.cs View File

@@ -24,7 +24,7 @@ namespace Discord.WebSocket
/// Gets the localized name of this command option choice.
/// </summary>
/// <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>
public string? NameLocalized { get; private set; }



+ 2
- 2
src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommandOption.cs View File

@@ -62,7 +62,7 @@ namespace Discord.WebSocket
/// Gets the localized name of this command option.
/// </summary>
/// <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>
public string? NameLocalized { get; private set; }

@@ -70,7 +70,7 @@ namespace Discord.WebSocket
/// Gets the localized description of this command option.
/// </summary>
/// <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>
public string? DescriptionLocalized { get; private set; }



Loading…
Cancel
Save