[Feature] Update webhook implementation (#2723)
* initial commit * add partial guild & channel props * Apply suggestions from code review Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com> --------- Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
@@ -13,11 +13,12 @@ namespace Discord.Webhook
|
||||
public ulong Id { get; }
|
||||
public string Token { get; }
|
||||
|
||||
public ulong ChannelId { get; private set; }
|
||||
public ulong? ChannelId { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public string AvatarId { get; private set; }
|
||||
public ulong? GuildId { get; private set; }
|
||||
public ulong? ApplicationId { get; private set; }
|
||||
public WebhookType Type { get; private set; }
|
||||
|
||||
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace Discord.Webhook
|
||||
_client = apiClient;
|
||||
Id = model.Id;
|
||||
ChannelId = model.Id;
|
||||
Token = model.Token;
|
||||
Token = model.Token.GetValueOrDefault(null);
|
||||
}
|
||||
internal static RestInternalWebhook Create(DiscordWebhookClient client, Model model)
|
||||
{
|
||||
@@ -46,6 +47,8 @@ namespace Discord.Webhook
|
||||
if (model.Name.IsSpecified)
|
||||
Name = model.Name.Value;
|
||||
|
||||
Type = model.Type;
|
||||
|
||||
ApplicationId = model.ApplicationId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user