Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BotID ¶ added in v1.15.14
BotID extracts the public bot identifier from a bot token, which Telegram formats as "<bot_id>:<secret>". The secret half must never leave the server, so a token without that shape is rejected instead of being pasted into a browser-facing URL.
func BuildTelegramOAuthURL ¶ added in v1.15.14
BuildTelegramOAuthURL is GenerateTelegramOAuthURL with the failure reason preserved, so callers can log why no URL could be produced.
func GenerateTelegramOAuthURL ¶
GenerateTelegramOAuthURL generates a URL for Telegram OAuth
Types ¶
type AuthData ¶
type AuthData struct {
Id *int64 `json:"id,omitempty"`
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Username *string `json:"username,omitempty"`
PhotoUrl *string `json:"photo_url,omitempty"`
AuthDate *int64 `json:"auth_date,omitempty"`
Hash *string `json:"hash,omitempty"`
// contains filtered or unexported fields
}
func ParseAndValidateBase64 ¶
ParseAndValidateBase64 parses base64 content for AuthData and validates it
func ParseAndValidateJson ¶
ParseAndValidateJson parses json content for AuthData and validates it
func ParseAuthDataBase64 ¶
ParseAuthDataBase64 decodes provided content from base64 and parses result for AuthData. Telegram's tgAuthResult reaches us in whichever base64 flavour the widget and the surrounding URL handling produced, so all four combinations of alphabet (standard or URL-safe) and padding are accepted.
func ParseAuthDataJson ¶
ParseAuthDataJson parses provided json content for AuthData