1
0
mirror of synced 2024-11-25 13:16:02 +03:00

Merge pull request #13 from gwinn/master

External chat ID
This commit is contained in:
Alex Lushpai 2018-06-01 18:20:41 +03:00 committed by GitHub
commit 97a88566a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View File

@ -482,17 +482,6 @@ func createHandler(w http.ResponseWriter, r *http.Request) {
w.Write(jss) 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) { func activityHandler(w http.ResponseWriter, r *http.Request) {
setLocale(r.Header.Get("Accept-Language")) setLocale(r.Header.Get("Accept-Language"))
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
@ -524,7 +513,7 @@ func activityHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
var rec ActivityCallback var rec v5.ActivityCallback
err = json.Unmarshal(body, &rec) err = json.Unmarshal(body, &rec)
if err != nil { if err != nil {

View File

@ -101,7 +101,8 @@ func telegramWebhookHandler(w http.ResponseWriter, r *http.Request, token string
Lastname: update.Message.From.LastName, Lastname: update.Message.From.LastName,
Language: update.Message.From.LanguageCode, 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) data, st, err := client.Messages(snd)