This bot was written in a few hours. There are no tests and it has not been certified to work correctly. Do not use tokens of value with this bot. I take no responsiblity for any lost funds of any kind.
Also note this project is written in Javascript using npm packages which should be consider insecure.
- Make a backup of your db (sqlite.db) file
- Migration to the new DB should happen automatically
- If any transactions in the blockchain have not been recorded they will be added
- test tokens with decimal places
- add "make it rain"
- function to move all diviends paid to SLP addresses generated to main (first) wallet
- backups
- Add tests
- Cleanup code
This bot listens for specific tipping messages in groups it has been invited in as well as direct messages (balance, deposit, withdraw and help).
The Bot has a HD Wallet which is used for all tokens. Deposists by users are sent to an unique slp address generated from the HD Wallet for each user. Token balances are tracked in an SQLite db.
In order for the bot to do withdraw requests there needs to be some BCH in the wallet. Make sure you keep track of this and fill it when required. When a withdraw is made all SLP addresses generated with a token and/or BCH balance are used as input. Main wallet is used as change address and will receive the difference. This keeps the bulk of tokens in the main (first) wallet.
SLP dividends are not tracked and all go to the bots Wallet.
yarn install
- Copy
config.json.dist
toconfig.json
cp config.json.dist config.json
- Adjust
config.json
for your needs
Send the following messages to @BotFather
/newbot
and follow the prompts to create your bot./setprivacy
set privancy to Disabled (required for bot to hear messages in group chats):- Copy the
token
into yourconfig.json
for keytelegramToken
- Run
node create-wallet.js
to create a new wallet - Write down the 12 seeds words and keep them in a safe location
If you like this bot and want to support me, send me some tokens or crypto:
SLP:
simpleledger:qq0dg8mk42k2czhqv008tsaqj4tf24f3e52whts56e
BCH:
bitcoincash:qp8uwzjfw4nce7terjre80u38kfvcnxf5glm5rv676
BTC:
1Lv4Etacsjj1yi3AUGbzZZrcHHhbVbrNkY
ETH:
0xe5faC92651dD9Cf6ebab9C8B47d625502B334096