Add basic interactivity framework

This commit is contained in:
Ske
2021-05-30 16:45:29 +02:00
parent b894a9f86e
commit 4bd2d06b0b
12 changed files with 245 additions and 27 deletions

View File

@@ -0,0 +1,25 @@
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()
{
Type = ComponentType.Button,
Label = Label,
Style = Style,
CustomId = CustomId,
Disabled = Disabled
};
}
}