Browse Source

Explicitly lower-case irc.caller

dev
Brandon Cornejo 9 years ago
parent
commit
1ca5a8a797
  1. 6
      lib/irc.js

6
lib/irc.js

@ -275,7 +275,7 @@ IRC.prototype.moderators = function (data) {
if (data[1] === 'MODE') {
if (data[4] !== undefined) {
var user = data[4].charAt(0).toUpperCase() + data[4].slice(1);
var user = data[4].toLowerCase();
switch (data[3]) {
case '+o':
if (__self.mods.indexOf(user) < 0) {
@ -317,7 +317,7 @@ IRC.prototype.raw = function (data, hide) {
IRC.prototype.caller = function (data) {
var caller = data.split('!');
return caller[0].charAt(1).toUpperCase() + caller[0].slice(2);
return caller[0].slice(1).toLowerCase();
};
// send message to twitch chat
@ -329,7 +329,7 @@ IRC.prototype.msg = function (msg, options) {
__self.raw('PRIVMSG ' + __self.config.channel + ' :' + msg);
break;
case 1:
if (__self.mods.indexOf(opts.caller) >= 0) {
if (__self.mods.indexOf(opts.caller.toLowerCase()) >= 0) {
__self.raw('PRIVMSG ' + __self.config.channel + ' :' + msg);
}
break;

Loading…
Cancel
Save