Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Making setup instructions easier to understand
Browse files Browse the repository at this point in the history
Making setup instructions easier to understand
  • Loading branch information
BigRedBrent committed Nov 12, 2018
1 parent 6a2d997 commit 55f9334
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bundles/action/org.openhab.action.telegram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,22 @@ As described in the Telegram Bot API, this is the manual procedure needed in ord
1. Create the Bot and get the Token

- On a Telegram client open a chat with BotFather.
- write `/newbot` to BotFather, fill all the needed information, write down the token. This is the authentication token needed.
- Send `/newbot` to BotFather, fill all the needed information, write down the token. This is the authentication token needed.

2. Create the destination chat and get the chatId
2. Create the destination chat

- Open a chat with your new Bot and send any message to it. The next step will not work unless you send a message to your bot first.

3. Get the chatId

- Open a new chat with your new Bot and post a message on the chat
- Open a browser and invoke `https://api.telegram.org/bot<token>/getUpdates` (where `<token>` is the authentication token previously obtained)
- Look at the JSON result and write down the value of `result[0].message.chat.id`. That is the chatId. Note that Telegram group chat chatIds are prefixed with a dash "-" that must be included in the config file. (e.g. bot1.chatId: -22334455)
- Look at the JSON result and write down the value behind "id": That is the chatId. Note that if useing a Telegram group chat, the group chatIds are prefixed with a dash "-" that must be included in the config file. (e.g. bot1.chatId: -22334455)

4. Test the bot

- Open this URL in your webbrowser, replacing <token> with the authentication token and <chatId> with the chatId:
- https://api.telegram.org/bot<token>/sendMessage?chat_id=<chatId>&text=testing
- Your Telegram-bot should send you a message with the text testing

## Actions

Expand Down

0 comments on commit 55f9334

Please sign in to comment.