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; }
|
||||
}
|
@@ -1,45 +1,45 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record Channel
|
||||
{
|
||||
public record Channel
|
||||
public enum ChannelType
|
||||
{
|
||||
public enum ChannelType
|
||||
{
|
||||
GuildText = 0,
|
||||
Dm = 1,
|
||||
GuildVoice = 2,
|
||||
GroupDm = 3,
|
||||
GuildCategory = 4,
|
||||
GuildNews = 5,
|
||||
GuildStore = 6,
|
||||
GuildNewsThread = 10,
|
||||
GuildPublicThread = 11,
|
||||
GuildPrivateThread = 12,
|
||||
GuildStageVoice = 13
|
||||
}
|
||||
|
||||
public ulong Id { get; init; }
|
||||
public ChannelType Type { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public int? Position { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public string? Topic { get; init; }
|
||||
public bool? Nsfw { get; init; }
|
||||
public ulong? ParentId { get; init; }
|
||||
public Overwrite[]? PermissionOverwrites { get; init; }
|
||||
public User[]? Recipients { get; init; } // NOTE: this may be null for stub channel objects
|
||||
|
||||
public record Overwrite
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public OverwriteType Type { get; init; }
|
||||
public PermissionSet Allow { get; init; }
|
||||
public PermissionSet Deny { get; init; }
|
||||
}
|
||||
|
||||
public enum OverwriteType
|
||||
{
|
||||
Role = 0,
|
||||
Member = 1
|
||||
}
|
||||
GuildText = 0,
|
||||
Dm = 1,
|
||||
GuildVoice = 2,
|
||||
GroupDm = 3,
|
||||
GuildCategory = 4,
|
||||
GuildNews = 5,
|
||||
GuildStore = 6,
|
||||
GuildNewsThread = 10,
|
||||
GuildPublicThread = 11,
|
||||
GuildPrivateThread = 12,
|
||||
GuildStageVoice = 13
|
||||
}
|
||||
|
||||
public ulong Id { get; init; }
|
||||
public ChannelType Type { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public int? Position { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public string? Topic { get; init; }
|
||||
public bool? Nsfw { get; init; }
|
||||
public ulong? ParentId { get; init; }
|
||||
public Overwrite[]? PermissionOverwrites { get; init; }
|
||||
public User[]? Recipients { get; init; } // NOTE: this may be null for stub channel objects
|
||||
|
||||
public record Overwrite
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public OverwriteType Type { get; init; }
|
||||
public PermissionSet Allow { get; init; }
|
||||
public PermissionSet Deny { get; init; }
|
||||
}
|
||||
|
||||
public enum OverwriteType
|
||||
{
|
||||
Role = 0,
|
||||
Member = 1
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +1,10 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public enum ButtonStyle
|
||||
{
|
||||
public enum ButtonStyle
|
||||
{
|
||||
Primary = 1,
|
||||
Secondary = 2,
|
||||
Success = 3,
|
||||
Danger = 4,
|
||||
Link = 5
|
||||
}
|
||||
Primary = 1,
|
||||
Secondary = 2,
|
||||
Success = 3,
|
||||
Danger = 4,
|
||||
Link = 5
|
||||
}
|
@@ -1,8 +1,7 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public enum ComponentType
|
||||
{
|
||||
public enum ComponentType
|
||||
{
|
||||
ActionRow = 1,
|
||||
Button = 2
|
||||
}
|
||||
ActionRow = 1,
|
||||
Button = 2
|
||||
}
|
@@ -1,14 +1,13 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record MessageComponent
|
||||
{
|
||||
public record MessageComponent
|
||||
{
|
||||
public ComponentType Type { get; init; }
|
||||
public ButtonStyle? Style { get; init; }
|
||||
public string? Label { get; init; }
|
||||
public Emoji? Emoji { get; init; }
|
||||
public string? CustomId { get; init; }
|
||||
public string? Url { get; init; }
|
||||
public bool? Disabled { get; init; }
|
||||
public MessageComponent[]? Components { get; init; }
|
||||
}
|
||||
public ComponentType Type { get; init; }
|
||||
public ButtonStyle? Style { get; init; }
|
||||
public string? Label { get; init; }
|
||||
public Emoji? Emoji { get; init; }
|
||||
public string? CustomId { get; init; }
|
||||
public string? Url { get; init; }
|
||||
public bool? Disabled { get; init; }
|
||||
public MessageComponent[]? Components { get; init; }
|
||||
}
|
@@ -1,62 +1,61 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record Embed
|
||||
{
|
||||
public record Embed
|
||||
{
|
||||
public string? Title { get; init; }
|
||||
public string? Type { get; init; }
|
||||
public string? Description { get; init; }
|
||||
public string? Url { get; init; }
|
||||
public string? Timestamp { get; init; }
|
||||
public uint? Color { get; init; }
|
||||
public EmbedFooter? Footer { get; init; }
|
||||
public EmbedImage? Image { get; init; }
|
||||
public EmbedThumbnail? Thumbnail { get; init; }
|
||||
public EmbedVideo? Video { get; init; }
|
||||
public EmbedProvider? Provider { get; init; }
|
||||
public EmbedAuthor? Author { get; init; }
|
||||
public Field[]? Fields { get; init; }
|
||||
public string? Title { get; init; }
|
||||
public string? Type { get; init; }
|
||||
public string? Description { get; init; }
|
||||
public string? Url { get; init; }
|
||||
public string? Timestamp { get; init; }
|
||||
public uint? Color { get; init; }
|
||||
public EmbedFooter? Footer { get; init; }
|
||||
public EmbedImage? Image { get; init; }
|
||||
public EmbedThumbnail? Thumbnail { get; init; }
|
||||
public EmbedVideo? Video { get; init; }
|
||||
public EmbedProvider? Provider { get; init; }
|
||||
public EmbedAuthor? Author { get; init; }
|
||||
public Field[]? Fields { get; init; }
|
||||
|
||||
public record EmbedFooter(
|
||||
string Text,
|
||||
string? IconUrl = null,
|
||||
string? ProxyIconUrl = null
|
||||
);
|
||||
public record EmbedFooter(
|
||||
string Text,
|
||||
string? IconUrl = null,
|
||||
string? ProxyIconUrl = null
|
||||
);
|
||||
|
||||
public record EmbedImage(
|
||||
string? Url,
|
||||
uint? Width = null,
|
||||
uint? Height = null
|
||||
);
|
||||
public record EmbedImage(
|
||||
string? Url,
|
||||
uint? Width = null,
|
||||
uint? Height = null
|
||||
);
|
||||
|
||||
public record EmbedThumbnail(
|
||||
string? Url,
|
||||
string? ProxyUrl = null,
|
||||
uint? Width = null,
|
||||
uint? Height = null
|
||||
);
|
||||
public record EmbedThumbnail(
|
||||
string? Url,
|
||||
string? ProxyUrl = null,
|
||||
uint? Width = null,
|
||||
uint? Height = null
|
||||
);
|
||||
|
||||
public record EmbedVideo(
|
||||
string? Url,
|
||||
uint? Width = null,
|
||||
uint? Height = null
|
||||
);
|
||||
public record EmbedVideo(
|
||||
string? Url,
|
||||
uint? Width = null,
|
||||
uint? Height = null
|
||||
);
|
||||
|
||||
public record EmbedProvider(
|
||||
string? Name,
|
||||
string? Url
|
||||
);
|
||||
public record EmbedProvider(
|
||||
string? Name,
|
||||
string? Url
|
||||
);
|
||||
|
||||
public record EmbedAuthor(
|
||||
string? Name = null,
|
||||
string? Url = null,
|
||||
string? IconUrl = null,
|
||||
string? ProxyIconUrl = null
|
||||
);
|
||||
public record EmbedAuthor(
|
||||
string? Name = null,
|
||||
string? Url = null,
|
||||
string? IconUrl = null,
|
||||
string? ProxyIconUrl = null
|
||||
);
|
||||
|
||||
public record Field(
|
||||
string Name,
|
||||
string Value,
|
||||
bool Inline = false
|
||||
);
|
||||
}
|
||||
public record Field(
|
||||
string Name,
|
||||
string Value,
|
||||
bool Inline = false
|
||||
);
|
||||
}
|
@@ -1,9 +1,8 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record Emoji
|
||||
{
|
||||
public record Emoji
|
||||
{
|
||||
public ulong? Id { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public bool? Animated { get; init; }
|
||||
}
|
||||
public ulong? Id { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public bool? Animated { get; init; }
|
||||
}
|
@@ -1,13 +1,12 @@
|
||||
namespace Myriad.Types
|
||||
{
|
||||
public record GatewayInfo
|
||||
{
|
||||
public string Url { get; init; }
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record Bot: GatewayInfo
|
||||
{
|
||||
public int Shards { get; init; }
|
||||
public SessionStartLimit SessionStartLimit { get; init; }
|
||||
}
|
||||
public record GatewayInfo
|
||||
{
|
||||
public string Url { get; init; }
|
||||
|
||||
public record Bot: GatewayInfo
|
||||
{
|
||||
public int Shards { get; init; }
|
||||
public SessionStartLimit SessionStartLimit { get; init; }
|
||||
}
|
||||
}
|
@@ -1,10 +1,9 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record SessionStartLimit
|
||||
{
|
||||
public record SessionStartLimit
|
||||
{
|
||||
public int Total { get; init; }
|
||||
public int Remaining { get; init; }
|
||||
public int ResetAfter { get; init; }
|
||||
public int MaxConcurrency { get; init; }
|
||||
}
|
||||
public int Total { get; init; }
|
||||
public int Remaining { get; init; }
|
||||
public int ResetAfter { get; init; }
|
||||
public int MaxConcurrency { get; init; }
|
||||
}
|
@@ -1,31 +1,30 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public enum PremiumTier
|
||||
{
|
||||
public enum PremiumTier
|
||||
{
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3,
|
||||
}
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3
|
||||
}
|
||||
|
||||
public record Guild
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public string Name { get; init; }
|
||||
public string? Icon { get; init; }
|
||||
public string? Splash { get; init; }
|
||||
public string? DiscoverySplash { get; init; }
|
||||
public bool? Owner { get; init; }
|
||||
public ulong OwnerId { get; init; }
|
||||
public string Region { get; init; }
|
||||
public ulong? AfkChannelId { get; init; }
|
||||
public int AfkTimeout { get; init; }
|
||||
public bool? WidgetEnabled { get; init; }
|
||||
public ulong? WidgetChannelId { get; init; }
|
||||
public int VerificationLevel { get; init; }
|
||||
public PremiumTier PremiumTier { get; init; }
|
||||
public record Guild
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public string Name { get; init; }
|
||||
public string? Icon { get; init; }
|
||||
public string? Splash { get; init; }
|
||||
public string? DiscoverySplash { get; init; }
|
||||
public bool? Owner { get; init; }
|
||||
public ulong OwnerId { get; init; }
|
||||
public string Region { get; init; }
|
||||
public ulong? AfkChannelId { get; init; }
|
||||
public int AfkTimeout { get; init; }
|
||||
public bool? WidgetEnabled { get; init; }
|
||||
public ulong? WidgetChannelId { get; init; }
|
||||
public int VerificationLevel { get; init; }
|
||||
public PremiumTier PremiumTier { get; init; }
|
||||
|
||||
public Role[] Roles { get; init; }
|
||||
public string[] Features { get; init; }
|
||||
}
|
||||
public Role[] Roles { get; init; }
|
||||
public string[] Features { get; init; }
|
||||
}
|
@@ -1,15 +1,14 @@
|
||||
namespace Myriad.Types
|
||||
{
|
||||
public record GuildMember: GuildMemberPartial
|
||||
{
|
||||
public User User { get; init; }
|
||||
}
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record GuildMemberPartial
|
||||
{
|
||||
public string? Avatar { get; init; }
|
||||
public string? Nick { get; init; }
|
||||
public ulong[] Roles { get; init; }
|
||||
public string JoinedAt { get; init; }
|
||||
}
|
||||
public record GuildMember: GuildMemberPartial
|
||||
{
|
||||
public User User { get; init; }
|
||||
}
|
||||
|
||||
public record GuildMemberPartial
|
||||
{
|
||||
public string? Avatar { get; init; }
|
||||
public string? Nick { get; init; }
|
||||
public ulong[] Roles { get; init; }
|
||||
public string JoinedAt { get; init; }
|
||||
}
|
@@ -1,90 +1,89 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using Myriad.Utils;
|
||||
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record Message
|
||||
{
|
||||
public record Message
|
||||
[Flags]
|
||||
public enum MessageFlags
|
||||
{
|
||||
[Flags]
|
||||
public enum MessageFlags
|
||||
{
|
||||
Crossposted = 1 << 0,
|
||||
IsCrosspost = 1 << 1,
|
||||
SuppressEmbeds = 1 << 2,
|
||||
SourceMessageDeleted = 1 << 3,
|
||||
Urgent = 1 << 4,
|
||||
Ephemeral = 1 << 6
|
||||
}
|
||||
Crossposted = 1 << 0,
|
||||
IsCrosspost = 1 << 1,
|
||||
SuppressEmbeds = 1 << 2,
|
||||
SourceMessageDeleted = 1 << 3,
|
||||
Urgent = 1 << 4,
|
||||
Ephemeral = 1 << 6
|
||||
}
|
||||
|
||||
public enum MessageType
|
||||
{
|
||||
Default = 0,
|
||||
RecipientAdd = 1,
|
||||
RecipientRemove = 2,
|
||||
Call = 3,
|
||||
ChannelNameChange = 4,
|
||||
ChannelIconChange = 5,
|
||||
ChannelPinnedMessage = 6,
|
||||
GuildMemberJoin = 7,
|
||||
UserPremiumGuildSubscription = 8,
|
||||
UserPremiumGuildSubscriptionTier1 = 9,
|
||||
UserPremiumGuildSubscriptionTier2 = 10,
|
||||
UserPremiumGuildSubscriptionTier3 = 11,
|
||||
ChannelFollowAdd = 12,
|
||||
GuildDiscoveryDisqualified = 14,
|
||||
GuildDiscoveryRequalified = 15,
|
||||
Reply = 19,
|
||||
ApplicationCommand = 20,
|
||||
ThreadStarterMessage = 21,
|
||||
GuildInviteReminder = 22
|
||||
}
|
||||
public enum MessageType
|
||||
{
|
||||
Default = 0,
|
||||
RecipientAdd = 1,
|
||||
RecipientRemove = 2,
|
||||
Call = 3,
|
||||
ChannelNameChange = 4,
|
||||
ChannelIconChange = 5,
|
||||
ChannelPinnedMessage = 6,
|
||||
GuildMemberJoin = 7,
|
||||
UserPremiumGuildSubscription = 8,
|
||||
UserPremiumGuildSubscriptionTier1 = 9,
|
||||
UserPremiumGuildSubscriptionTier2 = 10,
|
||||
UserPremiumGuildSubscriptionTier3 = 11,
|
||||
ChannelFollowAdd = 12,
|
||||
GuildDiscoveryDisqualified = 14,
|
||||
GuildDiscoveryRequalified = 15,
|
||||
Reply = 19,
|
||||
ApplicationCommand = 20,
|
||||
ThreadStarterMessage = 21,
|
||||
GuildInviteReminder = 22
|
||||
}
|
||||
|
||||
public ulong Id { get; init; }
|
||||
public ulong ChannelId { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public User Author { get; init; }
|
||||
public string? Content { get; init; }
|
||||
public string? Timestamp { get; init; }
|
||||
public string? EditedTimestamp { get; init; }
|
||||
public bool Tts { get; init; }
|
||||
public bool MentionEveryone { get; init; }
|
||||
public User.Extra[] Mentions { get; init; }
|
||||
public ulong[] MentionRoles { get; init; }
|
||||
|
||||
public Attachment[] Attachments { get; init; }
|
||||
public Embed[]? Embeds { get; init; }
|
||||
public Reaction[] Reactions { get; init; }
|
||||
public bool Pinned { get; init; }
|
||||
public ulong? WebhookId { get; init; }
|
||||
public MessageType Type { get; init; }
|
||||
public Reference? MessageReference { get; set; }
|
||||
public MessageFlags Flags { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Message?> ReferencedMessage { get; init; }
|
||||
|
||||
public MessageComponent[]? Components { get; init; }
|
||||
|
||||
public record Reference(ulong? GuildId, ulong? ChannelId, ulong? MessageId);
|
||||
|
||||
public record Attachment
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public ulong ChannelId { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public User Author { get; init; }
|
||||
public string? Content { get; init; }
|
||||
public string? Timestamp { get; init; }
|
||||
public string? EditedTimestamp { get; init; }
|
||||
public bool Tts { get; init; }
|
||||
public bool MentionEveryone { get; init; }
|
||||
public User.Extra[] Mentions { get; init; }
|
||||
public ulong[] MentionRoles { get; init; }
|
||||
public string? Description { get; init; }
|
||||
public string Filename { get; init; }
|
||||
public int Size { get; init; }
|
||||
public string Url { get; init; }
|
||||
public string ProxyUrl { get; init; }
|
||||
public int? Width { get; init; }
|
||||
public int? Height { get; init; }
|
||||
}
|
||||
|
||||
public Attachment[] Attachments { get; init; }
|
||||
public Embed[]? Embeds { get; init; }
|
||||
public Reaction[] Reactions { get; init; }
|
||||
public bool Pinned { get; init; }
|
||||
public ulong? WebhookId { get; init; }
|
||||
public MessageType Type { get; init; }
|
||||
public Reference? MessageReference { get; set; }
|
||||
public MessageFlags Flags { get; init; }
|
||||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Message?> ReferencedMessage { get; init; }
|
||||
public MessageComponent[]? Components { get; init; }
|
||||
|
||||
public record Reference(ulong? GuildId, ulong? ChannelId, ulong? MessageId);
|
||||
|
||||
public record Attachment
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public string? Description { get; init; }
|
||||
public string Filename { get; init; }
|
||||
public int Size { get; init; }
|
||||
public string Url { get; init; }
|
||||
public string ProxyUrl { get; init; }
|
||||
public int? Width { get; init; }
|
||||
public int? Height { get; init; }
|
||||
}
|
||||
|
||||
public record Reaction
|
||||
{
|
||||
public int Count { get; init; }
|
||||
public bool Me { get; init; }
|
||||
public Emoji Emoji { get; init; }
|
||||
}
|
||||
public record Reaction
|
||||
{
|
||||
public int Count { get; init; }
|
||||
public bool Me { get; init; }
|
||||
public Emoji Emoji { get; init; }
|
||||
}
|
||||
}
|
@@ -1,47 +1,44 @@
|
||||
using System;
|
||||
namespace Myriad.Types;
|
||||
|
||||
namespace Myriad.Types
|
||||
[Flags]
|
||||
public enum PermissionSet: ulong
|
||||
{
|
||||
[Flags]
|
||||
public enum PermissionSet: ulong
|
||||
{
|
||||
CreateInvite = 0x1,
|
||||
KickMembers = 0x2,
|
||||
BanMembers = 0x4,
|
||||
Administrator = 0x8,
|
||||
ManageChannels = 0x10,
|
||||
ManageGuild = 0x20,
|
||||
AddReactions = 0x40,
|
||||
ViewAuditLog = 0x80,
|
||||
PrioritySpeaker = 0x100,
|
||||
Stream = 0x200,
|
||||
ViewChannel = 0x400,
|
||||
SendMessages = 0x800,
|
||||
SendTtsMessages = 0x1000,
|
||||
ManageMessages = 0x2000,
|
||||
EmbedLinks = 0x4000,
|
||||
AttachFiles = 0x8000,
|
||||
ReadMessageHistory = 0x10000,
|
||||
MentionEveryone = 0x20000,
|
||||
UseExternalEmojis = 0x40000,
|
||||
ViewGuildInsights = 0x80000,
|
||||
Connect = 0x100000,
|
||||
Speak = 0x200000,
|
||||
MuteMembers = 0x400000,
|
||||
DeafenMembers = 0x800000,
|
||||
MoveMembers = 0x1000000,
|
||||
UseVad = 0x2000000,
|
||||
ChangeNickname = 0x4000000,
|
||||
ManageNicknames = 0x8000000,
|
||||
ManageRoles = 0x10000000,
|
||||
ManageWebhooks = 0x20000000,
|
||||
ManageEmojis = 0x40000000,
|
||||
CreateInvite = 0x1,
|
||||
KickMembers = 0x2,
|
||||
BanMembers = 0x4,
|
||||
Administrator = 0x8,
|
||||
ManageChannels = 0x10,
|
||||
ManageGuild = 0x20,
|
||||
AddReactions = 0x40,
|
||||
ViewAuditLog = 0x80,
|
||||
PrioritySpeaker = 0x100,
|
||||
Stream = 0x200,
|
||||
ViewChannel = 0x400,
|
||||
SendMessages = 0x800,
|
||||
SendTtsMessages = 0x1000,
|
||||
ManageMessages = 0x2000,
|
||||
EmbedLinks = 0x4000,
|
||||
AttachFiles = 0x8000,
|
||||
ReadMessageHistory = 0x10000,
|
||||
MentionEveryone = 0x20000,
|
||||
UseExternalEmojis = 0x40000,
|
||||
ViewGuildInsights = 0x80000,
|
||||
Connect = 0x100000,
|
||||
Speak = 0x200000,
|
||||
MuteMembers = 0x400000,
|
||||
DeafenMembers = 0x800000,
|
||||
MoveMembers = 0x1000000,
|
||||
UseVad = 0x2000000,
|
||||
ChangeNickname = 0x4000000,
|
||||
ManageNicknames = 0x8000000,
|
||||
ManageRoles = 0x10000000,
|
||||
ManageWebhooks = 0x20000000,
|
||||
ManageEmojis = 0x40000000,
|
||||
|
||||
// Special:
|
||||
None = 0,
|
||||
All = 0x7FFFFFFF,
|
||||
// Special:
|
||||
None = 0,
|
||||
All = 0x7FFFFFFF,
|
||||
|
||||
Dm = ViewChannel | SendMessages | ReadMessageHistory | AddReactions | AttachFiles | EmbedLinks |
|
||||
UseExternalEmojis | Connect | Speak | UseVad
|
||||
}
|
||||
Dm = ViewChannel | SendMessages | ReadMessageHistory | AddReactions | AttachFiles | EmbedLinks |
|
||||
UseExternalEmojis | Connect | Speak | UseVad
|
||||
}
|
@@ -1,14 +1,13 @@
|
||||
namespace Myriad.Types
|
||||
namespace Myriad.Types;
|
||||
|
||||
public record Role
|
||||
{
|
||||
public record Role
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public string Name { get; init; }
|
||||
public uint Color { get; init; }
|
||||
public bool Hoist { get; init; }
|
||||
public int Position { get; init; }
|
||||
public PermissionSet Permissions { get; init; }
|
||||
public bool Managed { get; init; }
|
||||
public bool Mentionable { get; init; }
|
||||
}
|
||||
public ulong Id { get; init; }
|
||||
public string Name { get; init; }
|
||||
public uint Color { get; init; }
|
||||
public bool Hoist { get; init; }
|
||||
public int Position { get; init; }
|
||||
public PermissionSet Permissions { get; init; }
|
||||
public bool Managed { get; init; }
|
||||
public bool Mentionable { get; init; }
|
||||
}
|
@@ -1,38 +1,35 @@
|
||||
using System;
|
||||
namespace Myriad.Types;
|
||||
|
||||
namespace Myriad.Types
|
||||
public record User
|
||||
{
|
||||
public record User
|
||||
[Flags]
|
||||
public enum Flags
|
||||
{
|
||||
[Flags]
|
||||
public enum Flags
|
||||
{
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
HypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HouseBravery = 1 << 6,
|
||||
HouseBrilliance = 1 << 7,
|
||||
HouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
System = 1 << 12,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17
|
||||
}
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
HypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HouseBravery = 1 << 6,
|
||||
HouseBrilliance = 1 << 7,
|
||||
HouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
System = 1 << 12,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17
|
||||
}
|
||||
|
||||
public ulong Id { get; init; }
|
||||
public string Username { get; init; }
|
||||
public string Discriminator { get; init; }
|
||||
public string? Avatar { get; init; }
|
||||
public bool Bot { get; init; }
|
||||
public bool? System { get; init; }
|
||||
public Flags PublicFlags { get; init; }
|
||||
public ulong Id { get; init; }
|
||||
public string Username { get; init; }
|
||||
public string Discriminator { get; init; }
|
||||
public string? Avatar { get; init; }
|
||||
public bool Bot { get; init; }
|
||||
public bool? System { get; init; }
|
||||
public Flags PublicFlags { get; init; }
|
||||
|
||||
public record Extra: User
|
||||
{
|
||||
public GuildMemberPartial? Member { get; init; }
|
||||
}
|
||||
public record Extra: User
|
||||
{
|
||||
public GuildMemberPartial? Member { get; init; }
|
||||
}
|
||||
}
|
@@ -1,21 +1,20 @@
|
||||
namespace Myriad.Types
|
||||
{
|
||||
public record Webhook
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public WebhookType Type { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public ulong ChannelId { get; init; }
|
||||
public User? User { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public string? Avatar { get; init; }
|
||||
public string? Token { get; init; }
|
||||
public ulong? ApplicationId { get; init; }
|
||||
}
|
||||
namespace Myriad.Types;
|
||||
|
||||
public enum WebhookType
|
||||
{
|
||||
Incoming = 1,
|
||||
ChannelFollower = 2
|
||||
}
|
||||
public record Webhook
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public WebhookType Type { get; init; }
|
||||
public ulong? GuildId { get; init; }
|
||||
public ulong ChannelId { get; init; }
|
||||
public User? User { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public string? Avatar { get; init; }
|
||||
public string? Token { get; init; }
|
||||
public ulong? ApplicationId { get; init; }
|
||||
}
|
||||
|
||||
public enum WebhookType
|
||||
{
|
||||
Incoming = 1,
|
||||
ChannelFollower = 2
|
||||
}
|
Reference in New Issue
Block a user