import { RequireNonBot } from "@/decorators/guards"; import { Module } from "@/base/ModuleBase"; import { Command } from "@/decorators/command"; import type { BotContext, ParsedArgs } from "@/types"; import type { Message } from "@fluxerjs/core"; import { arg } from "@/args"; import { z } from "zod"; // Types const echoArgs = { content: arg.restRequired(z.string().min(1).max(2000)), } as const; // Module @Module({ name: "misc", description: "Miscellaneous commands", guards: [RequireNonBot()], }) export class MiscCommands { @Command({ name: "echo", description: "Echoes the provided content", args: echoArgs, }) async echo(_ctx: BotContext, message: Message, args: ParsedArgs): Promise { await message.channel?.send({ content: args.content }); } @Command({ name: "ping", description: "Pings the bot", }) async ping(_ctx: BotContext, message: Message): Promise { await message.channel?.send({ content: "Pong!" }); } }