bot will not die on dead stat

This commit is contained in:
Histmy 2022-02-18 17:43:18 +01:00
parent 5cf07fc9c2
commit 30a6f78103

View File

@ -2,6 +2,7 @@
import { Client, Guild, Presence, User } from "discord.js"; import { Client, Guild, Presence, User } from "discord.js";
import fetch from "node-fetch"; import fetch from "node-fetch";
import { FakePresence, Modul, SRecord, StatusyINaFounu, UserChange, ZmenovejObjekt } from "../utils/types"; import { FakePresence, Modul, SRecord, StatusyINaFounu, UserChange, ZmenovejObjekt } from "../utils/types";
import { adminLog } from "../utils/utils";
const role = { online: "Online", idle: "Idle", dnd: "DND", offline: "Offline" }; const role = { online: "Online", idle: "Idle", dnd: "DND", offline: "Offline" };
const statusy = { Offline: "0", Online: "1", Idle: "2", DND: "3", OnlinePhone: "11", IdlePhone: "12", DNDPhone: "13" }; const statusy = { Offline: "0", Online: "1", Idle: "2", DND: "3", OnlinePhone: "11", IdlePhone: "12", DNDPhone: "13" };
@ -26,7 +27,12 @@ const prepSend = (zmeny: UserChange[]) => {
const poslatData = (data: SRecord<any>) => { const poslatData = (data: SRecord<any>) => {
data.pwd = process.env.statPass; data.pwd = process.env.statPass;
fetch("http://deadfish.cz:4629/endpoint-pro-denimka/", { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) }); fetch("http://deadfish.cz:4629/endpoint-pro-denimka/", { method: "POST", headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data) })
.catch(err => {
console.log("err:", err);
const client: Client<boolean> = module.exports.client;
adminLog(client, "stat nejede");
});
}; };
const statusOnFoun = (bef: FakePresence | null, aft: FakePresence) => { const statusOnFoun = (bef: FakePresence | null, aft: FakePresence) => {