From 3c44c5083ba42979b6dccaf531eeb4883a003bdc Mon Sep 17 00:00:00 2001 From: Amele9 Date: Tue, 28 Feb 2023 10:38:45 +0500 Subject: [PATCH] README updates --- README.md | 21 +++++++++------------ README_RU.md | 21 +++++++++------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 863344f..4080999 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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) }) ``` diff --git a/README_RU.md b/README_RU.md index 66e6453..6ad7f11 100644 --- a/README_RU.md +++ b/README_RU.md @@ -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 ``` @@ -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) }) ```