Joystream Stats 4156eda901 string improvements 3 tahun lalu
..
src 4156eda901 string improvements 3 tahun lalu
LICENSE e15c6b21b5 Add files via upload 4 tahun lalu
README.md 9e026e12c5 bot: update README and tests 3 tahun lalu
config.ts 67d2054b3b bot: heartbeat fixes 3 tahun lalu
package.json 7a8971a76f heartbeat: add token value 3 tahun lalu
tsconfig.json 373876ed1d migrate to typescript 3 tahun lalu

README.md

Joystream Forum Post Notification Tool

This bot notifies a Telegram chat about events on the Joystream chain.

Demo: https://t.me/JoyStreamOfficial

Many thanks to imOnlineMonitor for providing example with polkadot chain (Kusama).

Installation

Joystream Node\ npm/Nodejs

git clone https://github.com/joystream/community-repo
cd community-repo/community-contributions/joystreamtelegrambot
yarn

Configuration

Open config.ts and fill in the variables:

  • token: To get a bot token talk to @botfather on Telegram.
  • chatid: See below to find id of your group.

Then run npm run start or yarn run start. Alternatively you can manually build with npm run build and run for example node dist/src/bot.js --verbose --channel --council --forum --proposals. For other options see below.

To test status of storage providers, add their domains to to storageProviders.ts.

Get chatid

Full explanation: How to get chatid

1- Add the bot to the group.
Go to the group, click on group name, click on Add members, in the searchbox search for your bot like this: @my_bot, select your bot and click add.

2- Send a message to the group.

3- Go to `https://api.telegram.org/botXXX:YYYY/getUpdates` (replace XXX:YYYY with your bot token)

4- Look for "chat":{"id":-zzzzzzzzzz,
-zzzzzzzzzz is your chat id (including the negative sign).

Run npm run start (for example inside screen/tmux window or systemd).

Running

Command Description
npm run start run without parameters.
npm run all like --channel --council --forum --proposals
npm run verbose like 'all', log information on every block
npm run quiet like 'all' without output
npm run channel only channel info
npm run forum only forum info
npm run council only council info
npm run proposals only proposal info
npm run [module]-verbose run [module] and log every block
npm run dev run all modules verbosely, respawn on file changes
npm run [module]-dev run [module] verbosely, respawn on file changes

If you need other combinations, add them to package.json

Development

To test api queries open https://testnet.joystream.org/ -> Settings -> change interface operation mode to Fully featured and got to https://testnet.joystream.org/#/chainstate.

License

GPLv3

Notes

  • bitoven created the first version written in javascript.

  • traumschule migrated and refactored it to typescript.