fix: Update Webhook ChannelId from model change (#1791)
This commit is contained in:
@@ -11,11 +11,11 @@ namespace Discord.Rest
|
|||||||
internal IGuild Guild { get; private set; }
|
internal IGuild Guild { get; private set; }
|
||||||
internal ITextChannel Channel { get; private set; }
|
internal ITextChannel Channel { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public ulong ChannelId { get; }
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Token { get; }
|
public string Token { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ulong ChannelId { get; private set; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -56,6 +56,8 @@ namespace Discord.Rest
|
|||||||
|
|
||||||
internal void Update(Model model)
|
internal void Update(Model model)
|
||||||
{
|
{
|
||||||
|
if (ChannelId != model.ChannelId)
|
||||||
|
ChannelId = model.ChannelId;
|
||||||
if (model.Avatar.IsSpecified)
|
if (model.Avatar.IsSpecified)
|
||||||
AvatarId = model.Avatar.Value;
|
AvatarId = model.Avatar.Value;
|
||||||
if (model.Creator.IsSpecified)
|
if (model.Creator.IsSpecified)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Model = Discord.API.Webhook;
|
using Model = Discord.API.Webhook;
|
||||||
@@ -11,9 +11,9 @@ namespace Discord.Webhook
|
|||||||
private DiscordWebhookClient _client;
|
private DiscordWebhookClient _client;
|
||||||
|
|
||||||
public ulong Id { get; }
|
public ulong Id { get; }
|
||||||
public ulong ChannelId { get; }
|
|
||||||
public string Token { get; }
|
public string Token { get; }
|
||||||
|
|
||||||
|
public ulong ChannelId { get; private set; }
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public string AvatarId { get; private set; }
|
public string AvatarId { get; private set; }
|
||||||
public ulong? GuildId { get; private set; }
|
public ulong? GuildId { get; private set; }
|
||||||
@@ -36,6 +36,8 @@ namespace Discord.Webhook
|
|||||||
|
|
||||||
internal void Update(Model model)
|
internal void Update(Model model)
|
||||||
{
|
{
|
||||||
|
if (ChannelId != model.ChannelId)
|
||||||
|
ChannelId = model.ChannelId;
|
||||||
if (model.Avatar.IsSpecified)
|
if (model.Avatar.IsSpecified)
|
||||||
AvatarId = model.Avatar.Value;
|
AvatarId = model.Avatar.Value;
|
||||||
if (model.GuildId.IsSpecified)
|
if (model.GuildId.IsSpecified)
|
||||||
|
|||||||
Reference in New Issue
Block a user