remove bloat

This commit is contained in:
jjj333_p 2023-10-29 14:43:38 -04:00
parent 472206143b
commit 4aa04ceda2

View file

@ -5,7 +5,7 @@ import fs from "fs";
const storage = new SimpleFsStorageProvider("storage.json");
const client = new MatrixClient(config.homeserver, config.token, storage);
let lastUpdate, timeoutExists, data;
let data;
const error1 = setTimeout(function () {
console.log("\x1b[41m", "ERROR: UNABLE TO CONNECT TO MATRIX SERVER");
@ -54,15 +54,6 @@ const addCount = async (roomId, message) => {
if (data.count[message["sender"]] > data.max.count) {
data.max.count++;
data.max.username = message["sender"];
if (lastUpdate + 5000 < Date.now()) {
lastUpdate = Date.now();
} else if (!timeoutExists) {
setTimeout(() => {
lastUpdate = Date.now();
timeoutExists = false;
}, lastUpdate + 5000 - Date.now());
timeoutExists = true;
}
}
};
@ -71,8 +62,6 @@ client.start().then(() => {
clearTimeout(error1);
// console.log(`Logged into ${client.guilds.cache.size} rooms`); // ? this is possible i think idk how tho
data = readFromCache();
lastUpdate = Date.now();
timeoutExists = false;
});
client.on("room.message", (roomId, event) => {