Fix channel being null in DMs on Interactions (#2098)

This commit is contained in:
Quin Lynch
2022-02-11 21:43:32 -04:00
committed by GitHub
parent 0352374e74
commit 7e1b8c9db0
12 changed files with 111 additions and 64 deletions

View File

@@ -61,6 +61,9 @@ namespace Discord.Rest
/// <inheritdoc/>
public bool HasResponded { get; protected set; }
/// <inheritdoc/>
public bool IsDMInteraction { get; private set; }
internal RestInteraction(BaseDiscordClient discord, ulong id)
: base(discord, id)
{
@@ -108,6 +111,8 @@ namespace Discord.Rest
internal virtual async Task UpdateAsync(DiscordRestClient discord, Model model)
{
IsDMInteraction = !model.GuildId.IsSpecified;
Data = model.Data.IsSpecified
? model.Data.Value
: null;