77 lines
2.1 KiB
Go
77 lines
2.1 KiB
Go
package telegram
|
|
|
|
type Update struct {
|
|
UpdateID int `json:"update_id"`
|
|
Message *Message `json:"message,omitempty"`
|
|
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
|
|
}
|
|
|
|
type User struct {
|
|
ID int64 `json:"id"`
|
|
IsBot bool `json:"is_bot"`
|
|
FirstName string `json:"first_name,omitempty"`
|
|
Username string `json:"username,omitempty"`
|
|
}
|
|
|
|
type Chat struct {
|
|
ID int64 `json:"id"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type Message struct {
|
|
MessageID int `json:"message_id"`
|
|
From *User `json:"from,omitempty"`
|
|
Chat Chat `json:"chat"`
|
|
Text string `json:"text,omitempty"`
|
|
Caption string `json:"caption,omitempty"`
|
|
Document *Document `json:"document,omitempty"`
|
|
Photo []PhotoSize `json:"photo,omitempty"`
|
|
PinnedMessage *Message `json:"pinned_message,omitempty"`
|
|
}
|
|
|
|
type Document struct {
|
|
FileID string `json:"file_id"`
|
|
FileName string `json:"file_name,omitempty"`
|
|
MimeType string `json:"mime_type,omitempty"`
|
|
FileSize int64 `json:"file_size,omitempty"`
|
|
}
|
|
|
|
type PhotoSize struct {
|
|
FileID string `json:"file_id"`
|
|
FileSize int64 `json:"file_size,omitempty"`
|
|
Width int `json:"width"`
|
|
Height int `json:"height"`
|
|
}
|
|
|
|
type CallbackQuery struct {
|
|
ID string `json:"id"`
|
|
From User `json:"from"`
|
|
Message *Message `json:"message,omitempty"`
|
|
Data string `json:"data,omitempty"`
|
|
}
|
|
|
|
type File struct {
|
|
FileID string `json:"file_id"`
|
|
FilePath string `json:"file_path,omitempty"`
|
|
FileSize int64 `json:"file_size,omitempty"`
|
|
}
|
|
|
|
type InlineKeyboardMarkup struct {
|
|
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
|
|
}
|
|
|
|
type InlineKeyboardButton struct {
|
|
Text string `json:"text"`
|
|
CallbackData string `json:"callback_data,omitempty"`
|
|
}
|
|
|
|
type SendMessageOptions struct {
|
|
ParseMode string `json:"parse_mode,omitempty"`
|
|
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
type EditMessageTextOptions struct {
|
|
ParseMode string `json:"parse_mode,omitempty"`
|
|
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
|
}
|