Browse Source

Make Webhook ApplicationId nullable instead of optional + fix IDiscordInteraction DeferAsync method (#110)

* Make Webhook ApplicationId nullable instead of optional

* Fix IDiscordInteraction DeferAsync to account for ephemeral defer
pull/1923/head
František Boháček GitHub 3 years ago
parent
commit
2435b873c7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions
  1. +1
    -1
      src/Discord.Net.Core/Discord.Net.Core.xml
  2. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs
  3. +1
    -1
      src/Discord.Net.Rest/API/Common/Webhook.cs
  4. +2
    -2
      src/Discord.Net.Rest/Entities/Webhooks/RestWebhook.cs
  5. +2
    -2
      src/Discord.Net.Webhook/Entities/Webhooks/RestInternalWebhook.cs

+ 1
- 1
src/Discord.Net.Core/Discord.Net.Core.xml View File

@@ -4691,7 +4691,7 @@
<param name="options">The request options for this async request.</param> <param name="options">The request options for this async request.</param>
<returns>A <see cref="T:Discord.IUserMessage"/> that represents the initial response.</returns> <returns>A <see cref="T:Discord.IUserMessage"/> that represents the initial response.</returns>
</member> </member>
<member name="M:Discord.IDiscordInteraction.DeferAsync(Discord.RequestOptions)">
<member name="M:Discord.IDiscordInteraction.DeferAsync(System.Boolean,Discord.RequestOptions)">
<summary> <summary>
Acknowledges this interaction. Acknowledges this interaction.
</summary> </summary>


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

@@ -92,6 +92,6 @@ namespace Discord
/// <returns> /// <returns>
/// A task that represents the asynchronous operation of acknowledging the interaction. /// A task that represents the asynchronous operation of acknowledging the interaction.
/// </returns> /// </returns>
Task DeferAsync (RequestOptions options = null);
Task DeferAsync (bool ephemeral = false, RequestOptions options = null);
} }
} }

+ 1
- 1
src/Discord.Net.Rest/API/Common/Webhook.cs View File

@@ -22,6 +22,6 @@ namespace Discord.API
[JsonProperty("user")] [JsonProperty("user")]
public Optional<User> Creator { get; set; } public Optional<User> Creator { get; set; }
[JsonProperty("application_id")] [JsonProperty("application_id")]
public Optional<ulong> ApplicationId { get; set; }
public ulong? ApplicationId { get; set; }
} }
} }

+ 2
- 2
src/Discord.Net.Rest/Entities/Webhooks/RestWebhook.cs View File

@@ -68,8 +68,8 @@ namespace Discord.Rest
GuildId = model.GuildId.Value; GuildId = model.GuildId.Value;
if (model.Name.IsSpecified) if (model.Name.IsSpecified)
Name = model.Name.Value; Name = model.Name.Value;
if (model.ApplicationId.IsSpecified)
ApplicationId = model.ApplicationId.Value;
ApplicationId = model.ApplicationId;
} }


/// <inheritdoc /> /// <inheritdoc />


+ 2
- 2
src/Discord.Net.Webhook/Entities/Webhooks/RestInternalWebhook.cs View File

@@ -45,8 +45,8 @@ namespace Discord.Webhook
GuildId = model.GuildId.Value; GuildId = model.GuildId.Value;
if (model.Name.IsSpecified) if (model.Name.IsSpecified)
Name = model.Name.Value; Name = model.Name.Value;
if (model.ApplicationId.IsSpecified)
ApplicationId = model.ApplicationId.Value;
ApplicationId = model.ApplicationId;
} }


public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)


Loading…
Cancel
Save