feature: Implemented Message Reference Property (#1413)

* Added support for Message References

* Removed unused usings, added debugger display, updated ToString override

* Changed snowflakes to be wrapped in an optional instead of a nullable.
This commit is contained in:
Neuheit
2019-11-09 13:12:29 -05:00
committed by Christopher F
parent 7f0c0c9155
commit f86c39de6a
6 changed files with 90 additions and 0 deletions

View File

@@ -53,6 +53,9 @@ namespace Discord.WebSocket
/// <inheritdoc />
public MessageApplication Application { get; private set; }
/// <inheritdoc />
public MessageReference Reference { get; private set; }
/// <summary>
/// Returns all attachments included in this message.
/// </summary>
@@ -140,6 +143,17 @@ namespace Discord.WebSocket
PartyId = model.Activity.Value.PartyId.Value
};
}
if (model.Reference.IsSpecified)
{
// Creates a new Reference from the API model
Reference = new MessageReference
{
GuildId = model.Reference.Value.GuildId,
ChannelId = model.Reference.Value.ChannelId,
MessageId = model.Reference.Value.MessageId
};
}
}
/// <inheritdoc />