From f238d96f17f10f2667c49bb4d9795c4103b6003e Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Fri, 1 Jun 2018 17:58:49 +0300 Subject: [PATCH 1/2] move activity callback types out of project --- routing.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/routing.go b/routing.go index 435ed05..6926a21 100644 --- a/routing.go +++ b/routing.go @@ -482,17 +482,6 @@ func createHandler(w http.ResponseWriter, r *http.Request) { w.Write(jss) } -type ActivityCallback struct { - ClientId string `json:"clientId"` - Activity Activity `json:"activity"` - SystemUrl string `json:"systemUrl,omitempty"` -} - -type Activity struct { - Active bool `json:"active"` - Freeze bool `json:"freeze"` -} - func activityHandler(w http.ResponseWriter, r *http.Request) { setLocale(r.Header.Get("Accept-Language")) w.Header().Set("Content-Type", "application/json") @@ -524,7 +513,7 @@ func activityHandler(w http.ResponseWriter, r *http.Request) { return } - var rec ActivityCallback + var rec v5.ActivityCallback err = json.Unmarshal(body, &rec) if err != nil { From 0f2d0bb331e5eab8f654db84551f60d25c4b5c50 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Fri, 1 Jun 2018 18:17:47 +0300 Subject: [PATCH 2/2] add channel id --- telegram.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telegram.go b/telegram.go index f7afb89..9589a70 100644 --- a/telegram.go +++ b/telegram.go @@ -101,7 +101,8 @@ func telegramWebhookHandler(w http.ResponseWriter, r *http.Request, token string Lastname: update.Message.From.LastName, Language: update.Message.From.LanguageCode, }, - Channel: b.Channel, + Channel: b.Channel, + ExternalChatID: strconv.FormatInt(update.Message.Chat.ID, 10), } data, st, err := client.Messages(snd)