mirror of
https://github.com/jwinterm/node-tip-bot.git
synced 2026-11-29 11:43:55 +01:00
sample config
This commit is contained in:
@@ -10,7 +10,7 @@ npm install
|
|||||||
After installation proceed to the configuration.
|
After installation proceed to the configuration.
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
To configure, edit the config/config.yml file.
|
To configure, copy the `config/config.sample.yml` file to `config/config.yml`.
|
||||||
|
|
||||||
## connection
|
## connection
|
||||||
IRC network connection info.
|
IRC network connection info.
|
||||||
|
|||||||
+8
-3
@@ -4,6 +4,11 @@ var irc = require('irc')
|
|||||||
, yaml = require('js-yaml')
|
, yaml = require('js-yaml')
|
||||||
, coin = require('node-dogecoin');
|
, coin = require('node-dogecoin');
|
||||||
|
|
||||||
|
if(!fs.existsSync('./config/config.yml')) {
|
||||||
|
winston.error('Configuration file doesn\'t exist! Please read the README.md file first.');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
// load settings
|
// load settings
|
||||||
var settings = yaml.load(fs.readFileSync('./config/config.yml', 'utf-8'));
|
var settings = yaml.load(fs.readFileSync('./config/config.yml', 'utf-8'));
|
||||||
|
|
||||||
@@ -14,7 +19,7 @@ winston.cli();
|
|||||||
if(settings.log.file) {
|
if(settings.log.file) {
|
||||||
winston.add(winston.transports.File, {
|
winston.add(winston.transports.File, {
|
||||||
filename: settings.log.file
|
filename: settings.log.file
|
||||||
, level: info});
|
, level: 'info'});
|
||||||
}
|
}
|
||||||
|
|
||||||
// connect to coin json-rpc
|
// connect to coin json-rpc
|
||||||
@@ -30,7 +35,7 @@ var coin = coin({
|
|||||||
coin.getBalance(function(err, balance) {
|
coin.getBalance(function(err, balance) {
|
||||||
if(err) {
|
if(err) {
|
||||||
winston.error('Could not connect to %s RPC API! ', settings.coin.full_name, err);
|
winston.error('Could not connect to %s RPC API! ', settings.coin.full_name, err);
|
||||||
process.exit();
|
process.exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +54,7 @@ var client = new irc.Client(settings.connection.host, settings.login.nickname, {
|
|||||||
, userName: settings.login.username
|
, userName: settings.login.username
|
||||||
, realName: settings.login.realname
|
, realName: settings.login.realname
|
||||||
|
|
||||||
, debug: true
|
, debug: settings.connection.debug
|
||||||
});
|
});
|
||||||
|
|
||||||
// gets user's login status
|
// gets user's login status
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ connection:
|
|||||||
port: 6667
|
port: 6667
|
||||||
secure: false
|
secure: false
|
||||||
status_command: ACC
|
status_command: ACC
|
||||||
|
debug: false
|
||||||
login:
|
login:
|
||||||
nickname: nodetip
|
nickname: nodetip
|
||||||
username: nodetip
|
username: nodetip
|
||||||
Reference in New Issue
Block a user