-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmdutil.js
More file actions
35 lines (31 loc) · 724 Bytes
/
Copy pathcmdutil.js
File metadata and controls
35 lines (31 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var admins = require('./cfg/admins')
var m = {
/**
* Returns false, if the user, host, and nick of the message match an admin,
* true otherwise.
*/
notadmin: function(msg) {
return !admins.some(function(admin) {
return msg.user === admin.user &&
msg.host === admin.host &&
msg.nick === admin.nick;
});
},
/**
* Create an array of the arguments in a message.
*/
args: function(text) {
return text.split(' ');
},
/**
* Write to the channel or respond to a private message.
*/
out: function(text, con, msg) {
if (msg.channel) {
con.say(msg.channel, text);
} else {
con.pm(msg.nick, text);
}
}
};
module.exports = m;