2021-05-30 14:45:29 +00:00
|
|
|
using System;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using Myriad.Types;
|
|
|
|
|
|
|
|
namespace PluralKit.Bot.Interactive
|
|
|
|
{
|
|
|
|
public class Button
|
|
|
|
{
|
|
|
|
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; }
|
|
|
|
|
|
|
|
public MessageComponent ToMessageComponent() => new()
|
|
|
|
{
|
2021-08-27 15:03:47 +00:00
|
|
|
Type = ComponentType.Button,
|
|
|
|
Label = Label,
|
|
|
|
Style = Style,
|
2021-05-30 14:45:29 +00:00
|
|
|
CustomId = CustomId,
|
|
|
|
Disabled = Disabled
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|