From 2105555757f659140de55b823b5e53254ba97f1e Mon Sep 17 00:00:00 2001 From: trumpmcdonaldz Date: Sun, 12 May 2024 08:43:22 +0800 Subject: [PATCH] Added Poll property to IPartialMessage / PartialMessage --- NetCord/Gateway/IPartialMessage.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NetCord/Gateway/IPartialMessage.cs b/NetCord/Gateway/IPartialMessage.cs index faba08fd..f177e9d1 100644 --- a/NetCord/Gateway/IPartialMessage.cs +++ b/NetCord/Gateway/IPartialMessage.cs @@ -109,6 +109,8 @@ public static (Guild?, TextChannel?) GetCacheData(JsonMessage jsonModel, IGatewa public RoleSubscriptionData? RoleSubscriptionData { get; } public InteractionResolvedData? ResolvedData { get; } + + public MessagePoll? Poll { get; } public Task ReplyAsync(ReplyMessageProperties replyMessage, RestRequestProperties? properties = null); } @@ -198,6 +200,10 @@ public PartialMessage(JsonMessage jsonModel, Guild? guild, TextChannel? channel, var resolvedData = jsonModel.ResolvedData; if (resolvedData is not null) ResolvedData = new(resolvedData, jsonModel.GuildId, client); + + var poll = jsonModel.Poll; + if (poll is not null) + Poll = new(poll, jsonModel.GuildId.GetValueOrDefault(), client); } public override ulong Id => _jsonModel.Id; @@ -265,6 +271,8 @@ public PartialMessage(JsonMessage jsonModel, Guild? guild, TextChannel? channel, public RoleSubscriptionData? RoleSubscriptionData { get; } public InteractionResolvedData? ResolvedData { get; } + + public MessagePoll? Poll { get; } public Task ReplyAsync(ReplyMessageProperties replyMessage, RestRequestProperties? properties = null) => SendAsync(replyMessage.ToMessageProperties(Id), properties);