From c372f7b6cfd2c3191218d636e06d805f910dc766 Mon Sep 17 00:00:00 2001 From: Lluis Date: Tue, 12 Mar 2024 00:37:05 +0100 Subject: [PATCH] add log --- handlers/stream.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/stream.js b/handlers/stream.js index f2c963a..5662fe4 100644 --- a/handlers/stream.js +++ b/handlers/stream.js @@ -33,7 +33,7 @@ class Stream { async catchStream (telegramBot, twitchBot, target) { const result = await TwitchService.getStream() - console.log('result 1min ' + result.type) + console.log(`result 1min type: ${result.type}, messagId: ${result.messageId}, lastTitle: ${result.lastTitle}, title: ${result.title}, last update:${result.lastUpdate}, diff: ${moment().diff(moment(result.lastUpdate))}, isdiff: ${(result.lastUpdate && moment().diff(moment(result.lastUpdate)) > 300000)}` ) if (result && result.type === 'live' ) { await this.sendTodayBirthday(twitchBot, target) @@ -48,7 +48,7 @@ class Stream { await telegramBot.deleteMessage(config.telegram.chatId, result.messageId) await this._sendStreamScreenshots(telegramBot, result.streamId) await BrowserService.closeBrowser().catch(() => { console.error('closeBrowser on finished')}) - } else if (result && result.type === 'stillLive' && result.messageId && (result.lastTitle !== result.title || (result.lastUpdate && moment().diff(moment(result.lastUpdate)) > 61000))) { + } else if (result && result.type === 'stillLive' && result.messageId && (result.lastTitle !== result.title || (result.lastUpdate && moment().diff(moment(result.lastUpdate)) > 300000))) { const options = { chat_id: config.telegram.chatId, message_id: result.messageId,