2021-05-30 14:45:29 +00:00
|
|
|
using Myriad.Types;
|
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
namespace PluralKit.Bot.Interactive;
|
|
|
|
|
|
|
|
public class Button
|
2021-05-30 14:45:29 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
public string? Label { get; set; }
|
|
|
|
public ButtonStyle Style { get; set; } = ButtonStyle.Secondary;
|
|
|
|
public string? CustomId { get; set; }
|
|
|
|
public bool Disabled { get; set; }
|
|
|
|
public Func<InteractionContext, Task> Handler { get; init; }
|
2021-05-30 14:45:29 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public MessageComponent ToMessageComponent() => new()
|
|
|
|
{
|
|
|
|
Type = ComponentType.Button,
|
|
|
|
Label = Label,
|
|
|
|
Style = Style,
|
|
|
|
CustomId = CustomId,
|
|
|
|
Disabled = Disabled
|
|
|
|
};
|
2021-05-30 14:45:29 +00:00
|
|
|
}
|