Documentation
¶
Index ¶
- Variables
- type Audio
- type Bot
- func (b *Bot) ForwardMessage(chat_id, from_chat_id, message_id int) (Message, error)
- func (b *Bot) GetMe() User
- func (b *Bot) GetUpdates(offset int, limit int, timeout int) []Update
- func (b *Bot) Listen()
- func (b *Bot) SendMessage(chat_id int, text string, disable_web_page_preview bool, ...) (Message, error)
- func (b *Bot) SendPhoto(chat_id int, photo []byte, caption string) (Message, error)
- func (b *Bot) SetWebhook(webhookUrl string)
- type Contact
- type Document
- type ForceReply
- type GroupChat
- type InputFile
- type Location
- type Message
- type PhotoSize
- type ReplyKeyboardHide
- type ReplyKeyboardMarkup
- type Response
- type Sticker
- type Update
- type User
- type UserProfilePhotos
- type Video
Constants ¶
This section is empty.
Variables ¶
View Source
var BaseURL string = "https://api.telegram.org/bot%s/%s?%s"
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct {
FileId string `json:"file_id"` //Unique identifier for this file
Duration int `json:"duration"` //Duration of the audio in seconds as defined by sender
MimeType string `json:"mime_type"` //Optional. MIME type of the file as defined by sender
FileSize int `json:"file_size"` //Optional. File size
}
type Bot ¶
type Bot struct {
Updates chan Update
// contains filtered or unexported fields
}
func (*Bot) ForwardMessage ¶
func (*Bot) SendMessage ¶
func (*Bot) SetWebhook ¶
type Document ¶
type Document struct {
FileId string `json:"file_id"` //Unique file identifier
Thumb PhotoSize `json:"thumb"` //Optional. Document thumbnail as defined by sender
FileName int `json:"file_name"` //Optional. Original filename as defined by sender
MimeType string `json:"mime_type"` //Optional. MIME type of the file as defined by sender
FileSize int `json:"file_size"` //Optional. File size
}
type ForceReply ¶
type Message ¶
type Message struct {
MessageID int `json:"message_id"` //Unique message identifier
From User `json:"from"` //Sender
Date int `json:"date"` //Date the message was sent in Unix time
Chat json.RawMessage `json:"chat"` //Conversation the message belongs to — user in case of a private message, GroupChat in case of a group
ForwardFrom User `json:"forward_from"` //Optional. For forwarded messages, sender of the original message
ForwardDate int `json:"forward_date"` //Optional. For forwarded messages, date the original message was sent in Unix time
ReplyToMessage *Message `json:"reply_to_message"` //Optional. For replies, the original message.
Text string `json:"text"` //Optional. For text messages, the actual UTF-8 text of the message
Audio Audio `json:"audio"` //Optional. Message is an audio file, information about the file
Document Document `json:"document"` //Optional. Message is a general file, information about the file
Photo []PhotoSize `json:"photo"` //Optional. Message is a photo, available sizes of the photo
Sticker Sticker `json:"sticker"` //Optional. Message is a sticker, information about the sticker
Video Video `json:"video"` //Optional. Message is a video, information about the video
Caption string `json:"caption"` //Optional. Caption for the photo or video
Contact Contact `json:"contact"` //Optional. Message is a shared contact, information about the contact
Location Location `json:"location"` //Optional. Message is a shared location, information about the location
NewChatParticipant User `json:"new_chat_participant"` //Optional. A new member was added to the group, information about them (this member may be bot itself)
LeftChatParticipant User `json:"left_chat_participant"` //Optional. A member was removed from the group, information about them (this member may be bot itself)
NewChatTitle string `json:"new_chat_title"` //Optional. A group title was changed to this value
NewChatPhoto []PhotoSize `json:"new_chat_photo"` //Optional. A group photo was change to this value
DeleteChatPhoto bool `json:"delete_chat_photo"` //Optional. Informs that the group photo was deleted
GroupChatCreated bool `json:"group_chat_created"` //Optional. Informs that the group has been created
}
type ReplyKeyboardHide ¶
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct {
Keyboard [][]string `json:"keyboard"` //Array of button rows, each represented by an Array of Strings
ResizeKeyboard bool `json:"resize_keyboard"` //Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). OneTimeKeyboard bool `json:"one_time_keyboard"` //Optional. Requests clients to hide the keyboard as soon as it's been used. Defaults to false.
Selective bool `json:"selective"` //Optional. Use this parameter if you want to show the keyboard to specific users only.
}
type Response ¶
type Response struct {
Ok bool `json:"ok"`
Description string `json:"description"`
Result json.RawMessage `json:"result"`
ErrorCode int `json:"error_code"`
}
type Sticker ¶
type Sticker struct {
FileId string `json:"file_id"` //Unique identifier for this file
Width int `json:"width"` //Sticker width
Height int `json:"height"` //Sticker height
Thumb PhotoSize `json:"thumb"` //Optional. Sticker thumbnail in .webp or .jpg format
FileSize int `json:"file_size"` //Optional. File size
}
type UserProfilePhotos ¶
type Video ¶
type Video struct {
FileId string `json:"file_id"` //Unique identifier for this file
Width int `json:"width"` //Video width as defined by sender
Height int `json:"height"` //Video height as defined by sender
Duration int `json:"duration"` //Duration of the video in seconds as defined by sender
Thumb PhotoSize `json:"thumb"` //Optional. Video thumbnail
MimeType string `json:"mime_type"` //Optional. Mime type of a file as defined by sender
FileSize int `json:"file_size"` //Optional. File size
}
Click to show internal directories.
Click to hide internal directories.