Skip to content

Commit 7811234

Browse files
committed
README update
1 parent ec5c1a7 commit 7811234

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

README.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,78 @@ gamma_errors:
4949
telegram_channel:
5050
auth_key: '%env(GAMMA_ERRORS_TELEGRAM_AUTH_KEY)%'
5151
chat_id: "%env(GAMMA_ERRORS_TELEGRAM_CHAT_ID)%"
52-
````
52+
````
53+
54+
## 3. Creating a bot
55+
56+
Start a conversation with @BotFather.
57+
58+
````
59+
You: /newbot
60+
>>>>>>>>>>
61+
@BotFather: Alright, a new bot. How are we going to call it? Please choose a name for your bot.
62+
<<<<<<<<<<
63+
You: Sample Error Bot
64+
>>>>>>>>>>
65+
@BotFather: Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example:
66+
TetrisBot or tetris_bot.
67+
<<<<<<<<<<
68+
Me: test_error_bot
69+
>>>>>>>>>>
70+
@BotFather: Done! Congratulations on your new bot. You will find it at telegram.me/cronus_bot. You can now add a
71+
description, about section and profile picture for your bot, see /help for a list of commands. By the way, when
72+
you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure
73+
the bot is fully operational before you do this.
74+
75+
Use this token to access the HTTP API:
76+
111111:xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
77+
78+
For a description of the Bot API, see this page: https://core.telegram.org/bots/api
79+
````
80+
81+
## 4. Get chat identifier
82+
83+
After the created bot was added to your project's group you should retrieve its chat_id
84+
85+
Make POST request to URL: https://api.telegram.org/bot_token_/getUpdates
86+
87+
Example:
88+
89+
Request
90+
91+
````
92+
curl -X POST https://api.telegram.org/bot111111:xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getUpdates
93+
````
94+
95+
Response
96+
97+
````
98+
{
99+
"ok": true,
100+
"result": [
101+
{
102+
"update_id": 222222,
103+
"message": {
104+
"message_id": 3333,
105+
"from": {
106+
"id": 444444,
107+
"first_name": "Test",
108+
"last_name": "Test",
109+
"username": "test"
110+
},
111+
"chat": {
112+
"id": -111111
113+
"first_name": "Test",
114+
"last_name": "Test",
115+
"username": "test",
116+
"type": "private"
117+
},
118+
"date": 1480701504,
119+
"text": "test"
120+
}
121+
}
122+
]
123+
}
124+
````
125+
126+
chat_id is the number "-111111".

0 commit comments

Comments
 (0)