bitoven 30d0e4db59 Up Joystream type 4 năm trước cách đây
..
LICENSE e15c6b21b5 Add files via upload 4 năm trước cách đây
README.md e15c6b21b5 Add files via upload 4 năm trước cách đây
channel.js e15c6b21b5 Add files via upload 4 năm trước cách đây
council.js e15c6b21b5 Add files via upload 4 năm trước cách đây
forum.js e15c6b21b5 Add files via upload 4 năm trước cách đây
package.json 30d0e4db59 Up Joystream type 4 năm trước cách đây
proposal.js e15c6b21b5 Add files via upload 4 năm trước cách đây

README.md

Joystream Forum Post Notification Tool

Many thanks to imOnlineMonitor for providing example with polkadot chain (Kusama).\ This script will notify several events on Joystream chain to Telegram group/channel/chat of your choice.\ Current demo is https://t.me/jsforumnotification

Getting Started

Requirements

Joystream Node\ Yarn and Nodejs

Run

   git clone https://github.com/bitoven-dev/joystreamtelegrambot
   cd joystreamtelegrambot
   yarn install

Replace yourowntoken on const token = 'yourtoken'; with your Telgram bot token. You can get it by talking to @botfather

Replace yourownchat on const chatid = 'yourchatid'; with your group/channel the bot will notify into. Bot needs to be added as admin, but it only needs to post message permission. 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 dummy message to the bot.
You can use this example: /my_id @my_bot
(I tried a few messages, not all the messages work. The example above works fine. Maybe the message should start with /)

3- Go to following url: 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 (with the negative sign). 

Run node yourchoiceofscript.js preferably inside screen/tmux window or systemd

License

GPLv3

Notes

I've just started to learn programming (JS), so any suggestions or PR is greatly appreciated 😁