feat: upgrade to .NET 6, refactor everything
This commit is contained in:
@@ -1,25 +1,24 @@
|
||||
namespace Myriad.Types
|
||||
{
|
||||
public record Application: ApplicationPartial
|
||||
{
|
||||
public string Name { get; init; }
|
||||
public string? Icon { get; init; }
|
||||
public string Description { get; init; }
|
||||
public string[]? RpcOrigins { get; init; }
|
||||
public bool BotPublic { get; init; }
|
||||
public bool BotRequireCodeGrant { get; init; }
|
||||
public User Owner { get; init; } // TODO: docs specify this is "partial", what does that mean
|
||||
public string Summary { get; init; }
|
||||
public string VerifyKey { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public ulong? PrimarySkuId { get; init; }
|
||||
public string? Slug { get; init; }
|
||||
public string? CoverImage { get; init; }
|
||||
}
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record ApplicationPartial
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public int Flags { get; init; }
|
||||
}
|
||||
public record Application: ApplicationPartial
|
||||
{
|
||||
public string Name { get; init; }
|
||||
public string? Icon { get; init; }
|
||||
public string Description { get; init; }
|
||||
public string[]? RpcOrigins { get; init; }
|
||||
public bool BotPublic { get; init; }
|
||||
public bool BotRequireCodeGrant { get; init; }
|
||||
public User Owner { get; init; } // TODO: docs specify this is "partial", what does that mean
|
||||
public string Summary { get; init; }
|
||||
public string VerifyKey { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public ulong? PrimarySkuId { get; init; }
|
||||
public string? Slug { get; init; }
|
||||
public string? CoverImage { get; init; }
|
||||
}
|
||||
|
||||
public record ApplicationPartial
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public int Flags { get; init; }
|
||||
}
|
@@ -1,11 +1,10 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record ApplicationCommand
|
||||
{
|
||||
public record ApplicationCommand
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public ulong ApplicationId { get; init; }
|
||||
public string Name { get; init; }
|
||||
public string Description { get; init; }
|
||||
public ApplicationCommandOption[]? Options { get; init; }
|
||||
}
|
||||
public ulong Id { get; init; }
|
||||
public ulong ApplicationId { get; init; }
|
||||
public string Name { get; init; }
|
||||
public string Description { get; init; }
|
||||
public ApplicationCommandOption[]? Options { get; init; }
|
||||
}
|
@@ -1,11 +1,10 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record ApplicationCommandInteractionData
|
||||
{
|
||||
public record ApplicationCommandInteractionData
|
||||
{
|
||||
public ulong? Id { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public ApplicationCommandInteractionDataOption[]? Options { get; init; }
|
||||
public string? CustomId { get; init; }
|
||||
public ComponentType? ComponentType { get; init; }
|
||||
}
|
||||
public ulong? Id { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public ApplicationCommandInteractionDataOption[]? Options { get; init; }
|
||||
public string? CustomId { get; init; }
|
||||
public ComponentType? ComponentType { get; init; }
|
||||
}
|
@@ -1,9 +1,8 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record ApplicationCommandInteractionDataOption
|
||||
{
|
||||
public record ApplicationCommandInteractionDataOption
|
||||
{
|
||||
public string Name { get; init; }
|
||||
public object? Value { get; init; }
|
||||
public ApplicationCommandInteractionDataOption[]? Options { get; init; }
|
||||
}
|
||||
public string Name { get; init; }
|
||||
public object? Value { get; init; }
|
||||
public ApplicationCommandInteractionDataOption[]? Options { get; init; }
|
||||
}
|
@@ -1,24 +1,23 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record ApplicationCommandOption(ApplicationCommandOption.OptionType Type, string Name, string Description)
|
||||
{
|
||||
public record ApplicationCommandOption(ApplicationCommandOption.OptionType Type, string Name, string Description)
|
||||
public enum OptionType
|
||||
{
|
||||
public enum OptionType
|
||||
{
|
||||
Subcommand = 1,
|
||||
SubcommandGroup = 2,
|
||||
String = 3,
|
||||
Integer = 4,
|
||||
Boolean = 5,
|
||||
User = 6,
|
||||
Channel = 7,
|
||||
Role = 8
|
||||
}
|
||||
|
||||
public bool Default { get; init; }
|
||||
public bool Required { get; init; }
|
||||
public Choice[]? Choices { get; init; }
|
||||
public ApplicationCommandOption[]? Options { get; init; }
|
||||
|
||||
public record Choice(string Name, object Value);
|
||||
Subcommand = 1,
|
||||
SubcommandGroup = 2,
|
||||
String = 3,
|
||||
Integer = 4,
|
||||
Boolean = 5,
|
||||
User = 6,
|
||||
Channel = 7,
|
||||
Role = 8
|
||||
}
|
||||
|
||||
public bool Default { get; init; }
|
||||
public bool Required { get; init; }
|
||||
public Choice[]? Choices { get; init; }
|
||||
public ApplicationCommandOption[]? Options { get; init; }
|
||||
|
||||
public record Choice(string Name, object Value);
|
||||
}
|
@@ -1,22 +1,21 @@
|
||||
namespace Myriad.Types
|
||||
{
|
||||
public record Interaction
|
||||
{
|
||||
public enum InteractionType
|
||||
{
|
||||
Ping = 1,
|
||||
ApplicationCommand = 2,
|
||||
MessageComponent = 3
|
||||
}
|
||||
namespace Myriad.Types;
|
||||
|
||||
public ulong Id { get; init; }
|
||||
public InteractionType Type { get; init; }
|
||||
public ApplicationCommandInteractionData? Data { get; init; }
|
||||
public ulong GuildId { get; init; }
|
||||
public ulong ChannelId { get; init; }
|
||||
public GuildMember? Member { get; init; }
|
||||
public User? User { get; init; }
|
||||
public string Token { get; init; }
|
||||
public Message? Message { get; init; }
|
||||
public record Interaction
|
||||
{
|
||||
public enum InteractionType
|
||||
{
|
||||
Ping = 1,
|
||||
ApplicationCommand = 2,
|
||||
MessageComponent = 3
|
||||
}
|
||||
|
||||
public ulong Id { get; init; }
|
||||
public InteractionType Type { get; init; }
|
||||
public ApplicationCommandInteractionData? Data { get; init; }
|
||||
public ulong GuildId { get; init; }
|
||||
public ulong ChannelId { get; init; }
|
||||
public GuildMember? Member { get; init; }
|
||||
public User? User { get; init; }
|
||||
public string Token { get; init; }
|
||||
public Message? Message { get; init; }
|
||||
}
|
@@ -3,26 +3,25 @@ using System.Text.Json.Serialization;
|
||||
using Myriad.Rest.Types;
|
||||
using Myriad.Utils;
|
||||
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record InteractionApplicationCommandCallbackData
|
||||
{
|
||||
public record InteractionApplicationCommandCallbackData
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<bool?> Tts { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<bool?> Tts { get; init; }
|
||||
|
||||
[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[]?> Embeds { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Embed[]?> Embeds { 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<Message.MessageFlags> Flags { get; init; }
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Message.MessageFlags> Flags { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<MessageComponent[]?> Components { get; init; }
|
||||
}
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<MessageComponent[]?> Components { get; init; }
|
||||
}
|
@@ -1,17 +1,16 @@
|
||||
namespace Myriad.Types
|
||||
{
|
||||
public record InteractionResponse
|
||||
{
|
||||
public enum ResponseType
|
||||
{
|
||||
Pong = 1,
|
||||
ChannelMessageWithSource = 4,
|
||||
DeferredChannelMessageWithSource = 5,
|
||||
DeferredUpdateMessage = 6,
|
||||
UpdateMessage = 7
|
||||
}
|
||||
namespace Myriad.Types;
|
||||
|
||||
public ResponseType Type { get; init; }
|
||||
public InteractionApplicationCommandCallbackData? Data { get; init; }
|
||||
public record InteractionResponse
|
||||
{
|
||||
public enum ResponseType
|
||||
{
|
||||
Pong = 1,
|
||||
ChannelMessageWithSource = 4,
|
||||
DeferredChannelMessageWithSource = 5,
|
||||
DeferredUpdateMessage = 6,
|
||||
UpdateMessage = 7
|
||||
}
|
||||
|
||||
public ResponseType Type { get; init; }
|
||||
public InteractionApplicationCommandCallbackData? Data { get; init; }
|
||||
}
|
Reference in New Issue
Block a user