Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TelegramAPIEndpoint is the endpoint for all API method with formatting for Sprintf. TelegramAPIEndpoint = "https://api.telegram.org/bot%s/%s" // TelegramFileEndpoint is the endpoint for downloading a file from Telegram. TelegramFileEndpoint = "https://api.telegram.org/file/bot%s/%s" // TelegramHTTPMethod http method for request TelegramHTTPMethod = "POST" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a telegram api client.
type Response ¶
type Response struct { Ok bool `json:"ok"` Result json.RawMessage `json:"result"` ErrorCode int `json:"error_code"` Description string `json:"description"` Parameters *ResponseParameters `json:"parameters"` }
Response is a response from Telegram API with the result stored raw
type ResponseParameters ¶
type ResponseParameters struct { MigrateToChatID int64 `json:"migrate_to_chat_id"` // optional RetryAfter int `json:"retry_after"` // optional }
ResponseParameters are various errors that can be returned in APIResponse.
func (*ResponseParameters) String ¶
func (rp *ResponseParameters) String() string
Click to show internal directories.
Click to hide internal directories.