diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..07c019f --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 unek + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index c91fd7e..faaf845 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -# node-tip-bot node-tip-bot is an open-source node.js IRC bot for tipping with altcoins. It uses [node-dogecoin](https://github.com/countable/node-dogecoin) for integration with Litecoin's JSON RPC API. -## Instalation +# Instalation To install node-tip-bot simply clone this repo and install dependencies: ```bash git clone https://github.com/unek/node-tip-bot @@ -10,38 +9,38 @@ npm install ``` After installation proceed to the configuration. -## Configuration +# Configuration To configure, edit the config/config.yml file. -### connection +## connection IRC network connection info. * **host** - hostname of the IRC server * **port** - port of the IRC server * **secure** - use secured connection * **status_command** - NickServ command to get nick's login status, ACC on freenode, STATUS on some other networks -### login +## login IRC network connection and login info. * **nickname** - bot's nickname * **username** - bot's username * **realname** - bot's realname * **nickserv_password** - nickserv password to identify with -### channels +## channels List of channels to auto-join to. -### log +## log Logging settings. * **file** - file to log to. Set to `false` to disable logging to file. -### rpc +## rpc JSON RPC API connection info. * **host** - JSON RPC API hostname * **port** - API port (by default 22555 for dogecoin) * **user** - API username * **pass** - API password (keep that secure) -### coin +## coin Basic coin settings. * **withdrawal_fee** - fee collected on withdraw to cover up txfee, the rest goes to bot's wallet. * **min_withdraw** - minimum amount of coins to withdraw @@ -50,17 +49,17 @@ Basic coin settings. * **short_name** - short coin's name (eg. `Đ` or `DOGE`) * **full_name** - full coin's name (eg. `dogecoin`) -### commands +## commands Here you can restrict some commands to work only on PM/channel. -### messages +## 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? +# 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? -Before running the bot, you have to be running your coin daemon with JSON-RPC API enabled. To enable, add this to your coin daemon configuration file (eg `~/.dogecoin/dogecoin.conf`): +# How to run it? +Before running the bot, you have to be running your coin daemon with JSON-RPC API enabled. To enable, add this to your coin daemon configuration file (eg. `~/.dogecoin/dogecoin.conf`): ```ini server=1 daemon=1 @@ -80,32 +79,9 @@ To run the bot simply use `npm start` or `node bin/tipbot`. | `withdraw` | `
` | withdraws your whole wallet balance to specified address | `tip` | ` ` | sends the specified amount of coins to the specified nickname | `help` | | displays configured help message (by default similiar to this one) +| `terms` | | displays terms and conditions for using the tip bot ## Donations Donations are welcome! If you like my bot and want to donate me, here are my wallet addresses: * **Dogecoin**: DGLT1pTSKAXLSSSz1NGFgZNLioDyHdaDyA - -## License -(The MIT License) - -Copyright (c) 2014 unek - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/bin/tipbot b/bin/tipbot.js similarity index 98% rename from bin/tipbot rename to bin/tipbot.js index 02e05b4..e98bdcf 100644 --- a/bin/tipbot +++ b/bin/tipbot.js @@ -10,7 +10,12 @@ var settings = yaml.load(fs.readFileSync('./config/config.yml', 'utf-8')); // load winston's cli defaults winston.cli(); -// winston.add(winston.transports.File, +// write logs to file +if(settings.log.file) { + winston.add(winston.transports.File, { + filename: settings.log.file + , level: info}); +} // connect to coin json-rpc winston.info('Connecting to coind...');