all repos — telegram-bot-api @ 3fbd77ce76edcd2f439f1f961d22c0ffeb02d927

Golang bindings for the Telegram Bot API

Adds paspport update type
Travis Reeder treeder@gmail.com
Fri, 21 Sep 2018 13:26:47 -0400
commit

3fbd77ce76edcd2f439f1f961d22c0ffeb02d927

parent

2326345451850fb4504d464e365d1b5490bc5072

1 files changed, 0 insertions(+), 23 deletions(-)

jump to
M passport.gopassport.go

@@ -1,34 +1,11 @@

package tgbotapi -import ( - "encoding/json" - "fmt" - "net/url" - "strconv" -) - // PassportRequestInfoConfig allows you to request passport info type PassportRequestInfoConfig struct { BotID int `json:"bot_id"` Scope *PassportScope `json:"scope"` Nonce string `json:"nonce"` PublicKey string `json:"public_key"` -} - -func LinkToPassportRequest(config PassportRequestInfoConfig) (string, error) { - scope, err := json.Marshal(config.Scope) - if err != nil { - panic("couldn't pack scope") - } - tgurl := fmt.Sprintf("tg://resolve?domain=telegrampassport&bot_id=%v&scope=%v&public_key=%v&nonce=%v", - strconv.Itoa(config.BotID), - url.PathEscape(string(scope)), - url.PathEscape(config.PublicKey), - url.PathEscape(config.Nonce), - ) - fmt.Println(tgurl) - - return tgurl, nil } type PassportScopeElement interface {