Skip to content

Commit

Permalink
Added Poll property to IPartialMessage / PartialMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
budgetdevv committed May 12, 2024
1 parent 8e9c1c0 commit 2105555
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NetCord/Gateway/IPartialMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RestMessage> ReplyAsync(ReplyMessageProperties replyMessage, RestRequestProperties? properties = null);
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<RestMessage> ReplyAsync(ReplyMessageProperties replyMessage, RestRequestProperties? properties = null)
=> SendAsync(replyMessage.ToMessageProperties(Id), properties);
Expand Down

0 comments on commit 2105555

Please sign in to comment.