func (c *Config) AuthCodeURL(lang language.Tag) string {
	origin, _ := url.Parse(c.RedirectURL)
	u := http.AcquireURI()
	defer http.ReleaseURI(u)
	u.Update(Endpoint)
	a := u.QueryArgs()
	a.Set("bot_id", c.ClientID())
	a.Set("origin", origin.Scheme+"://"+origin.Host)
	a.Add("embed", "0")
	if lang != language.Und {
		a.Set("lang", lang.String())
	}
	if c.RequestWriteAccess {
		a.Set("request_access", "write")
	}
	return u.String()
}
AuthCodeURL returns a URL to Telegram login page that asks for permissions for the required scopes explicitly.
package login
import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"net/url"
	"strings"
	http "github.com/valyala/fasthttp"
	"golang.org/x/text/language"
)
type (
	Config struct {
		ClientSecret string
		RedirectURL string
		RequestWriteAccess bool
	}
	User struct {
		AuthDate  int64  `json:"auth_date"`
		FirstName string `json:"first_name"`
		Hash      string `json:"hash"`
		ID        int    `json:"id"`
		LastName  string `json:"last_name,omitempty"`
		PhotoURL  string `json:"photo_url,omitempty"`
		Username  string `json:"username,omitempty"`
	}
)
const Endpoint string = "https://oauth.telegram.org/auth"
const (
	KeyAuthDate  string = "auth_date"
	KeyFirstName string = "first_name"
	KeyHash      string = "hash"
	KeyID        string = "id"
	KeyLastName  string = "last_name"
	KeyPhotoURL  string = "photo_url"
	KeyUsername  string = "username"
)
func (c Config) ClientID() string {
	return strings.SplitN(c.ClientSecret, ":", 2)[0]
}