- Go to Grafana > Alerting > Notification channels > New channel.
- Type: Telegram. It will ask you for a Bot API Token and a Chat ID.
- Open a chat with BotFather on Telegram.
- Type
/newbot - Type your bots name. e.g.
Grafana Bot - Type your bots username. e.g.
a_new_grafana_bot - You get your Bot API Token. Paste it on Grafana.
- Before making getUpdates (in the next step) you should add your bot into your telegram client and run
/start. Thus you start chatting with the bot and this room is assigned chat id. (Thanks to @KES777)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.stdin.resume() | |
| process.stdin.setEncoding('utf8') | |
| console.log('what\'s your age ?') | |
| process.stdin.on('data', (age) => { | |
| if (age >= 99) { | |
| console.log('Your must be under 100') | |
| } | |
| else if (isNaN(age)) { | |
| console.log('You must specify an age'); |