feat: upgrade to .NET 6, refactor everything
This commit is contained in:
@@ -2,21 +2,20 @@ using System.Text.Json.Serialization;
|
||||
|
||||
using Myriad.Serialization;
|
||||
|
||||
namespace Myriad.Rest.Types
|
||||
{
|
||||
public record AllowedMentions
|
||||
{
|
||||
[JsonConverter(typeof(JsonSnakeCaseStringEnumConverter))]
|
||||
public enum ParseType
|
||||
{
|
||||
Roles,
|
||||
Users,
|
||||
Everyone
|
||||
}
|
||||
namespace Myriad.Rest.Types;
|
||||
|
||||
public ParseType[]? Parse { get; set; }
|
||||
public ulong[]? Users { get; set; }
|
||||
public ulong[]? Roles { get; set; }
|
||||
public bool RepliedUser { get; set; }
|
||||
public record AllowedMentions
|
||||
{
|
||||
[JsonConverter(typeof(JsonSnakeCaseStringEnumConverter))]
|
||||
public enum ParseType
|
||||
{
|
||||
Roles,
|
||||
Users,
|
||||
Everyone
|
||||
}
|
||||
|
||||
public ParseType[]? Parse { get; set; }
|
||||
public ulong[]? Users { get; set; }
|
||||
public ulong[]? Roles { get; set; }
|
||||
public bool RepliedUser { get; set; }
|
||||
}
|
@@ -1,6 +1,3 @@
|
||||
using System.IO;
|
||||
namespace Myriad.Rest.Types;
|
||||
|
||||
namespace Myriad.Rest.Types
|
||||
{
|
||||
public record MultipartFile(string Filename, Stream Data, string? Description);
|
||||
}
|
||||
public record MultipartFile(string Filename, Stream Data, string? Description);
|
@@ -1,13 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Rest.Types
|
||||
namespace Myriad.Rest.Types;
|
||||
|
||||
public record ApplicationCommandRequest
|
||||
{
|
||||
public record ApplicationCommandRequest
|
||||
{
|
||||
public string Name { get; init; }
|
||||
public string Description { get; init; }
|
||||
public List<ApplicationCommandOption>? Options { get; init; }
|
||||
}
|
||||
public string Name { get; init; }
|
||||
public string Description { get; init; }
|
||||
public List<ApplicationCommandOption>? Options { get; init; }
|
||||
}
|
@@ -1,4 +1,3 @@
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
{
|
||||
public record CreateDmRequest(ulong RecipientId);
|
||||
}
|
||||
namespace Myriad.Rest.Types.Requests;
|
||||
|
||||
public record CreateDmRequest(ulong RecipientId);
|
@@ -1,4 +1,3 @@
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
{
|
||||
public record CreateWebhookRequest(string Name);
|
||||
}
|
||||
namespace Myriad.Rest.Types.Requests;
|
||||
|
||||
public record CreateWebhookRequest(string Name);
|
@@ -1,14 +1,13 @@
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
namespace Myriad.Rest.Types.Requests;
|
||||
|
||||
public record ExecuteWebhookRequest
|
||||
{
|
||||
public record ExecuteWebhookRequest
|
||||
{
|
||||
public string? Content { get; init; }
|
||||
public string? Username { get; init; }
|
||||
public string? AvatarUrl { get; init; }
|
||||
public Embed[] Embeds { get; init; }
|
||||
public Message.Attachment[] Attachments { get; set; }
|
||||
public AllowedMentions? AllowedMentions { get; init; }
|
||||
}
|
||||
public string? Content { get; init; }
|
||||
public string? Username { get; init; }
|
||||
public string? AvatarUrl { get; init; }
|
||||
public Embed[] Embeds { get; init; }
|
||||
public Message.Attachment[] Attachments { get; set; }
|
||||
public AllowedMentions? AllowedMentions { get; init; }
|
||||
}
|
@@ -3,23 +3,22 @@ using System.Text.Json.Serialization;
|
||||
using Myriad.Types;
|
||||
using Myriad.Utils;
|
||||
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
namespace Myriad.Rest.Types.Requests;
|
||||
|
||||
public record MessageEditRequest
|
||||
{
|
||||
public record MessageEditRequest
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<string?> Content { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<string?> Content { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Embed?> Embed { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Embed?> Embed { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Message.MessageFlags> Flags { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Message.MessageFlags> Flags { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<AllowedMentions> AllowedMentions { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<AllowedMentions> AllowedMentions { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<MessageComponent[]?> Components { get; init; }
|
||||
}
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<MessageComponent[]?> Components { get; init; }
|
||||
}
|
@@ -1,14 +1,13 @@
|
||||
using Myriad.Types;
|
||||
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
namespace Myriad.Rest.Types.Requests;
|
||||
|
||||
public record MessageRequest
|
||||
{
|
||||
public record MessageRequest
|
||||
{
|
||||
public string? Content { get; set; }
|
||||
public object? Nonce { get; set; }
|
||||
public bool Tts { get; set; }
|
||||
public AllowedMentions? AllowedMentions { get; set; }
|
||||
public Embed? Embed { get; set; }
|
||||
public MessageComponent[]? Components { get; set; }
|
||||
}
|
||||
public string? Content { get; set; }
|
||||
public object? Nonce { get; set; }
|
||||
public bool Tts { get; set; }
|
||||
public AllowedMentions? AllowedMentions { get; set; }
|
||||
public Embed? Embed { get; set; }
|
||||
public MessageComponent[]? Components { get; set; }
|
||||
}
|
@@ -1,7 +1,6 @@
|
||||
namespace Myriad.Rest.Types
|
||||
namespace Myriad.Rest.Types;
|
||||
|
||||
public record ModifyGuildMemberRequest
|
||||
{
|
||||
public record ModifyGuildMemberRequest
|
||||
{
|
||||
public string? Nick { get; init; }
|
||||
}
|
||||
public string? Nick { get; init; }
|
||||
}
|
@@ -2,14 +2,13 @@ using System.Text.Json.Serialization;
|
||||
|
||||
using Myriad.Utils;
|
||||
|
||||
namespace Myriad.Rest.Types.Requests
|
||||
{
|
||||
public record WebhookMessageEditRequest
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<string?> Content { get; init; }
|
||||
namespace Myriad.Rest.Types.Requests;
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<AllowedMentions> AllowedMentions { get; init; }
|
||||
}
|
||||
public record WebhookMessageEditRequest
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<string?> Content { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<AllowedMentions> AllowedMentions { get; init; }
|
||||
}
|
Reference in New Issue
Block a user