import { Client, TextChannel } from "discord.js"; import fetch from "node-fetch"; import { emouty } from "../utils/emotes"; import { Modul } from "../utils/types"; import { log } from "../utils/utils"; let posledniDatum = ""; let client: Client; function naplanovat(): void; function naplanovat(jesteNeska: true): void; function naplanovat(jesteNeska?: true) { const novyCas = new Date(); const den = novyCas.getDay(); if (jesteNeska && den == 4) return hendelieren(); novyCas.setDate(novyCas.getDate() + ((den < 4 ? 4 : 11) - den)); novyCas.setHours(15); novyCas.setMinutes(0); setTimeout(hendelieren, Number(novyCas) - Number(new Date())); } const padNula = (n: number) => n > 9 ? n : `0${n}`; function hendelieren() { const base = "https://sktorrent.eu/torrent/"; fetch(`${base}torrents_v2.php?search=ordinace`) .then(r => r.text()) .then(txt => { const tabule = txt.match(/