mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
feat(bot): add support for Discord message context commands (#513)
This commit is contained in:
parent
13c055dc0f
commit
83af1f04a7
23 changed files with 515 additions and 30 deletions
|
|
@ -0,0 +1,19 @@
|
|||
using ApplicationCommandType = Myriad.Types.ApplicationCommand.ApplicationCommandType;
|
||||
using InteractionType = Myriad.Types.Interaction.InteractionType;
|
||||
|
||||
namespace PluralKit.Bot;
|
||||
|
||||
public partial class ApplicationCommandTree
|
||||
{
|
||||
public Task TryHandleCommand(InteractionContext ctx)
|
||||
{
|
||||
if (ctx.Event.Data!.Name == ProxiedMessageQuery.Name)
|
||||
return ctx.Execute<ApplicationCommandProxiedMessage>(ProxiedMessageQuery, m => m.QueryMessage(ctx));
|
||||
else if (ctx.Event.Data!.Name == ProxiedMessageDelete.Name)
|
||||
return ctx.Execute<ApplicationCommandProxiedMessage>(ProxiedMessageDelete, m => m.DeleteMessage(ctx));
|
||||
else if (ctx.Event.Data!.Name == ProxiedMessagePing.Name)
|
||||
return ctx.Execute<ApplicationCommandProxiedMessage>(ProxiedMessageDelete, m => m.PingMessageAuthor(ctx));
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue