Files
flint/apps/bot/src/legacy/modules/help/command.ts
T
Puechberty Arthur 3063796eb0 feat: introduce web dashboard with multi-bot management
- add Discord OAuth2 authentication
- allow users to register their bots via token
- implement dynamic bot start/stop system
- store bots in database (multi-tenant)
- replace single-bot env setup with scalable architecture
2026-04-18 01:39:12 +02:00

47 lines
1.1 KiB
TypeScript

import { defineCommand } from "../../core/commands/defineCommand.js";
import {
createCommandDetailsEmbed,
createGlobalHelpEmbed,
resolveCommandFromQuery,
} from "./service.js";
export const helpCommand = defineCommand({
meta: {
name: "help",
category: "core",
},
args: [
{
name: "command",
type: "string",
required: false,
descriptionKey: "args.command",
},
],
examples: [
{
descriptionKey: "examples.basic",
},
{
args: "<command>",
descriptionKey: "examples.single",
},
],
execute: async (ctx) => {
const queryArg = ctx.args.command;
if (typeof queryArg === "string" && queryArg.trim().length > 0) {
const command = resolveCommandFromQuery(ctx, queryArg.trim());
if (!command) {
await ctx.reply(ctx.ct("errors.notFound", { query: queryArg }));
return;
}
await ctx.reply({ embeds: [createCommandDetailsEmbed(ctx, command)] });
return;
}
await ctx.reply({ embeds: [createGlobalHelpEmbed(ctx, helpCommand)] });
},
});