mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 09:10:14 +00:00
Add preliminary support for buttons
This commit is contained in:
parent
0b91e71384
commit
d7c0592947
11 changed files with 217 additions and 7 deletions
|
|
@ -9,5 +9,6 @@ namespace Myriad.Rest.Types.Requests
|
|||
public bool Tts { get; set; }
|
||||
public AllowedMentions? AllowedMentions { get; set; }
|
||||
public Embed? Embed { get; set; }
|
||||
public MessageComponent[]? Components { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,10 @@
|
|||
{
|
||||
public record ApplicationCommandInteractionData
|
||||
{
|
||||
public ulong Id { get; init; }
|
||||
public string Name { get; init; }
|
||||
public ApplicationCommandInteractionDataOption[] Options { get; init; }
|
||||
public ulong? Id { get; init; }
|
||||
public string? Name { get; init; }
|
||||
public ApplicationCommandInteractionDataOption[]? Options { get; init; }
|
||||
public string? CustomId { get; init; }
|
||||
public MessageComponent.ComponentType? ComponentType { get; init; }
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,8 @@
|
|||
public enum InteractionType
|
||||
{
|
||||
Ping = 1,
|
||||
ApplicationCommand = 2
|
||||
ApplicationCommand = 2,
|
||||
MessageComponent = 3
|
||||
}
|
||||
|
||||
public ulong Id { get; init; }
|
||||
|
|
@ -15,5 +16,6 @@
|
|||
public ulong ChannelId { get; init; }
|
||||
public GuildMember Member { get; init; }
|
||||
public string Token { get; init; }
|
||||
public Message? Message { get; init; }
|
||||
}
|
||||
}
|
||||
|
|
@ -5,10 +5,10 @@
|
|||
public enum ResponseType
|
||||
{
|
||||
Pong = 1,
|
||||
Acknowledge = 2,
|
||||
ChannelMessage = 3,
|
||||
ChannelMessageWithSource = 4,
|
||||
AckWithSource = 5
|
||||
DeferredChannelMessageWithSource = 5,
|
||||
DeferredUpdateMessage = 6,
|
||||
UpdateMessage = 7
|
||||
}
|
||||
|
||||
public ResponseType Type { get; init; }
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ namespace Myriad.Types
|
|||
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public Optional<Message?> ReferencedMessage { get; init; }
|
||||
public MessageComponent[]? Components { get; init; }
|
||||
|
||||
public record Reference(ulong? GuildId, ulong? ChannelId, ulong? MessageId);
|
||||
|
||||
|
|
|
|||
29
Myriad/Types/MessageComponent.cs
Normal file
29
Myriad/Types/MessageComponent.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
namespace Myriad.Types
|
||||
{
|
||||
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 enum ComponentType
|
||||
{
|
||||
ActionRow = 1,
|
||||
Button = 2
|
||||
}
|
||||
|
||||
public enum ButtonStyle
|
||||
{
|
||||
Primary = 1,
|
||||
Secondary = 2,
|
||||
Success = 3,
|
||||
Danger = 4,
|
||||
Link = 5
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue