feat(bot): ComponentsV2 system/member/group cards
Some checks are pending
Build and push Docker image / .net docker build (push) Waiting to run
.net checks / run .net tests (push) Waiting to run
.net checks / dotnet-format (push) Waiting to run
Build and push Rust service Docker images / rust docker build (push) Waiting to run
rust checks / cargo fmt (push) Waiting to run

This commit is contained in:
Iris System 2025-09-07 10:16:50 +12:00
parent 695d1debf2
commit fbf51b41c1
20 changed files with 600 additions and 18 deletions

View file

@ -9,6 +9,7 @@ public record MessageRequest
public bool Tts { get; set; }
public AllowedMentions? AllowedMentions { get; set; }
public Embed[]? Embeds { get; set; }
public Message.MessageFlags Flags { get; set; }
public MessageComponent[]? Components { get; set; }
public Message.Reference? MessageReference { get; set; }
}

View file

@ -0,0 +1,13 @@
namespace Myriad.Types;
public record ComponentMedia
{
public string? Url { get; init; }
}
public record ComponentMediaItem
{
public ComponentMedia Media { get; init; }
public string? Description { get; init; }
public bool Spoiler { get; init; } = false;
}

View file

@ -3,5 +3,12 @@ namespace Myriad.Types;
public enum ComponentType
{
ActionRow = 1,
Button = 2
Button = 2,
StringSelect = 3,
Section = 9,
Text = 10,
Thumbnail = 11,
MediaGallery = 12,
Separator = 14,
Container = 17,
}

View file

@ -5,9 +5,15 @@ public record MessageComponent
public ComponentType Type { get; init; }
public ButtonStyle? Style { get; set; }
public string? Label { get; init; }
public string? Content { get; init; }
public Emoji? Emoji { get; init; }
public string? CustomId { get; init; }
public string? Url { get; init; }
public bool? Disabled { get; init; }
public uint? AccentColor { get; init; }
public ComponentMedia? Media { get; init; }
public ComponentMediaItem[]? Items { get; init; }
public MessageComponent? Accessory { get; init; }
public MessageComponent[]? Components { get; init; }
}

View file

@ -17,6 +17,7 @@ public record Message
Ephemeral = 1 << 6,
SuppressNotifications = 1 << 12,
VoiceMessage = 1 << 13,
IsComponentsV2 = 1 << 15,
}
public enum MessageType
@ -73,8 +74,6 @@ public record Message
public MessagePoll? Poll { get; init; }
// public MessageComponent[]? Components { get; init; }
public record Reference(ulong? GuildId, ulong? ChannelId, ulong? MessageId);
public record MessageActivity(int Type, string PartyId);