mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
26 lines
697 B
C#
26 lines
697 B
C#
namespace NadekoBot.Common;
|
|
|
|
public abstract class NInteraction
|
|
{
|
|
private readonly DiscordSocketClient _client;
|
|
private readonly ulong _userId;
|
|
private readonly Func<SocketMessageComponent, Task> _action;
|
|
|
|
protected abstract NadekoInteractionData Data { get; }
|
|
|
|
public NInteraction(
|
|
DiscordSocketClient client,
|
|
ulong userId,
|
|
Func<SocketMessageComponent, Task> action)
|
|
{
|
|
_client = client;
|
|
_userId = userId;
|
|
_action = action;
|
|
}
|
|
|
|
public NadekoButtonInteraction GetInteraction()
|
|
=> new NadekoInteractionBuilder()
|
|
.WithData(Data)
|
|
.WithAction(_action)
|
|
.Build(_client, _userId);
|
|
} |