new vordinačka link should now works

This commit is contained in:
Histmy 2022-08-25 16:41:03 +02:00
parent df890b136b
commit 3af5607c1b
3 changed files with 7 additions and 6 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "denim_3001",
"version": "3001.41.0",
"version": "3001.41.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "denim_3001",
"version": "3001.41.0",
"version": "3001.41.1",
"license": "ISC",
"dependencies": {
"@discordjs/voice": "^0.11.0",

View File

@ -1,6 +1,6 @@
{
"name": "denim_3001",
"version": "3001.41.0",
"version": "3001.41.1",
"description": "Toto je velmi kvalitní bot.",
"repository": {
"url": "https://github.com/Histmy/Denim-Bot/"

View File

@ -23,13 +23,14 @@ function naplanovat(jesteNeska?: true) {
const padNula = (n: number) => n > 9 ? n : `0${n}`;
function hendelieren() {
fetch("https://sktorrent.eu/torrent/torrents_v2.php?search=ordinace")
const base = "https://sktorrent.eu/torrent/";
fetch(`${base}torrents_v2.php?search=ordinace`)
.then(r => r.text())
.then(txt => {
const tabule = txt.match(/<table width="100%" class="lista">(?<kontent>.+)<\/table>/is);
if (!tabule) return console.log("nenašel jsem tabuleho");
const detaily = tabule.groups!.kontent.match(/<a href="(?<odkaz>details.+?)".+?Pridany (?<datum>\d\d\/\d\d\/\d{4})/is);
const detaily = tabule.groups!.kontent.match(/<a href="d.+?&(?<odkaz>id=.+?)".+?Pridany (?<datum>\d\d\/\d\d\/\d{4})/is);
const datum = detaily!.groups!.datum;
if (posledniDatum == "") {
@ -44,7 +45,7 @@ function hendelieren() {
if (posledniDatum == datum) return setTimeout(hendelieren, 18e4);
(client.channels.cache.get("555779161067749448") as TextChannel).send(`<@&591306633196339261> vyšla nová vordinačka ${emouty.lajk}\nhttps://sktorrent.eu/${detaily?.groups?.odkaz}`);
(client.channels.cache.get("555779161067749448") as TextChannel).send(`<@&591306633196339261> vyšla nová vordinačka ${emouty.lajk}\n${base}download.php?${detaily?.groups?.odkaz}`);
naplanovat();
return;
});