mirror of
https://github.com/arthur-pbty/flint.git
synced 2026-08-01 20:29:03 +02:00
- 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
47 lines
1.1 KiB
TypeScript
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)] });
|
|
},
|
|
});
|