Skip to content

Commit 629bd63

Browse files
Parl4224hKubaZ2
andauthored
Expose message_reference.type on MessageReference (#311)
* Add support for `Type` property in MessageReference * Update exposed model to be non nullable as documentation states a default value of 0 if not provided * remove unnecessary whitespace Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> * readd newline for formatting Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --------- Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com>
1 parent b44fc6d commit 629bd63

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

NetCord/JsonModels/JsonMessageReference.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ namespace NetCord.JsonModels;
44

55
public class JsonMessageReference
66
{
7+
[JsonPropertyName("type")]
8+
public MessageReferenceType? Type { get; set; }
9+
710
[JsonPropertyName("message_id")]
811
public ulong? MessageId { get; set; }
912

NetCord/MessageReference.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class MessageReference(JsonModels.JsonMessageReference jsonModel) : IJson
44
{
55
JsonModels.JsonMessageReference IJsonModel<JsonModels.JsonMessageReference>.JsonModel => jsonModel;
66

7+
public MessageReferenceType Type => jsonModel.Type.GetValueOrDefault();
78
public ulong MessageId => jsonModel.MessageId.GetValueOrDefault();
89
public ulong ChannelId => jsonModel.ChannelId.GetValueOrDefault();
910
public ulong? GuildId => jsonModel.GuildId;

0 commit comments

Comments
 (0)