forked from keinBot/cuffeo
migrate irc + tg client changes from uwe
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
export default client => {
|
||||
client._cmd.set("PRIVMSG", function (msg) { // privmsg
|
||||
this.emit("data", msg.params[1] === "\u0001VERSION\u0001" ? ["ctcp:version", this.reply(msg)] : ["message", this.reply(msg)]);
|
||||
if(msg.params[1] === "\u0001VERSION\u0001")
|
||||
return this.emit("data", ["ctcp:version", this.reply(msg)]);
|
||||
else if(msg.params[1].match(/^\u0001PING .*\u0001/i))
|
||||
return this.emit("data", ["ctcp:ping", this.reply(msg)]);
|
||||
else
|
||||
this.emit("data", ["message", this.reply(msg)]);
|
||||
}.bind(client));
|
||||
|
||||
client._cmd.set("NOTICE", function (msg) { // notice
|
||||
|
||||
@@ -75,21 +75,3 @@ export default 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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user