dependabot[bot] ffa526b6f0 Bump luxon from 1.28.0 to 1.28.1 in /scripts/joystreamtelegrambot (#870) | 1 year ago | |
---|---|---|
.. | ||
src | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
config.ts | 2 years ago | |
package.json | 1 year ago | |
tsconfig.json | 2 years ago | |
yarn.lock | 1 year ago |
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).
git clone https://github.com/joystream/community-repo
cd community-repo/community-contributions/joystreamtelegrambot
yarn
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
.
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).
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
Sends actual volume for Joystream Storage Providers to a channel every X hours or via PM with /storagesize
.
npm install
nodemon
npm install
npm install pm2@latest -g
or
yarn global add pm2
pm2 start --name storagesize node index.js
This Discord bot announces new video uploads.
git clone https://github.com/Joystream/community-repo
cd community-repo/community-contributions/joystreamvideobot
yarn && yarn run build
You should use the channnel id instead of it's name. How to get the channel id of a channel: 1- Open up your Discord Settings 2- Go to Appearance 3- Tick Developer Mode (And close the Discord settings) 4- Right click on your desired channel 5- Now there's an option Copy ID to copy the channel id
Open config.ts
and set channelId
.
Run yarn && yarn run build
to apply your changes.
Follow the procedure
TOKEN=<YOUR DISCORD TOOKEN HERE> node lib/src/bot.js
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
.
bitoven created the first version written in javascript.
Oct 2020: migration to typescript (l1dev)
2021: maintenance and more functions (l1dev)
Feb 2022: merged storagesizebot
(nexusfallout) and joystreamvideobot
(isonar)