asi lepsi guard na forceování
This commit is contained in:
parent
3173a42b92
commit
2b3dd99811
@ -14,6 +14,8 @@ let clientId: string | undefined = undefined;
|
|||||||
let sessionId: string | undefined = undefined;
|
let sessionId: string | undefined = undefined;
|
||||||
let serverId: string | undefined = undefined;
|
let serverId: string | undefined = undefined;
|
||||||
|
|
||||||
|
let canForceNotify = true;
|
||||||
|
|
||||||
function createOneplayBody(payload: Record<string, any>, customData: string) {
|
function createOneplayBody(payload: Record<string, any>, customData: string) {
|
||||||
|
|
||||||
if (typeof clientId == "undefined" || typeof sessionId == "undefined" || typeof serverId == "undefined") {
|
if (typeof clientId == "undefined" || typeof sessionId == "undefined" || typeof serverId == "undefined") {
|
||||||
@ -179,6 +181,8 @@ async function naplanovat() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function urobit() {
|
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");
|
const guilda = client.guilds.cache.get("555779161067749446");
|
||||||
|
|
||||||
if (!guilda) return log(new Error("dobytcarna nenalezena"));
|
if (!guilda) return log(new Error("dobytcarna nenalezena"));
|
||||||
@ -210,6 +214,8 @@ async function urobit() {
|
|||||||
|
|
||||||
general.send(`<@&1123186280843444274> ${event.url}`);
|
general.send(`<@&1123186280843444274> ${event.url}`);
|
||||||
|
|
||||||
|
canForceNotify = false;
|
||||||
|
|
||||||
naplanovat();
|
naplanovat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,8 +224,11 @@ const exp: Modul = {
|
|||||||
dalsiordinacka: () => `dalsi ordnacka <t:${Math.ceil((Date.now() - 414000000) / 604800000) * 604800 + 414000}:R>`,
|
dalsiordinacka: () => `dalsi ordnacka <t:${Math.ceil((Date.now() - 414000000) / 604800000) * 604800 + 414000}:R>`,
|
||||||
|
|
||||||
vynutitordinaceoznameni: {
|
vynutitordinaceoznameni: {
|
||||||
cd: 6 * 24 * 60 * 60 * 1000, // 6 dní
|
|
||||||
run: async mes => {
|
run: async mes => {
|
||||||
|
if (!canForceNotify) {
|
||||||
|
return "uz ne tyy mrtko";
|
||||||
|
}
|
||||||
|
|
||||||
await urobit();
|
await urobit();
|
||||||
mes.react(emouty.d3k);
|
mes.react(emouty.d3k);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user