[Feature] Message Forwards (#2918)
* code * no guild * iTS ALIVE (THANKS aDVAITH)
This commit is contained in:
@@ -198,7 +198,8 @@ namespace Discord.WebSocket
|
||||
GuildId = model.Reference.Value.GuildId,
|
||||
InternalChannelId = model.Reference.Value.ChannelId,
|
||||
MessageId = model.Reference.Value.MessageId,
|
||||
FailIfNotExists = model.Reference.Value.FailIfNotExists
|
||||
FailIfNotExists = model.Reference.Value.FailIfNotExists,
|
||||
ReferenceType = model.Reference.Value.Type
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,9 @@ namespace Discord.WebSocket
|
||||
/// <inheritdoc />
|
||||
public MessageResolvedData ResolvedData { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyCollection<MessageSnapshot> ForwardedMessages { get; internal set; }
|
||||
|
||||
internal SocketUserMessage(DiscordSocketClient discord, ulong id, ISocketMessageChannel channel, SocketUser author, MessageSource source)
|
||||
: base(discord, id, channel, author, source)
|
||||
{
|
||||
@@ -213,6 +216,14 @@ namespace Discord.WebSocket
|
||||
if (model.InteractionMetadata.IsSpecified)
|
||||
InteractionMetadata = model.InteractionMetadata.Value.ToInteractionMetadata(Discord);
|
||||
|
||||
if (model.MessageSnapshots.IsSpecified)
|
||||
{
|
||||
ForwardedMessages = model.MessageSnapshots.Value.Select(x =>
|
||||
new MessageSnapshot(RestMessage.Create(Discord, null, null, x.Message))).ToImmutableArray();
|
||||
}
|
||||
else
|
||||
ForwardedMessages = ImmutableArray<MessageSnapshot>.Empty;
|
||||
|
||||
if (model.Poll.IsSpecified)
|
||||
Poll = model.Poll.Value.ToEntity();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user