forked from keinBot/cuffeo
comment getLevel function
add Map prototype functions to irc lib
This commit is contained in:
@@ -11,9 +11,34 @@ import welcome from "./welcome";
|
||||
import who from "./who";
|
||||
import whois from "./whois";
|
||||
|
||||
Map.prototype.hasi = function(val) {
|
||||
try {
|
||||
for (let [key] of this)
|
||||
if(key.toLowerCase() === val.toLowerCase())
|
||||
return true;
|
||||
return false;
|
||||
} catch(err) {
|
||||
console.log("das übliche mit tolowercase()");
|
||||
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);
|
||||
};
|
||||
|
||||
export default [
|
||||
cap, invite, join,
|
||||
motd, msg, nick,
|
||||
part, ping, pwdreq,
|
||||
welcome, who, whois
|
||||
];
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user