Browse Source

Webhook core implementation.

pull/843/head
Alex Gravely 8 years ago
parent
commit
bab6f5262b
3 changed files with 16 additions and 2 deletions
  1. +1
    -1
      src/Discord.Net.Core/Entities/Webhooks/IWebhook.cs
  2. +14
    -0
      src/Discord.Net.Core/Entities/Webhooks/WebhookProperties.cs
  3. +1
    -1
      src/Discord.Net.Core/IDiscordClient.cs

+ 1
- 1
src/Discord.Net.Core/Entities/Webhooks/IWebhook.cs View File

@@ -23,7 +23,7 @@ namespace Discord
/// <summary> Gets the guild owning this webhook. </summary> /// <summary> Gets the guild owning this webhook. </summary>
IGuild Guild { get; } IGuild Guild { get; }
/// <summary> Gets the id of the guild owning this webhook. </summary> /// <summary> Gets the id of the guild owning this webhook. </summary>
ulong GuildId { get; }
ulong? GuildId { get; }


/// <summary> Gets the user that created this webhook. </summary> /// <summary> Gets the user that created this webhook. </summary>
IUser Creator { get; } IUser Creator { get; }


+ 14
- 0
src/Discord.Net.Core/Entities/Webhooks/WebhookProperties.cs View File

@@ -23,5 +23,19 @@
/// The default avatar of the webhook. /// The default avatar of the webhook.
/// </summary> /// </summary>
public Optional<Image?> Image { get; set; } public Optional<Image?> Image { get; set; }
/// <summary>
/// The channel for this webhook.
/// </summary>
/// <remarks>
/// This field is not used when authenticated with <see cref="TokenType.Webhook"/>.
/// </remarks>
public Optional<ITextChannel> Channel { get; set; }
/// <summary>
/// The channel id for this webhook.
/// </summary>
/// <remarks>
/// This field is not used when authenticated with <see cref="TokenType.Webhook"/>.
/// </remarks>
public Optional<ulong> ChannelId { get; set; }
} }
} }

+ 1
- 1
src/Discord.Net.Core/IDiscordClient.cs View File

@@ -35,6 +35,6 @@ namespace Discord
Task<IReadOnlyCollection<IVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null); Task<IReadOnlyCollection<IVoiceRegion>> GetVoiceRegionsAsync(RequestOptions options = null);
Task<IVoiceRegion> GetVoiceRegionAsync(string id, RequestOptions options = null); Task<IVoiceRegion> GetVoiceRegionAsync(string id, RequestOptions options = null);


Task<IWebhook> GetWebhookAsync(ulong id, string webhookToken = null, RequestOptions options = null);
Task<IWebhook> GetWebhookAsync(ulong id, RequestOptions options = null);
} }
} }

Loading…
Cancel
Save