mirror of
https://github.com/jwinterm/node-tip-bot.git
synced 2026-10-17 05:41:42 +02:00
updated readme
This commit is contained in:
@@ -48,6 +48,11 @@ Here you can restrict some commands to work only on PM/channel.
|
||||
### messages
|
||||
Whatever the bot says. Supports expandable variables (eg. `%nick%` for bot's nick). By default all config vars from `rpc` section are available.
|
||||
|
||||
## How does it work?
|
||||
Every nickname has it's own account in your wallet. When tipping or withdrawing, bot checks if user is registered and identified with NickServ. If so, he moves the money from one account to another, or when withdrawing, transfers coins to other wallet.
|
||||
|
||||
## How to run it?
|
||||
To run the bot simply use `npm start` or `node bin/tipbot`.
|
||||
|
||||
## Commands
|
||||
|
||||
|
||||
+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