Documentation ¶
Index ¶
- type Audio
- type Chat
- type Contact
- type Document
- type Keyboard
- type Location
- type Message
- type PhotoSize
- type SendMessageOptions
- type Sticker
- type TelegramBot
- func (b TelegramBot) ForwardMessage(chatID int64, fromChatID int64, messageID int64) (string, error)
- func (b TelegramBot) GetUpdates(offset int64, timeout int64) (Update, error)
- func (b TelegramBot) SendAudio(id int64, fileID string, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendDocument(id int64, fileID string, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendLocation(id int64, latitude float64, longitude float64, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendMessage(id int64, text string, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendPhoto(id int64, fileID string, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendSticker(id int64, fileID string, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendVideo(id int64, fileID string, options SendMessageOptions) (string, error)
- func (b TelegramBot) SendVoice(id int64, fileID string, options SendMessageOptions) (string, error)
- type Update
- type UpdateItem
- type User
- type Video
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keyboard ¶
type Keyboard struct { Layout [][]string `json:"keyboard"` Consumable bool `json:"one_time_keyboard"` }
Keyboard allows you to specify a specific keyboard layout to respond with
type Message ¶
type Message struct { Chat Chat `json:"chat"` Date int64 `json:"date"` From User `json:"from"` ID int64 `json:"message_id"` Text string `json:"text"` Sticker Sticker `json:"sticker"` Location Location `json:"location"` Document Document `json:"document"` Photo []PhotoSize `json:"photo"` Video Video `json:"video"` Contact Contact `json:"contact"` Audio Audio `json:"audio"` }
type SendMessageOptions ¶
type SendMessageOptions struct {
ReplyMarkup *Keyboard
}
SendMessageOptions allows you to define optional parameters
type TelegramBot ¶
type TelegramBot struct {
APIKey string
}
func New ¶
func New(key string) TelegramBot
func (TelegramBot) ForwardMessage ¶
func (b TelegramBot) ForwardMessage(chatID int64, fromChatID int64, messageID int64) (string, error)
ForwardMessage allows you to forward a message from one conversation to another
func (TelegramBot) GetUpdates ¶
func (b TelegramBot) GetUpdates(offset int64, timeout int64) (Update, error)
GetUpdates retrieves the latest updates from the Telegram servers
func (TelegramBot) SendAudio ¶
func (b TelegramBot) SendAudio(id int64, fileID string, options SendMessageOptions) (string, error)
SendAudio allows you to send audio to a specific target
func (TelegramBot) SendDocument ¶
func (b TelegramBot) SendDocument(id int64, fileID string, options SendMessageOptions) (string, error)
SendDocument allows you to send a document to a specific target
func (TelegramBot) SendLocation ¶
func (b TelegramBot) SendLocation(id int64, latitude float64, longitude float64, options SendMessageOptions) (string, error)
SendLocation allows you to send a location to a chat
func (TelegramBot) SendMessage ¶
func (b TelegramBot) SendMessage(id int64, text string, options SendMessageOptions) (string, error)
SendMessage allows you to send a message to a specific target
func (TelegramBot) SendPhoto ¶
func (b TelegramBot) SendPhoto(id int64, fileID string, options SendMessageOptions) (string, error)
SendPhoto allows you to send a photo to a specific target
func (TelegramBot) SendSticker ¶
func (b TelegramBot) SendSticker(id int64, fileID string, options SendMessageOptions) (string, error)
SendSticker allows you to send a sticker to a specific target
func (TelegramBot) SendVideo ¶
func (b TelegramBot) SendVideo(id int64, fileID string, options SendMessageOptions) (string, error)
SendVideo allows you to send a video to a specific target
func (TelegramBot) SendVoice ¶
func (b TelegramBot) SendVoice(id int64, fileID string, options SendMessageOptions) (string, error)
SendVoice allows you to send a voicemessage to a specific target
type Update ¶
type Update struct { Ok bool `json:"ok"` Result []UpdateItem `json:"result"` }