asi lepsi guard na forceování

This commit is contained in:
Histmy 2025-06-23 14:13:05 +02:00
parent 3173a42b92
commit 2b3dd99811
Signed by: Histmy
GPG Key ID: AC2E43C463D8F329

View File

@ -14,6 +14,8 @@ let clientId: string | undefined = undefined;
let sessionId: string | undefined = undefined;
let serverId: string | undefined = undefined;
let canForceNotify = true;
function createOneplayBody(payload: Record<string, any>, customData: string) {
if (typeof clientId == "undefined" || typeof sessionId == "undefined" || typeof serverId == "undefined") {
@ -179,6 +181,8 @@ async function naplanovat() {
}
async function urobit() {
canForceNotify = true; // Hádám, kdyby se to nějak nepovedlo a bot nespadnul, aby se to dalo znovu spustit
const guilda = client.guilds.cache.get("555779161067749446");
if (!guilda) return log(new Error("dobytcarna nenalezena"));
@ -210,6 +214,8 @@ async function urobit() {
general.send(`<@&1123186280843444274> ${event.url}`);
canForceNotify = false;
naplanovat();
}
@ -218,8 +224,11 @@ const exp: Modul = {
dalsiordinacka: () => `dalsi ordnacka <t:${Math.ceil((Date.now() - 414000000) / 604800000) * 604800 + 414000}:R>`,
vynutitordinaceoznameni: {
cd: 6 * 24 * 60 * 60 * 1000, // 6 dní
run: async mes => {
if (!canForceNotify) {
return "uz ne tyy mrtko";
}
await urobit();
mes.react(emouty.d3k);
}