komand "coje" vypisuje i funkce

This commit is contained in:
Histmy 2024-08-21 00:45:02 +02:00
parent 8ba97b397d
commit a65542aa88
Signed by: Histmy
GPG Key ID: AC2E43C463D8F329
3 changed files with 16 additions and 48 deletions

45
package-lock.json generated
View File

@ -17,8 +17,7 @@
"play-dl": "https://gitea.deadfish.cz/Histmy/play-dl-fix/archive/main.tar.gz",
"tiny-typed-emitter": "^2.1.0",
"tweetnacl": "^1.0.3",
"valibot": "^0.35.0",
"ytdl-core": "^4.11.5"
"valibot": "^0.35.0"
},
"devDependencies": {
"@types/js-levenshtein": "^1.1.3",
@ -355,34 +354,12 @@
"resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
"integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="
},
"node_modules/m3u8stream": {
"version": "0.8.6",
"resolved": "https://registry.npmjs.org/m3u8stream/-/m3u8stream-0.8.6.tgz",
"integrity": "sha512-LZj8kIVf9KCphiHmH7sbFQTVe4tOemb202fWwvJwR9W5ENW/1hxJN6ksAWGhQgSBSa3jyWhnjKU1Fw1GaOdbyA==",
"license": "MIT",
"dependencies": {
"miniget": "^4.2.2",
"sax": "^1.2.4"
},
"engines": {
"node": ">=12"
}
},
"node_modules/magic-bytes.js": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz",
"integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==",
"license": "MIT"
},
"node_modules/miniget": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/miniget/-/miniget-4.2.3.tgz",
"integrity": "sha512-SjbDPDICJ1zT+ZvQwK0hUcRY4wxlhhNpHL9nJOB2MEAXRGagTljsO8MEDzQMTFf0Q8g4QNi8P9lEm/g7e+qgzA==",
"license": "MIT",
"engines": {
"node": ">=12"
}
},
"node_modules/mysql": {
"version": "2.18.1",
"resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz",
@ -444,12 +421,6 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"node_modules/sax": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
"integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
"license": "ISC"
},
"node_modules/sqlstring": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz",
@ -527,20 +498,6 @@
"optional": true
}
}
},
"node_modules/ytdl-core": {
"version": "4.11.5",
"resolved": "https://registry.npmjs.org/ytdl-core/-/ytdl-core-4.11.5.tgz",
"integrity": "sha512-27LwsW4n4nyNviRCO1hmr8Wr5J1wLLMawHCQvH8Fk0hiRqrxuIu028WzbJetiYH28K8XDbeinYW4/wcHQD1EXA==",
"license": "MIT",
"dependencies": {
"m3u8stream": "^0.8.6",
"miniget": "^4.2.2",
"sax": "^1.1.3"
},
"engines": {
"node": ">=12"
}
}
}
}

View File

@ -21,8 +21,7 @@
"play-dl": "https://gitea.deadfish.cz/Histmy/play-dl-fix/archive/main.tar.gz",
"tiny-typed-emitter": "^2.1.0",
"tweetnacl": "^1.0.3",
"valibot": "^0.35.0",
"ytdl-core": "^4.11.5"
"valibot": "^0.35.0"
},
"devDependencies": {
"@types/js-levenshtein": "^1.1.3",

View File

@ -269,8 +269,20 @@ const exp: Modul = {
// Vestavěnej komand
const vZakladni = zakladniKomandy[nazev]?.run;
if (typeof vZakladni == "function")
return "tuto je slozitej kmenovej koamnd";
if (typeof vZakladni == "function") {
let telo = vZakladni.toString();
const odsazeni = /^( +)/m.exec(telo);
if (odsazeni)
telo = telo.replace(new RegExp(`^ \{${odsazeni[1].length - 4}\}`, "gm"), "");
telo = telo.replace(/```/g, "`\u200b``");
if (telo.length > 2000 - 42) {
telo = telo.slice(0, 2000 - 43) + "…";
}
return "tuto je kmenovej koamnd a dela:\n```js\n" + telo + "\u200b```";
}
if (typeof vZakladni == "string")
return `tuto je kmenovej koamnd a povida "${vZakladni}"`;