Documentation
¶
Index ¶
- func ExampleGetUpdates()
- func ExampleSendMessage()
- func ExampleSetWebhook()
- func GetFile(botToken string, filePath string) (io.ReadCloser, error)
- func GetUpdates(botToken string, offset string) (*[]Update, error)
- func SetWebhook(botToken string, webhookURL string) error
- type Chat
- type File
- type GetFileResponseBody
- type GetUpdatesResponseBody
- type Location
- type Message
- type SendMessageRequestBody
- type SendMessageResponseBody
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExampleGetUpdates ¶
func ExampleGetUpdates()
func ExampleSendMessage ¶
func ExampleSendMessage()
func ExampleSetWebhook ¶
func ExampleSetWebhook()
func GetFile ¶
func GetFile(botToken string, filePath string) (io.ReadCloser, error)
GetFile retrieves the file by filePath from telegram API
func GetUpdates ¶
GetUpdates retrieves incoming updates using long polling
func SetWebhook ¶
SetWebhook sets the webhook URL for the telegram bot. Setting an empty url will remove the webhook integration
Types ¶
type Chat ¶
type Chat struct {
ID uint64 `json:"id"`
Username string `json:"username,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
}
Chat defines the structure of chat object
type GetFileResponseBody ¶ added in v0.0.3
GetFileResponseBody defines the structure of the body returned by the getFile method of the telegram API
type GetUpdatesResponseBody ¶
GetUpdatesResponseBody defines the structure of the body returned by the getUpdates method of the telegram API
type Location ¶
type Location struct {
Longitude float64 `json:"longitude,omitempty"`
Latitude float64 `json:"latitude,omitempty"`
}
Location defines the structure of location object
type Message ¶
type Message struct {
MessageID uint64 `json:"message_id"`
Chat *Chat `json:"chat"`
Text string `json:"text,omitempty"`
Audio *File `json:"audio,omitempty"`
Document *File `json:"document,omitempty"`
Photo *[]File `json:"photo,omitempty"`
Video *File `json:"video,omitempty"`
Voice *File `json:"voice,omitempty"`
VideoNote *File `json:"video_note,omitempty"`
Caption string `json:"caption,omitempty"`
Animation *File `json:"animation,omitempty"`
Location *Location `json:"location,omitempty"`
}
Message defines the structure of message object
type SendMessageRequestBody ¶
SendMessageRequestBody defines the request body structure required for the `sendMessage` method for the telegram API
type SendMessageResponseBody ¶
SendMessageResponseBody defines the structure of the body returned by the `sendMessage` method of the telegram API