mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-05 13:27:54 +00:00
Add basic interactivity framework
This commit is contained in:
parent
b894a9f86e
commit
4bd2d06b0b
12 changed files with 245 additions and 27 deletions
25
PluralKit.Bot/Interactive/Button.cs
Normal file
25
PluralKit.Bot/Interactive/Button.cs
Normal 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
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue