Wednesday, January 4, 2017

Create Telegram Bot

Create Telegram Bot


1. Search: BotFather (@BotFather)
/newbot

vnkk001_bot

After create the new bot we will got API similar the below format:
Use this token to access the HTTP API:
1122334455:AAbbCCddEEff1122334455

/setdescription

/setjointgroups

Check the API Info:
https://api.telegram.org/bot1122334455:AAbbCCddEEff1122334455/getme

Check the API Chat:
https://api.telegram.org/bot1122334455:AAbbCCddEEff1122334455/getupdates

Chat from Broswer:
https://api.telegram.org/bot1122334455:AAbbCCddEEff1122334455/sendmessage?chat_id=154066828&text=TestMSG001

Why need to have BOT?
You can create as many BOT as you want and make it work for you as our robot.

In my case I create one to alert me once something went wrong,
I integrated with Nagios with the bot API as mentions above.

1. Create new bot, I named it:  Nagios_Alert

2. Add bot to a group (what ever you want and add other member as you want to)

3. Integrated with Nagios, by send the message as bot user to post the message,

So all the members will see the message in the group.