all repos — telegram-bot-api @ a7b8af6adbdae556dab8deca6d6560961eb41f24

Golang bindings for the Telegram Bot API

responses.go (view raw)

  1package main
  2
  3import (
  4	"encoding/json"
  5)
  6
  7type ApiResponse struct {
  8	Ok     bool            `json:"ok"`
  9	Result json.RawMessage `json:"result"`
 10}
 11
 12type Update struct {
 13	UpdateId int     `json:"update_id"`
 14	Message  Message `json:"message"`
 15}
 16
 17type User struct {
 18	Id        int    `json:"id"`
 19	FirstName string `json:"first_name"`
 20	LastName  string `json:"last_name"`
 21	UserName  string `json:"username"`
 22}
 23
 24type GroupChat struct {
 25	Id    int    `json:"id"`
 26	Title string `json:"title"`
 27}
 28
 29type UserOrGroupChat struct {
 30	Id        int    `json:"id"`
 31	FirstName string `json:"first_name"`
 32	LastName  string `json:"last_name"`
 33	UserName  string `json:"username"`
 34	Title     string `json:"title"`
 35}
 36
 37type Message struct {
 38	MessageId           int             `json:"message_id"`
 39	From                User            `json:"from"`
 40	Date                int             `json:"date"`
 41	Chat                UserOrGroupChat `json:"chat"`
 42	ForwardFrom         User            `json:"forward_from"`
 43	ForwardDate         int             `json:"forward_date"`
 44	ReplyToMessage      *Message        `json:"reply_to_message"`
 45	Text                string          `json:"text"`
 46	Audio               Audio           `json:"audio"`
 47	Document            Document        `json:"document"`
 48	Photo               []PhotoSize     `json:"photo"`
 49	Sticker             Sticker         `json:"sticker"`
 50	Video               Video           `json:"video"`
 51	Contact             Contact         `json:"contact"`
 52	Location            Location        `json:"location"`
 53	NewChatParticipant  User            `json:"new_chat_participant"`
 54	LeftChatParticipant User            `json:"left_chat_participant"`
 55	NewChatTitle        string          `json:"new_chat_title"`
 56	NewChatPhoto        string          `json:"new_chat_photo"`
 57	DeleteChatPhoto     bool            `json:"delete_chat_photo"`
 58	GroupChatCreated    bool            `json:"group_chat_created"`
 59}
 60
 61type PhotoSize struct {
 62	FileId   string `json:"file_id"`
 63	Width    int    `json:"width"`
 64	Height   int    `json:"height"`
 65	FileSize int    `json:"file_size"`
 66}
 67
 68type Audio struct {
 69	FileId   string `json:"file_id"`
 70	Duration int    `json:"duration"`
 71	MimeType string `json:"mime_type"`
 72	FileSize int    `json:"file_size"`
 73}
 74
 75type Document struct {
 76	FileId   string    `json:"file_id"`
 77	Thumb    PhotoSize `json:"thumb"`
 78	FileName string    `json:"file_name"`
 79	MimeType string    `json:"mime_type"`
 80	FileSize int       `json:"file_size"`
 81}
 82
 83type Sticker struct {
 84	FileId   string    `json:"file_id"`
 85	Width    int       `json:"width"`
 86	Height   int       `json:"height"`
 87	Thumb    PhotoSize `json:"thumb"`
 88	FileSize int       `json:"file_size"`
 89}
 90
 91type Video struct {
 92	FileId   string    `json:"file_id"`
 93	Width    int       `json:"width"`
 94	Height   int       `json:"height"`
 95	Duration int       `json:"duration"`
 96	Thumb    PhotoSize `json:"thumb"`
 97	MimeType string    `json:"mime_type"`
 98	FileSize int       `json:"file_size"`
 99	Caption  string    `json:"caption"`
100}
101
102type Contact struct {
103	PhoneNumber string `json:"phone_number"`
104	FirstName   string `json:"first_name"`
105	LastName    string `json:"last_name"`
106	UserId      string `json:"user_id"`
107}
108
109type Location struct {
110	Longitude float32 `json:"longitude"`
111	Latitude  float32 `json:"latitude"`
112}
113
114type UserProfilePhotos struct {
115	TotalCount int         `json:"total_count"`
116	Photos     []PhotoSize `json:"photos"`
117}
118
119type ReplyKeyboardMarkup struct {
120	Keyboard        map[string]map[string]string `json:"keyboard"`
121	ResizeKeyboard  bool                         `json:"resize_keyboard"`
122	OneTimeKeyboard bool                         `json:"one_time_keyboard"`
123	Selective       bool                         `json:"selective"`
124}
125
126type ReplyKeyboardHide struct {
127	HideKeyboard bool `json:"hide_keyboard"`
128	Selective    bool `json:"selective"`
129}
130
131type ForceReply struct {
132	ForceReply bool `json:"force_reply"`
133	Selective  bool `json:"force_reply"`
134}