Skip to content

Commit c907bb3

Browse files
committed
Updated docs
1 parent e7a7af0 commit c907bb3

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ bot = GreenAPIBot(
4646
)
4747
```
4848

49+
### How to set up an instance
50+
51+
To start receiving incoming notifications, you need to set up an instance. Open the personal cabinet page at
52+
the [link](https://console.green-api.com/). Select an instance from the list and click on it. Click **Change**. In the *
53+
*Notifications** category, enable all notifications that you want to receive.
54+
4955
### How to start receiving and answering messages
5056

5157
To start receiving messages, you must create a handler function with one parameter (`notification`). The `notification`
@@ -60,6 +66,8 @@ brackets.
6066

6167
To start the bot, call the `bot.run_forever` function. You can stop the bot with the key combination Ctrl + C.
6268

69+
In this example, the bot will only answer the `message` message.
70+
6371
Link to example: [base.py](https://github.com/green-api/whatsapp-chatbot-python/blob/master/examples/base.py).
6472

6573
```
@@ -82,6 +90,8 @@ You can receive not only incoming messages but also outgoing messages. You can a
8290
The body of the notification is in `notification.event`. In this example, we get the message type from the notification
8391
body.
8492

93+
In this example, the bot receives all incoming messages.
94+
8595
Link to example: [event.py](https://github.com/green-api/whatsapp-chatbot-python/blob/master/examples/event.py).
8696

8797
```
@@ -163,6 +173,8 @@ command = ("help", "!/")
163173

164174
#### Example
165175

176+
In this example, the bot will send a photo in response to the `rates` command.
177+
166178
Link to example: [filters.py](https://github.com/green-api/whatsapp-chatbot-python/blob/master/examples/filters.py).
167179

168180
```
@@ -316,6 +328,8 @@ To send a text message, you have to use the `notification.answer` method.
316328
To send a location, you have to use the `sending.sendLocation` method from `notification.api`.
317329
To send a message with a file, you have to use the `notification.answer_with_file` method.
318330

331+
In this example, the bot only responds to commands from the list above.
332+
319333
Link to example: [full.py](https://github.com/green-api/whatsapp-chatbot-python/blob/master/examples/full.py).
320334

321335
```python

docs/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ bot = GreenAPIBot(
4545
)
4646
```
4747

48+
### Как настроить инстанс
49+
50+
Чтобы начать получать входящие уведомления, нужно настроить инстанс. Открываем страницу личного кабинета
51+
по [ссылке](https://console.green-api.com/). Выбираем инстанс из списка и кликаем на него. Нажимаем **Изменить**. В
52+
категории **Уведомления** включаем все что необходимо получать.
53+
4854
### Как начать получать сообщения и отвечать на них
4955

5056
Чтобы начать получать сообщения, вам нужно создать функцию-обработчик с одним параметром (`notification`).
@@ -59,6 +65,8 @@ bot = GreenAPIBot(
5965
Чтобы запустить бота, нужно вызвать функцию `bot.run_forever`.
6066
Остановить бота можно с помощью сочетания клавиш Ctrl + C.
6167

68+
В этом примере бот ответит только на сообщение `message`.
69+
6270
Ссылка на пример: [base.py](../examples/base.py).
6371

6472
```
@@ -80,6 +88,8 @@ bot.run_forever()
8088

8189
Тело уведомления находится в `notification.event`. В этом примере мы отправляем в консоль тело нового уведомления.
8290

91+
В этом примере бот получает все входящие сообщения.
92+
8393
Ссылка на пример: [event.py](../examples/event.py).
8494

8595
```
@@ -162,6 +172,8 @@ command = ("help", "!/")
162172

163173
#### Пример
164174

175+
В этом примере бот отправит фотографию в ответ на команду `rates`.
176+
165177
Ссылка на пример: [filters.py](../examples/filters.py).
166178

167179
```
@@ -315,6 +327,8 @@ bot.run_forever()
315327
Чтобы отправить место (локацию), нужно использовать метод `sending.sendLocation` из `notification.api`.
316328
Чтобы отправить сообщение с файлом, нужно использовать метод `notification.answer_with_file`.
317329

330+
В этом примере бот отвечает только на комманды из списка выше.
331+
318332
Ссылка на пример: [full.py](../examples/full.py).
319333

320334
```python

0 commit comments

Comments
 (0)