Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Make commands channel agnostic and fix followers.js
Browse files Browse the repository at this point in the history
Fixes Issue #4 and also stops Beastie from joining the teamTALIMA
channel by default unless that is the configured broadcaster's username
in /config/secrets.js
  • Loading branch information
scryptonite committed May 16, 2017
1 parent 4be7ace commit 3353f4e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion beastie-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const secrets = require("./config/secrets");
var beastie = new tmi.client(
_.defaults({
identity: secrets.TTsBeastie,
channels: ["#teamTALIMA"]
channels: [secrets.broadcaster.username]
}, require ("./config/config"))
);

Expand Down
16 changes: 9 additions & 7 deletions beastie-functions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TTsBeastie custom functions


const secrets = require("./config/secrets");

/**
* CUSTOM TTsBEASTIE FUNCTIONS
Expand All @@ -24,10 +24,12 @@ module.exports.getArrayElement = function(array){
}

module.exports.queryTwitchAPI = function(queryUrl){
url: "https://api.twitch.tv/kraken/" + queryUrl,
headers: {
"Accept": "application/vnd.twitchtv.v5+json",
"Authorization": "OAuth " + secrets.broadcaster.password,
"Client-ID": secrets.clientId
}
return {
url: "https://api.twitch.tv/kraken/" + queryUrl,
headers: {
"Accept": "application/vnd.twitchtv.v5+json",
"Authorization": "OAuth " + secrets.broadcaster.password,
"Client-ID": secrets.clientId
}
};
}
2 changes: 1 addition & 1 deletion commands/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var commands = {
var minutes = Math.floor(diff / 60) % 60;
var seconds = Math.floor(diff - (hours * 60 * 60) - (minutes * 60));

queue.addMessage( channel, "teamTALIMA has been LIVE for: " + hours + " hours " + minutes + " minutes " + seconds + " seconds. rawr");
queue.addMessage( channel, secrets.broadcaster.username + " has been LIVE for: " + hours + " hours " + minutes + " minutes " + seconds + " seconds. rawr");
}
});
}
Expand Down
1 change: 1 addition & 0 deletions events/followers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// Setup Files
const beastie = require("../beastie-client");
const beastieFunctions = require("../beastie-functions");
const secrets = require("../config/secrets");

// array of new followers which need to be acknowledged
Expand Down

0 comments on commit 3353f4e

Please sign in to comment.