Giter VIP home page Giter VIP logo

node-tip-bot's Introduction

node-tip-bot is an open-source node.js IRC bot for tipping with altcoins. It uses node-dogecoin for integration with Litecoin's JSON RPC API.

Instalation

To install node-tip-bot simply clone this repo and install dependencies:

git clone https://github.com/unek/node-tip-bot
cd node-tip-bot
npm install

After installation proceed to the configuration.

Configuration

To configure, copy the config/config.sample.yml file to config/config.yml.

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
  • bind_address - address to bind to when connecting

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

List of channels to auto-join to.

webadmin

Web interface settings.

  • enabled - enabled web admin
  • port - port to bound to
  • users - list of users with access to web interface in name: password format

log

Logging settings.

  • file - file to log to. Set to false to disable logging to file.

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

Basic coin settings.

  • withdrawal_fee - fee charged on withdraw to cover up txfee, the rest goes to bot's wallet.
  • min_withdraw - minimum amount of coins to withdraw
  • min_confirmations - minimum amount of confirmations needed to tip/withdraw coins
  • min_tip - minimum amount of coins to tip
  • short_name - short coin's name (eg. ฤ or DOGE)
  • full_name - full coin's name (eg. dogecoin)

commands

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?

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):

server=1
daemon=1
rpcuser=<your username>
rpcpassword=<your super secret password>
rpcallowip=<your bot's ip address or just 127.0.0.1 if hosted on the same machine>

To run the bot simply use node bin/tipbot or npm start.

Commands

Commands are executed by messaging the bot. Commands that have channel:true in the config can be run with '!' in the channel.

Command Arguments Description
balance displays your current wallet balance
address displays address where you can send your funds to the tip bot
withdraw <address> withdraws your whole wallet balance to specified address
tip <nick> <amount> 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
rain [max] splits amount coins between max users on the channel

Donations

Donations are welcome! If you like my bot and want to donate me, here are my wallet addresses:

  • Bitcoin: 1G7T2JNDnbxo3txFWZSuV5oYq8qwtSEg51
  • Dogecoin: DGLT1pTSKAXLSSSz1NGFgZNLioDyHdaDyA

or just tip me (unek) on freenode in your freshly installed tipbot ๐Ÿ˜„

node-tip-bot's People

Contributors

jwinterm avatar lordzerohour avatar pandacoin-official avatar teknogeek avatar unek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-tip-bot's Issues

Tip ONLY .. and NEVER

It would be GREAT if the tipbot would keep track of the users who've spoken in the last xx minutes, and ONLY .rain upon them..

It would also be GREAT if the tipbot would NEVER rain upon itself.

I have disabled .rain pub/priv commands because it's a waste of good time, coin and Slack - that I have to always go in and move coins around. Expect a small BTC donation. Thank you for your efforts.

Ping is enough to stay active

If you just ping the bot for balance via PM it includes you in active soaks!
Especially as you wouldn't be able to 'see' it leeching!
You don't even have to know how to code a bot to use this!

(MrPrime from freenode asked me to open this issue!)

Commands not working on UnrealIRCd

Unregistered commands termsand help function correctly but address, balance etc are ignored. status_command variable has been set correctly.

var regexp = new RegExp('^(\S+) ' + settings.connection.status_command + ' (\d)');
assumes ordering of ACC/STATUS as 2nd param

Below is debug log from unrealircd server:

28 Mar 19:40:57 - SEND: PRIVMSG NickServ :STATUS SashaCoe
28 Mar 19:40:57 - GOT MESSAGE from SashaCoe: !address
28 Mar 19:40:58 - GOT NOTICE from "NickServ": "STATUS SashaCoe 3"
28 Mar 19:44:25 - SEND: PRIVMSG NickServ :STATUS SashaCoe
28 Mar 19:44:25 - GOT MESSAGE from SashaCoe: !balance
28 Mar 19:44:25 - GOT NOTICE from "NickServ": "STATUS SashaCoe 3"

Freenode server:

28 Mar 19:32:52 - SEND: PRIVMSG NickServ :ACC SashaCoe
28 Mar 19:32:52 - GOT MESSAGE from SashaCoe: !balance
28 Mar 19:32:52 - GOT NOTICE from "NickServ": "SashaCoe ACC 3"
28 Mar 19:32:52 - SEND: PRIVMSG SashaCoe :sashacoe has 0ฤ (unconfirmed: 0ฤ)
28 Mar 19:33:24 - SEND: PRIVMSG NickServ :ACC SashaCoe
28 Mar 19:33:24 - GOT MESSAGE from SashaCoe: !address
28 Mar 19:33:24 - GOT NOTICE from "NickServ": "SashaCoe ACC 3"
28 Mar 19:33:24 - SEND: PRIVMSG SashaCoe :Your deposit address

account balances are borked.

i killed the daemon and right before i killed the bot, a user went n did a massive rain which triggered another small rain bot and now the balances are all way off, some are in the high negatives, and some have 10 times the amount of coins than are in the actual wallet. is there a way i can revert this? since each account is tied to a key pair?

!tip command

There's going to be a bunch of tip bots in a channel and it's going to drive me crazy. Obviously rewriting the tipbot to alter everything to allow for %cmd% would be something that would take time, and taking into account that I don't know how this package operates yet, could you tell me what I need to change to get !tip to be .tip for the time being.

-thanks

Privledges

I disabled .rain on our tipbob because it was in a channel where it was being 'over used' and seemed to be annoying some folks. The channel seemed to appreciate it for the most part, but some users over usage, with foul intent, could have been considered to be intentionally provoking the stark fist of removal.. But, as the tipbob's master, I would still like to be able to use .rain.

Maybe I'm exceeding the scope of a simple tipbot =p
But it would be nice to have some user-flags implemented.
Doing so would also solve my /ignore user request.

No support for Quakenet

Hey there,
so i tried to contact you many times over irc, but it seems that we have different time zones.
So i realy need that this bot also works with quakenet.
Please be so nice to contact me: [email protected]
Thnank you!

Can be robbed empty easily DO NOT RUN THIS LIVE

:(

sucks big time ...

Seems the check for 'enough balance' doesnt happen early enough or well enough.
Users can tip 'all their coins' to another user a couple times before it comes back with 'but you only have -128976319827'
Then they do it back and forth and back until they have -all- the coins from the wallet.

VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!! VERY UNSECURE, DONT RUN THIS BOT LIVE!!!!

got a negative balance again!

!rain 1752178.087936
[21:03] <+dogedShibeBot> uphoria rained 97343.22710756 DOGED upon BrownPanick, Dj4x, dogedRADIO, cryptoloot, dogeb0t, Maseyo, buZz, gnomethrower, DBR, dogedDEV, jwinterm, mogreen, OnlyOne, Erlin, Rawnie, dogedart, Erock23, [Curious]Koala.
[21:03] !balance
[21:03] <+dogedShibeBot> uphoria has -0.000008 DOGED (unconfirmed: 0 DOGED)

help and terms not working

Hello, I'm just wondering how to get help and terms working. I've tried enabling it in channel and pm and it's not exporting any data.

Error while trying to connect toirc.rizon.net via SSL

I tried to connect with theses settings:
connection:
host: irc.rizon.net
port: 9999
secure: true
debug: true

And I got these errors:
info: Connecting to coind...
info: Running webadmin on port 3901
info: Connecting to the server...
info: Connected to JSON RPC API. Current total balance is 0ฤ
23 Jun 14:24:59 - Connection got "close" event
23 Jun 14:24:59 - Disconnected: reconnecting
23 Jun 14:24:59 - Waiting 2000ms before retrying
23 Jun 14:24:59 - Unhandled message: { prefix: 'irc.rizon.io',
server: 'irc.rizon.io',
command: '439',
rawCommand: '439',
commandType: 'normal',
args: [ '*', 'Please wait while we process your connection.' ] }
23 Jun 14:24:59 - Connection got "end" event

BIND TipBot to IP

I don't understand npm well enough yet to have a clue where to begin, but need to bind the bot to a second adapter / IP. How might I accomplish this.

ignore user

What might you do to prevent abuse? Seems repeated .rain commanding will certainly cause tipbot to flood off a server. And some users are just asshats.

Maybe tipbot could /ignore users.. somehow.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.