Skip to content

Commit

Permalink
README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Amele9 committed Feb 28, 2023
1 parent 30131cc commit 3c44c50
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ the REST API, so the documentation at the link above applies to the library itse

## Installation

Do not forget to create a module:

```shell
go mod init example
```

Installation:

```shell
go get github.com/green-api/whatsapp-api-client-golang
```
Expand Down Expand Up @@ -120,18 +128,7 @@ GreenAPIWebhook := webhook.GreenAPIWebhook{
}
GreenAPIWebhook.Start(func(body map[string]interface{}) {
typeWebhook := body["typeWebhook"]
if typeWebhook == "incomingMessageReceived" {
senderData := body["senderData"]
chatId := senderData.(map[string]interface{})["chatId"]
response, _ := GreenAPI.Methods().Sending().SendMessage(map[string]interface{}{
"chatId": chatId,
"message": "Any message",
})
GreenAPIWebhook.Stop()
}
fmt.Println(body)
})
```

Expand Down
21 changes: 9 additions & 12 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ whatsapp-api-client-golang - библиотека на Go, созданная д

## Установка

Не забудьте создать модуль:

```shell
go mod init example
```

Установка:

```shell
go get github.com/green-api/whatsapp-api-client-golang
```
Expand Down Expand Up @@ -118,18 +126,7 @@ GreenAPIWebhook := webhook.GreenAPIWebhook{
}
GreenAPIWebhook.Start(func(body map[string]interface{}) {
typeWebhook := body["typeWebhook"]
if typeWebhook == "incomingMessageReceived" {
senderData := body["senderData"]
chatId := senderData.(map[string]interface{})["chatId"]
response, _ := GreenAPI.Methods().Sending().SendMessage(map[string]interface{}{
"chatId": chatId,
"message": "Any message",
})
GreenAPIWebhook.Stop()
}
fmt.Println(body)
})
```

Expand Down

0 comments on commit 3c44c50

Please sign in to comment.