Something went wrong. Try again.
Yet another Fluxer bot built with TypeScript and Bun
Something went wrong. Try again.
TypeScript
1234567891011121314151617181920212223242526272829303132import "reflect-metadata";import { Message } from "@fluxerjs/core";import type { ArgSchema } from "@/args";
export interface ModuleMeta { name: string; description?: string;}
export const MODULE_META_KEY = Symbol("fluxer:module");export const MODULE_COMMANDS_KEY = Symbol("fluxer:module-commands");
export interface CommandMethodMeta { name: string; aliases?: string[]; description: string; args?: ArgSchema;}
export interface ModuleCommand { methodName: string; meta: CommandMethodMeta;}
export type Guard = (msg: Message) => boolean | Promise<boolean>;
export function Module(meta: ModuleMeta & { guards?: Guard[] }): ClassDecorator { return (target) => { Reflect.defineMetadata(MODULE_META_KEY, meta, target); };}