Skip to content

Commit

Permalink
only notify if is live
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Feb 5, 2024
1 parent 1d64e71 commit f3450fc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions handlers/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ class Stream {
async captureScreenshot(target, bot, notifierBot, user) {
const image = await BrowserService.getScreenshot()
if (image) {
const channel = await TwitchService.getChannel()
await bot.say(target, `Captura de ${user}: ${config.externalUrl}/images/${image.fileName}`)
// const channel = await TwitchService.getChannel()
// await notifierBot.sendPhoto(config.telegram.chatId, image.buffer, {
// caption: `Captura del directo _${channel.title}_ \n por *${user}*`,
// parse_mode: 'Markdown'
// })
if (channel.live) {
await notifierBot.sendPhoto(config.telegram.chatId, image.buffer, {
caption: `Captura del directo _${channel.title}_ \n por *${user}*`,
parse_mode: 'Markdown'
})
}
}
}

Expand Down

0 comments on commit f3450fc

Please sign in to comment.