Telegram chatbot that allows users to pass a quiz and get some Bytes
- You need node and npm 8+ installed.
- Run
npm install
to install dependencies - You need to install redis for bot sessions
- You need to have mail server to receive daily payments notifications (for example setup gmail smtp access).
Although you can disable email usage altogether with
useEmail
option - You can check most of the available options in
conf.js
. Check options inconf.js
and make sure all is set right. To override these settings add options toconf.json
in app data dir. - Copy
questions.sample.json
from app root toquestions.json
in app data dir (It's sample questions, feel free to add or editquestions.json
according to your needs, but keep original structure and field names, so that bot could use questions) - Run
npm start
to start bot. - If you don't see any errors in console try to write a message to your bot (
/start
)
- You can get test net client and claim some testnet bytes for testing here
- When you start bot it starts headless-byteball
- Here is a fix for connecting headless-byteball to testnet
- To transfer bytes to headless wallet you could use these instructions
- If you have trouble with pairing with remote device you could try to use this code to get wallet address
Be careful because it will throw errors if there are more than one wallet or addresses
headlessWallet.readSingleWallet(wallet => { console.log(`Quiz bot wallet: '${wallet}'`); headlessWallet.readSingleAddress(address => { console.log(`Quiz bot wallet address: '${address}'`); }); });
When you start bot with npm start
you will be asked to provide passphrase for bot wallet.
You can check out testnet-index.js
script in app root where you can see example of how to start bot with providing passphrase
from file.
WARNING! It is not recomended way of running bot because of security reason. Make sure you understand what you are doing before sending funds to such setup.