Added proper JsonPropertyNames.

This commit is contained in:
Filip Strajnar 2024-03-15 22:29:29 +01:00
parent 57d4cbf98a
commit ef94c1b3c9
2 changed files with 35 additions and 1 deletions

View file

@ -1,3 +1,22 @@
using System.Text.Json.Serialization;
namespace DiscordClient.Data;
public class ChannelMessagesResponse { }
[JsonUnmappedMemberHandling(JsonUnmappedMemberHandling.Skip)]
public class ChannelMessagesResponse
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("type")]
public int Type { get; set; }
[JsonPropertyName("content")]
public string Content { get; set; }
[JsonPropertyName("channel_id")]
public string ChannelId { get; set; }
[JsonPropertyName("author")]
public MessageAuthor Author { get; set; }
}

View file

@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace DiscordClient.Data;
public class MessageAuthor
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("username")]
public string Username { get; set; }
[JsonPropertyName("global_name")]
public string GlobalName { get; set; }
}