another funny update

This commit is contained in:
Histmy 2022-02-20 15:05:48 +01:00
parent fb43e2a906
commit 443d591467

View File

@ -2,6 +2,7 @@ import { EventEmitter } from "events";
import { KomandNaExport, Komand, RunFunkce, SRecord } from "./types";
import { readFileSync, writeFileSync } from "fs";
import { join } from "path";
import { oddiakritikovat } from "./utils";
const cesta = join(__dirname, "../../res/komandi.json");
const komandi: SRecord<{ text: string; owner: string; }> = JSON.parse(readFileSync(cesta).toString());
@ -32,7 +33,7 @@ export const naucse: RunFunkce = (mes, arg) => {
if (module.exports.realKomandy[args[0]] || komandi[args[0]]) return "tuten komand uz ale egzistuje";
if (!args.length) return "a co se mam jako naucit";
if (arg.length == 1) return "a co bich nato mnel rict????";
komandi[args[0].toLowerCase()] = { text: args.splice(1).join(" "), owner: mes.author.id };
komandi[oddiakritikovat(args[0].toLowerCase())] = { text: args.splice(1).join(" "), owner: mes.author.id };
save();
return "jo";
};