Skip to content

Commit

Permalink
Temp debugging to learn why announcements aren't working.
Browse files Browse the repository at this point in the history
  • Loading branch information
roncli committed Apr 18, 2021
1 parent 2e7ea47 commit 2e42871
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node/src/discord/streamers.js
Expand Up @@ -82,6 +82,9 @@ class Streamers {

if (new Date().getTime() - lastAnnounced[member.id] < 300000) {
lastAnnounced[member.id] = new Date().getTime();
if (notify) {
Log.info("Did not notify because last announced less than 5 minutes ago.", {properties: {twitchName}});
}
return;
}

Expand All @@ -94,11 +97,13 @@ class Streamers {
if (notify) {
const user = await Twitch.botTwitchClient.helix.users.getUserByName(twitchName);
if (!user) {
Log.info("Did not notify because user was not found.", {properties: {twitchName}});
return;
}

const channel = await Twitch.botTwitchClient.kraken.channels.getChannel(user.id);
if (!channel) {
Log.info("Did not notify because channel was not found.", {properties: {twitchName, userId: user.id}});
return;
}

Expand Down

0 comments on commit 2e42871

Please sign in to comment.