diff --git a/src/modules/custom.ts b/src/modules/custom.ts index 6cc37c7..01d5906 100644 --- a/src/modules/custom.ts +++ b/src/modules/custom.ts @@ -2,6 +2,7 @@ import { CClient, HelpServer, Komand, KomandNaExport, Modul, SRecord } from "../ import { join } from "path"; import { existsSync, readFileSync, writeFileSync } from "fs"; import { oddiakritikovat, prefix } from "../utils/utils"; +import { APIEmbed } from "discord.js"; let client: CClient; const cesta = `${join(__dirname, "../../res/")}custom`; @@ -251,6 +252,26 @@ const exp: Modul = { save(); return "jo"; } + }, + + aliasy: (_, arg) => { + const name = arg.toLowerCase(); + const cmdName = client.aliasy[name] ?? name; + + const list: string[] = []; + for (const key in client.aliasy) { + const val = client.aliasy[key]; + if (val == cmdName) list.push(key); + } + + if (!list.length) return `"${name}" bud nen9 komand ani ajilas nebo nema ajilasi vubec`; + + const embed: APIEmbed = { + color: 13697024, + fields: [{ name: `alijasy pro **${cmdName}**:`, value: `• ${list.join("\n• ")}` }] + }; + + return { embeds: [embed] }; } },