logging
This commit is contained in:
parent
919b5cc644
commit
2c13cc345b
1 changed files with 5 additions and 0 deletions
5
index.js
5
index.js
|
|
@ -68,11 +68,15 @@ const loop = async () => {
|
||||||
);
|
);
|
||||||
const { state } = await response.json();
|
const { state } = await response.json();
|
||||||
const isLive = state.id === 1; // published
|
const isLive = state.id === 1; // published
|
||||||
|
constole.info('Live: ', isLive, currentlyLive)
|
||||||
const stateChange = isLive !== globalState.currentlyLive;
|
const stateChange = isLive !== globalState.currentlyLive;
|
||||||
|
constole.info('State change', stateChange)
|
||||||
globalState.currentlyLive = isLive;
|
globalState.currentlyLive = isLive;
|
||||||
|
|
||||||
|
constole.info('State: ', state)
|
||||||
if (stateChange) {
|
if (stateChange) {
|
||||||
if (isLive) {
|
if (isLive) {
|
||||||
|
constole.info('Went live!')
|
||||||
await post({
|
await post({
|
||||||
spoiler_text: 'Stream announcment',
|
spoiler_text: 'Stream announcment',
|
||||||
status: [
|
status: [
|
||||||
|
|
@ -88,6 +92,7 @@ const loop = async () => {
|
||||||
external_link: `https://tube.ebin.club/w/${videoId}`,
|
external_link: `https://tube.ebin.club/w/${videoId}`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
constole.info('Went offline...')
|
||||||
await scrobble({
|
await scrobble({
|
||||||
title: 'Stream over',
|
title: 'Stream over',
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue