Skip to content

Commit

Permalink
README update
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenas committed Jul 22, 2018
1 parent ec5c1a7 commit 7811234
Showing 1 changed file with 75 additions and 1 deletion.
76 changes: 75 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,78 @@ gamma_errors:
telegram_channel:
auth_key: '%env(GAMMA_ERRORS_TELEGRAM_AUTH_KEY)%'
chat_id: "%env(GAMMA_ERRORS_TELEGRAM_CHAT_ID)%"
````
````

## 3. Creating a bot

Start a conversation with @BotFather.

````
You: /newbot
>>>>>>>>>>
@BotFather: Alright, a new bot. How are we going to call it? Please choose a name for your bot.
<<<<<<<<<<
You: Sample Error Bot
>>>>>>>>>>
@BotFather: Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example:
TetrisBot or tetris_bot.
<<<<<<<<<<
Me: test_error_bot
>>>>>>>>>>
@BotFather: Done! Congratulations on your new bot. You will find it at telegram.me/cronus_bot. You can now add a
description, about section and profile picture for your bot, see /help for a list of commands. By the way, when
you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure
the bot is fully operational before you do this.
Use this token to access the HTTP API:
111111:xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For a description of the Bot API, see this page: https://core.telegram.org/bots/api
````

## 4. Get chat identifier

After the created bot was added to your project's group you should retrieve its chat_id

Make POST request to URL: https://api.telegram.org/bot_token_/getUpdates

Example:

Request

````
curl -X POST https://api.telegram.org/bot111111:xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getUpdates
````

Response

````
{
"ok": true,
"result": [
{
"update_id": 222222,
"message": {
"message_id": 3333,
"from": {
"id": 444444,
"first_name": "Test",
"last_name": "Test",
"username": "test"
},
"chat": {
"id": -111111
"first_name": "Test",
"last_name": "Test",
"username": "test",
"type": "private"
},
"date": 1480701504,
"text": "test"
}
}
]
}
````

chat_id is the number "-111111".

0 comments on commit 7811234

Please sign in to comment.