komand aliasy added
This commit is contained in:
parent
542130d9a3
commit
0c5f39d981
@ -2,6 +2,7 @@ import { CClient, HelpServer, Komand, KomandNaExport, Modul, SRecord } from "../
|
|||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { existsSync, readFileSync, writeFileSync } from "fs";
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
||||||
import { oddiakritikovat, prefix } from "../utils/utils";
|
import { oddiakritikovat, prefix } from "../utils/utils";
|
||||||
|
import { APIEmbed } from "discord.js";
|
||||||
|
|
||||||
let client: CClient;
|
let client: CClient;
|
||||||
const cesta = `${join(__dirname, "../../res/")}custom`;
|
const cesta = `${join(__dirname, "../../res/")}custom`;
|
||||||
@ -251,6 +252,26 @@ const exp: Modul = {
|
|||||||
save();
|
save();
|
||||||
return "jo";
|
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] };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user