diff --git a/src/modules/vordinace.ts b/src/modules/vordinace.ts index cc9c7ae..ad9d84c 100644 --- a/src/modules/vordinace.ts +++ b/src/modules/vordinace.ts @@ -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, 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 `, 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); }