mirror of
https://github.com/jwinterm/node-tip-bot.git
synced 2026-10-23 06:38:45 +02:00
updated readme
This commit is contained in:
+6
-7
@@ -106,17 +106,12 @@ client.addListener('registered', function(message) {
|
||||
client.say('NickServ', 'IDENTIFY ' + settings.login.nickserv_password);
|
||||
});
|
||||
|
||||
client.addListener('close', function(message) {
|
||||
client.log(message);
|
||||
winston.warn('Server %s disconnected.', message);
|
||||
});
|
||||
|
||||
client.addListener('error', function(message) {
|
||||
winston.error('Received an error from IRC network: ', message);
|
||||
});
|
||||
|
||||
client.addListener('message', function(from, channel, message) {
|
||||
var match = message.match(/^(!?)(\S+)/);
|
||||
var match = message.match(/^(!?)(\S+)/);
|
||||
if(match == null) return;
|
||||
var prefix = match[1];
|
||||
var command = match[2];
|
||||
@@ -131,8 +126,12 @@ client.addListener('message', function(from, channel, message) {
|
||||
// if pms, make sure to respond to pms instead to itself
|
||||
if(channel == client.nick) channel = from;
|
||||
|
||||
// if not that, message will be undefined for some reason
|
||||
// todo: find a fix for that
|
||||
var msg = message;
|
||||
client.getLoginStatus(from, function(status) {
|
||||
// check if the sending user is logged in (identified)
|
||||
var message = msg;
|
||||
// check if the sending user is logged in (identified) with nickserv
|
||||
if(status != 3) {
|
||||
winston.info('%s tried to use command `%s`, but is not identified.', from, message);
|
||||
client.say(channel, settings.messages.not_identified.expand({name: from}));
|
||||
|
||||
Reference in New Issue
Block a user