Permalink
Browse files

Version 1.3. Opt into stream notifications and #twitch-* channels, up…

…date libraries. It sucks less.
  • Loading branch information...
roncli committed May 23, 2017
1 parent d3313d7 commit fa8b18a6199d7b154fe0cacdd24771e9c6422ea8
Showing with 166 additions and 64 deletions.
  1. +7 −0 README.md
  2. +19 −9 database.js
  3. +5 −7 package.json
  4. +135 −48 sixgaming.js
View
@@ -89,6 +89,13 @@ The following should be the contents of settings.js:
Version History
===============
1.3 - 5/22/2017
---------------
* Bot no longer pings @everyone when a streamer goes live. Instead, you must `!streamnotify` to be alerted to when a streamer goes live, and `!streamunnotify` to turn it off.
* Bot no longer creates #game-* channels for every game that is created.
* Bot no longer creates #twitch-* text channels for every Twitch streamer who registers. Instead, you must `!createchannel` to create your text channel, and `!removechannel` to remove it.
* It sucks less. 👌
1.2.1 - 3/25/2017
-----------------
* Added Sombra and Orisa to `!randomonium`.
View
@@ -1,11 +1,10 @@
var settings = require("./settings"),
sql = require("mssql"),
_ = require("underscore");
sql = require("mssql");
module.exports.query = function(sqlStr, params, callback) {
"use strict";
var conn = new sql.Connection(settings.database, function(err) {
var conn = new sql.ConnectionPool(settings.database, function(err) {
var ps;
if (err) {
@@ -14,20 +13,29 @@ module.exports.query = function(sqlStr, params, callback) {
}
ps = new sql.PreparedStatement(conn);
_(params).each(function(param, key) {
ps.input(key, param.type);
Object.keys(params).forEach(function(key) {
ps.input(key, params[key].type);
});
ps.multiple = true;
ps.prepare(sqlStr, function(err) {
var paramList = {},
paramMap;
if (err) {
callback(err);
return;
}
paramMap = Object.keys(params).map(function(key) {
return [key, params[key].value];
});
for (let i = 0, length = Object.keys(paramMap).length; i < length; i++) {
paramList[paramMap[i][0]] = paramMap[i][1];
}
ps.execute(
_.object(_(params).map(function(param, key) {
return [key, param.value];
})), function(err, data) {
paramList, function(err, data) {
if (err) {
callback(err);
return;
@@ -48,9 +56,11 @@ module.exports.query = function(sqlStr, params, callback) {
module.exports.TYPES = sql.TYPES;
_(sql.TYPES).each(function(value, key) {
Object.keys(sql.TYPES).forEach(function(key) {
"use strict";
var value = sql.TYPES[key];
module.exports[key] = value;
module.exports[key.toUpperCase()] = value;
});
View
@@ -1,6 +1,6 @@
{
"name": "SixBotGG",
"version": "1.2.1",
"version": "1.3.0",
"description": "A Twitch IRC bot for Six Gaming.",
"homepage": "https://github.com/roncli/SixBotGG",
"bugs": {
@@ -18,12 +18,10 @@
"url": "https://github.com/roncli/SixBotGG.git"
},
"dependencies": {
"discord.js": "10.0.1",
"mssql": "3.3.0",
"promised-io": "0.3.5",
"tmi.js": "1.1.2",
"twitch-api": "0.4.5",
"underscore": "1.8.3"
"discord.js": "11.1.0",
"mssql": "4.0.4",
"tmi.js": "1.2.1",
"twitch-api": "0.4.6"
},
"engines": {
"node": ">=6.0.0"
Oops, something went wrong.

0 comments on commit fa8b18a

Please sign in to comment.