Many thanks to imOnlineMonitor for providing example with polkadot chain (Kusama).
This script will notify any new post on Joystream forum to Telegram group/channel/chat of your choice.
Current demo is https://t.me/jsforumnotification
-
git clone https://github.com/bitoven-dev/jsforumnotif cd jsforumnotif yarn install -
Replace
yourtokenonconst token = 'yourtoken';with your Telgram bot token. You can get it by talking to @botfather
You can edit fast using sed (change yourowntoken)
sed -i -e 's/yourtoken/yourowntoken/g' index.js -
Replace
yourchatidonconst chatid = 'yourchatid';with your group/channel the bot will notify into. How to get chatid
You can edit fast using sed (change yourownchatid)
sed -i -e 's/yourchatid/yourownchatid/g' index.js -
Optional. Change value
let lastnotif = 242;. Don't put it too far from current post id though. -
Run
node index.js
I've just started to learn JS, so any suggestion or PR is greatly appreciated 😁