3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

Context Menu Actions v1, clean and mute support with full options

This commit is contained in:
Dark 2021-08-13 05:01:08 +02:00
parent 6f2ade3031
commit 8a62a427da
19 changed files with 657 additions and 152 deletions

View file

@ -0,0 +1,25 @@
import { ContextMenuInteraction } from "discord.js";
import * as t from "io-ts";
import { GuildPluginData } from "../../../../../Knub/dist";
import { Awaitable } from "../../../../../Knub/dist/utils";
import { ContextMenuPluginType } from "./types";
type ContextActionApplyFn<TConfigType> = (meta: {
actionName: string;
pluginData: GuildPluginData<ContextMenuPluginType>;
actionConfig: TConfigType;
interaction: ContextMenuInteraction;
}) => Awaitable<void>;
export interface ContextActionBlueprint<TConfigType extends t.Any> {
configType: TConfigType;
defaultConfig: Partial<t.TypeOf<TConfigType>>;
apply: ContextActionApplyFn<t.TypeOf<TConfigType>>;
}
export function contextMenuAction<TConfigType extends t.Any>(
blueprint: ContextActionBlueprint<TConfigType>,
): ContextActionBlueprint<TConfigType> {
return blueprint;
}