Skip to content
NANO/BANANO Tip bot for discord
Python Shell
Branch: master
Clone or download
Latest commit a99e4cd May 13, 2019

Graham (a NANO/BANANO Currency Tip Bot for Discord)

Graham/BananoBot++ is an open source, free to use nano/banano bot for discord.

You can see/use a NANO and BANANO instance of this bot on the official banano discord


  • balance : Display balance of your account

  • deposit or register or wallet or address : Shows account address, or creates one if it doesn't yet exist

  • withdraw, takes: address (optional amount) : Allows you to withdraw from your tip account

  • tip (NANO) or ban (BANANO), takes: amount <*users> : Send a tip to mentioned users

  • tipsplit (NANO) or bansplit (BANANO), takes: amount, <*users> : Split a tip among mentioned uses

  • tiprandom (NANO) or banrandom (BANANO) takes: amount : Tips a random active user

  • rain (NANO) or brain (BANANO), takes: amount : Split tip among all active* users

  • giveaway, takes: amount, fee=(amount), duration=(minutes) : Sponsor a giveaway

  • ticket, takes: fee (conditional) : Enter the active giveaway

  • tipgiveaway, takes: amount : Add to present or future giveaway prize pool

  • ticketstatus : Check if you are entered into the current giveaway

  • giveawaystats or goldenticket : Display statistics relevant to the current giveaway

  • winners : Display previous giveaway winners

  • leaderboard or ballers : Display the all-time tip leaderboard

  • toptips : Display largest individual tips

  • tipstats : Display your personal tipping stats

  • addfavorite, takes: *users : Add users to your favorites list

  • removefavorite, takes: *users or favorite ID : Removes users from your favorites list

  • favorites : View your favorites list

  • tipfavorites (NANO) or banfavorites (BANANO), takes: amount : Tip your entire favorites list

  • mute, takes: user id : Block tip notifications when sent by this user

  • unmute, takes: user id : Unblock tip notificaitons sent by this user

  • muted : View list of users you have muted

  • adminhelp : View list of available admin commands (For users with admin privileges, configured in


Graham is designed so that every tip is a real transaction on the NANO/BANANO network.

Some highlights:

  • All bot-related activity including creating transactions is handled in the primary bot process, asynchronously
  • Actual transaction processing is handled by celery worker processes 'graham_backend' (RPC Send/RPC Receive)
  • Communication between the bot and worker processes is done using redis
  • User data, transactions, and all other persisted data is stored using the Peewee ORM with PostgreSQL
  • Operates with a single NANO/BANANO wallet, with 1 account per user

Recommend using with a GPU/OpenCL configured node (or work peer) on busier discord servers due to POW calculation.

Setting up your own bot

Instructions assume a debian-based installation with python3.6 installed.

The bot will run on any linux distribution with python 3.6 or greater, mac, or windows. If you get it setup on windows consider documenting it and I'll add the steps to the wiki.


sudo apt install python3.6 python3.6-dev libcurl4-openssl-dev git redis-server postgresql

(Optional - to run with pm2)

sudo apt install npm nodejs
sudo npm install -g pm2

Setting up a node

There are many ways to setup a nano/banano node. From simply using the desktop wallet to building from source to using docker.

Here's some resources on setting up a NANO node and setting up a BANANO node:

The NANO/BANANO discords are the best places to go for support if you get stuck or need help.

1. Cloning the repository

cd ~
git clone graham

2. Setting up a PostgreSQL database and user


sudo -u postgres psql

To open a postgres prompt as the postgres user.

create role tipbot_user with login password 'mypassword';

Use whatever username and password you want, you will need to remember the postgres username tipbot_user and password mypassword for later tip bot configuration.

create database graham;
grant all privileges on database graham to tipbot_user;

Creates a database graham and grants privileges on that database to tipbot_user

so our bot settings under this example look like:


3. Create wallet for tip bot

Note: substitute rai_node with bananode for banano

docker <container_id> exec rai_node --wallet_create

non-docker nodes:

/path/to/rai_node --wallet_create

This will output your wallet ID (NOT the seed), copy this as you will need it for later

To backup the seed:

rai_node --wallet_decrypt_unsafe --wallet=<ID>

4. Discord bot

Create discord bot and get client ID and token (also save both of these for the next step)

Guide written by somebody else

5. Configuration

cd graham

Edit with any text editor, e.g. nano and configure it as follows:

discord_bot_id = 'YOUR_DISCORD_CLIENT_ID_HERE'
discord_bot_token = 'YOUR_DISCORD_BOT_TOKEN_HERE'

Also configure the postgres connection info from before:


and if you are using the bot for BANANO and not NANO then set:


6. Setting up virtual environment and python requirements

virtualenv -p python3.6 venv
source venv/bin/activate
pip install -r requirements.txt

That's it, if configured correctly you can run the bot.

Running with PM2


pm2 start
pm2 save

Backend/TX Processor:

pm2 start
pm2 save

You can view logs under ~/.pm2/logs/

e.g.: tail -f ~/.pm2/logs/graham-bot-error-0.log to follow the bot logs


tail -f ~/.pm2/logs/graham-backend-error-0.log to follow the worker logs`

Running normally


or in background:

nohup ./ &



or in background:

nohup ./ &

CLI tool

There's a CLI utility for certain functions (looking up block hashes, replaying unprocessed transactions, etc)

You can see features available by -h

Graham 2.5 -> 3.0+ upgrade instructions

First stop the bot completely, git pull, and install pre-reqs:

sudo apt install redis-server postgresql ruby ruby-dev libsqlite3-dev libpq-dev
sudo gem install sequel pg sqlite3

and python pre-reqs:

./venv/bin/pip install -U -r requirements.txt

Backup anything you fear may be lost

Run migration pre-reqs on old table

sqlite3 nanotipbot.db < sql/3.0/migrate.sql

Create database/user/password for postgres

sudo -u postgres psql

in postgres prompt:

create database graham;
create role graham_user with login password 'password';
grant all privileges on database graham to graham_user;

Note the username, password, and database name used here

In this example they are:

database: 'graham'
user: 'graham_user'
password: 'password'

Substitute the values below with yours if they are different

Run the migration:

sudo sequel -C sqlite://nanotipbot.db postgresql://graham_user:password@localhost:5432/graham

If all went well , run the post-migrate

Use database name as argument from above (graham or whatever you used):

sudo -u postgres ./sql/3.0/ graham_user password graham

??? profit

If you have issues migrating contact me and i'll help if I'm available


I created and operate Graham for free, and I am cool with that.

If you'd like to buy me a beer though it's always appreciated:


or banano


You can’t perform that action at this time.