diff --git a/src/inc/clients/irc/whois.js b/src/inc/clients/irc/whois.js index bdfacf8..35c172f 100644 --- a/src/inc/clients/irc/whois.js +++ b/src/inc/clients/irc/whois.js @@ -51,7 +51,7 @@ module.exports = client => { if (this.server.user.hasi(msg.params[1])) { tmpuser = this.server.user.geti(msg.params[1]); if (tmpuser.channels) - tmpchan = tmpuser.channels; + tmpchan = new Map(tmpuser.channels); } let chans = msg.params[2].trim().split(" "); for (let chan in chans) { @@ -71,3 +71,21 @@ module.exports = client => { this.server.user.set(msg.params[1], tmpuser); }.bind(client)); }; + +Map.prototype.hasi = function (val) { + for (let [key] of this) + if (key.toLowerCase() === val.toLowerCase()) + return true; + return false; +}; +Map.prototype.geti = function (val) { + for (let [key, value] of this) + if (key.toLowerCase() === val.toLowerCase()) + return value; + return false; +}; +Map.prototype.deli = function (val) { + for (let [key] of this) + if (key.toLowerCase() === val.toLowerCase()) + this.delete(key); +}; \ No newline at end of file diff --git a/src/inc/trigger/parser.js b/src/inc/trigger/parser.js index 29efdbf..96d8c86 100644 --- a/src/inc/trigger/parser.js +++ b/src/inc/trigger/parser.js @@ -14,7 +14,7 @@ module.exports = bot => { bot._trigger.set("parser", { call: /https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi, level: 0, - active: true, + active: false, clients: ["irc"], f: e => { const links = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi);