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:
parent
6f2ade3031
commit
8a62a427da
19 changed files with 657 additions and 152 deletions
25
backend/src/plugins/ContextMenus/helpers.ts
Normal file
25
backend/src/plugins/ContextMenus/helpers.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue