From b8e81b4248acaf89d96034a55641b091a01f0178 Mon Sep 17 00:00:00 2001 From: The-Foxon Date: Fri, 14 Jul 2023 00:33:27 +1200 Subject: [PATCH] fix small error --- src/controller/ChatController.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controller/ChatController.ts b/src/controller/ChatController.ts index 7b880cb..8dd5145 100644 --- a/src/controller/ChatController.ts +++ b/src/controller/ChatController.ts @@ -41,8 +41,8 @@ export default class ChatController { try { const ch = await global.client.channels.fetch(config.chatChannelId) - const t = global.config.messageTime + 0.001 - const time = (t / 3600 / 24).toFixed(100) + const t = global.config.messageTime + const time = (t / 3600 / 24).toString() const { data, status } = await axios.get( `${process.env.ECO_API_BASE || "https://eco.kamgames.xyz"}/api/v1/chat?startDay=${time}`, { timeout: 5000, @@ -56,6 +56,8 @@ export default class ChatController { return false } + console.log(data) + if (data.length === 0) { isSyncing = false return true @@ -63,6 +65,7 @@ export default class ChatController { const messages = data + if (!ch || !ch.isTextBased()) { isSyncing = false return false