all repos — telegram-bot-api @ 2ff78b9568f0461c53b3897c7d553e89104a2c6a

Golang bindings for the Telegram Bot API

types.go (view raw)

   1package tgbotapi
   2
   3import (
   4	"encoding/json"
   5	"errors"
   6	"fmt"
   7	"net/url"
   8	"strings"
   9	"time"
  10)
  11
  12// APIResponse is a response from the Telegram API with the result
  13// stored raw.
  14type APIResponse struct {
  15	Ok          bool                `json:"ok"`
  16	Result      json.RawMessage     `json:"result,omitempty"`
  17	ErrorCode   int                 `json:"error_code,omitempty"`
  18	Description string              `json:"description,omitempty"`
  19	Parameters  *ResponseParameters `json:"parameters,omitempty"`
  20}
  21
  22// Error is an error containing extra information returned by the Telegram API.
  23type Error struct {
  24	Code    int
  25	Message string
  26	ResponseParameters
  27}
  28
  29// Error message string.
  30func (e Error) Error() string {
  31	return e.Message
  32}
  33
  34// Update is an update response, from GetUpdates.
  35type Update struct {
  36	// UpdateID is the update's unique identifier.
  37	// Update identifiers start from a certain positive number and increase
  38	// sequentially.
  39	// This ID becomes especially handy if you're using Webhooks,
  40	// since it allows you to ignore repeated updates or to restore
  41	// the correct update sequence, should they get out of order.
  42	// If there are no new updates for at least a week, then identifier
  43	// of the next update will be chosen randomly instead of sequentially.
  44	UpdateID int `json:"update_id"`
  45	// Message new incoming message of any kind — text, photo, sticker, etc.
  46	//
  47	// optional
  48	Message *Message `json:"message,omitempty"`
  49	// EditedMessage new version of a message that is known to the bot and was
  50	// edited
  51	//
  52	// optional
  53	EditedMessage *Message `json:"edited_message,omitempty"`
  54	// ChannelPost new version of a message that is known to the bot and was
  55	// edited
  56	//
  57	// optional
  58	ChannelPost *Message `json:"channel_post,omitempty"`
  59	// EditedChannelPost new incoming channel post of any kind — text, photo,
  60	// sticker, etc.
  61	//
  62	// optional
  63	EditedChannelPost *Message `json:"edited_channel_post,omitempty"`
  64	// MessageReaction is a reaction to a message was changed by a user.
  65	//
  66	// optional
  67	MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"`
  68	// MessageReactionCount reactions to a message with anonymous reactions were changed.
  69	//
  70	// optional
  71	MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"`
  72	// InlineQuery new incoming inline query
  73	//
  74	// optional
  75	InlineQuery *InlineQuery `json:"inline_query,omitempty"`
  76	// ChosenInlineResult is the result of an inline query
  77	// that was chosen by a user and sent to their chat partner.
  78	// Please see our documentation on the feedback collecting
  79	// for details on how to enable these updates for your bot.
  80	//
  81	// optional
  82	ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`
  83	// CallbackQuery new incoming callback query
  84	//
  85	// optional
  86	CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
  87	// ShippingQuery new incoming shipping query. Only for invoices with
  88	// flexible price
  89	//
  90	// optional
  91	ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"`
  92	// PreCheckoutQuery new incoming pre-checkout query. Contains full
  93	// information about checkout
  94	//
  95	// optional
  96	PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"`
  97	// Pool new poll state. Bots receive only updates about stopped polls and
  98	// polls, which are sent by the bot
  99	//
 100	// optional
 101	Poll *Poll `json:"poll,omitempty"`
 102	// PollAnswer user changed their answer in a non-anonymous poll. Bots
 103	// receive new votes only in polls that were sent by the bot itself.
 104	//
 105	// optional
 106	PollAnswer *PollAnswer `json:"poll_answer,omitempty"`
 107	// MyChatMember is the bot's chat member status was updated in a chat. For
 108	// private chats, this update is received only when the bot is blocked or
 109	// unblocked by the user.
 110	//
 111	// optional
 112	MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"`
 113	// ChatMember is a chat member's status was updated in a chat. The bot must
 114	// be an administrator in the chat and must explicitly specify "chat_member"
 115	// in the list of allowed_updates to receive these updates.
 116	//
 117	// optional
 118	ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"`
 119	// ChatJoinRequest is a request to join the chat has been sent. The bot must
 120	// have the can_invite_users administrator right in the chat to receive
 121	// these updates.
 122	//
 123	// optional
 124	ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"`
 125	// ChatBoostUpdated represents a boost added to a chat or changed.
 126	//
 127	// optional
 128	ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"`
 129	// ChatBoostRemoved represents a boost removed from a chat.
 130	//
 131	// optional
 132	ChatBoostRemoved *ChatBoostRemoved `json:"removed_chat_boost,omitempty"`
 133}
 134
 135// SentFrom returns the user who sent an update. Can be nil, if Telegram did not provide information
 136// about the user in the update object.
 137func (u *Update) SentFrom() *User {
 138	switch {
 139	case u.Message != nil:
 140		return u.Message.From
 141	case u.EditedMessage != nil:
 142		return u.EditedMessage.From
 143	case u.InlineQuery != nil:
 144		return u.InlineQuery.From
 145	case u.ChosenInlineResult != nil:
 146		return u.ChosenInlineResult.From
 147	case u.CallbackQuery != nil:
 148		return u.CallbackQuery.From
 149	case u.ShippingQuery != nil:
 150		return u.ShippingQuery.From
 151	case u.PreCheckoutQuery != nil:
 152		return u.PreCheckoutQuery.From
 153	default:
 154		return nil
 155	}
 156}
 157
 158// CallbackData returns the callback query data, if it exists.
 159func (u *Update) CallbackData() string {
 160	if u.CallbackQuery != nil {
 161		return u.CallbackQuery.Data
 162	}
 163	return ""
 164}
 165
 166// FromChat returns the chat where an update occurred.
 167func (u *Update) FromChat() *Chat {
 168	switch {
 169	case u.Message != nil:
 170		return &u.Message.Chat
 171	case u.EditedMessage != nil:
 172		return &u.EditedMessage.Chat
 173	case u.ChannelPost != nil:
 174		return &u.ChannelPost.Chat
 175	case u.EditedChannelPost != nil:
 176		return &u.EditedChannelPost.Chat
 177	case u.CallbackQuery != nil && u.CallbackQuery.Message != nil:
 178		return &u.CallbackQuery.Message.Chat
 179	default:
 180		return nil
 181	}
 182}
 183
 184// UpdatesChannel is the channel for getting updates.
 185type UpdatesChannel <-chan Update
 186
 187// Clear discards all unprocessed incoming updates.
 188func (ch UpdatesChannel) Clear() {
 189	for len(ch) != 0 {
 190		<-ch
 191	}
 192}
 193
 194// User represents a Telegram user or bot.
 195type User struct {
 196	// ID is a unique identifier for this user or bot
 197	ID int64 `json:"id"`
 198	// IsBot true, if this user is a bot
 199	//
 200	// optional
 201	IsBot bool `json:"is_bot,omitempty"`
 202	// IsPremium true, if user has Telegram Premium
 203	//
 204	// optional
 205	IsPremium bool `json:"is_premium,omitempty"`
 206	// AddedToAttachmentMenu true, if this user added the bot to the attachment menu
 207	//
 208	// optional
 209	AddedToAttachmentMenu bool `json:"added_to_attachment_menu,omitempty"`
 210	// FirstName user's or bot's first name
 211	FirstName string `json:"first_name"`
 212	// LastName user's or bot's last name
 213	//
 214	// optional
 215	LastName string `json:"last_name,omitempty"`
 216	// UserName user's or bot's username
 217	//
 218	// optional
 219	UserName string `json:"username,omitempty"`
 220	// LanguageCode IETF language tag of the user's language
 221	// more info: https://en.wikipedia.org/wiki/IETF_language_tag
 222	//
 223	// optional
 224	LanguageCode string `json:"language_code,omitempty"`
 225	// CanJoinGroups is true, if the bot can be invited to groups.
 226	// Returned only in getMe.
 227	//
 228	// optional
 229	CanJoinGroups bool `json:"can_join_groups,omitempty"`
 230	// CanReadAllGroupMessages is true, if privacy mode is disabled for the bot.
 231	// Returned only in getMe.
 232	//
 233	// optional
 234	CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"`
 235	// SupportsInlineQueries is true, if the bot supports inline queries.
 236	// Returned only in getMe.
 237	//
 238	// optional
 239	SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"`
 240}
 241
 242// String displays a simple text version of a user.
 243//
 244// It is normally a user's username, but falls back to a first/last
 245// name as available.
 246func (u *User) String() string {
 247	if u == nil {
 248		return ""
 249	}
 250	if u.UserName != "" {
 251		return u.UserName
 252	}
 253
 254	name := u.FirstName
 255	if u.LastName != "" {
 256		name += " " + u.LastName
 257	}
 258
 259	return name
 260}
 261
 262// Chat represents a chat.
 263type Chat struct {
 264	// ID is a unique identifier for this chat
 265	ID int64 `json:"id"`
 266	// Type of chat, can be either “private”, “group”, “supergroup” or “channel”
 267	Type string `json:"type"`
 268	// Title for supergroups, channels and group chats
 269	//
 270	// optional
 271	Title string `json:"title,omitempty"`
 272	// UserName for private chats, supergroups and channels if available
 273	//
 274	// optional
 275	UserName string `json:"username,omitempty"`
 276	// FirstName of the other party in a private chat
 277	//
 278	// optional
 279	FirstName string `json:"first_name,omitempty"`
 280	// LastName of the other party in a private chat
 281	//
 282	// optional
 283	LastName string `json:"last_name,omitempty"`
 284	// IsForum is true if the supergroup chat is a forum (has topics enabled)
 285	//
 286	// optional
 287	IsForum bool `json:"is_forum,omitempty"`
 288	// Photo is a chat photo
 289	Photo *ChatPhoto `json:"photo"`
 290	// If non-empty, the list of all active chat usernames;
 291	// for private chats, supergroups and channels. Returned only in getChat.
 292	//
 293	// optional
 294	ActiveUsernames []string `json:"active_usernames,omitempty"`
 295	// AvailableReactions is a list of available reactions allowed in the chat.
 296	// If omitted, then all emoji reactions are allowed. Returned only in getChat.
 297	//
 298	// optional
 299	AvailableReactions []ReactionType `json:"available_reactions,omitempty"`
 300	// AccentColorID is an identifier of the accent color for the chat name and backgrounds of
 301	// the chat photo, reply header, and link preview.
 302	// See accent colors for more details. Returned only in getChat.
 303	// Always returned in getChat.
 304	//
 305	// optional
 306	AccentColorID int `json:"accent_color_id,omitempty"`
 307	// BackgroundCustomEmojiID is a custom emoji identifier of emoji chosen by
 308	// the chat for the reply header and link preview background.
 309	// Returned only in getChat.
 310	//
 311	// optional
 312	BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"`
 313	// ProfileAccentColorID is ani dentifier of the accent color for the chat's profile background.
 314	// See profile accent colors for more details. Returned only in getChat.
 315	//
 316	// optional
 317	ProfileAccentColorID int `json:"profile_accent_color_id,omitempty"`
 318	// ProfileBackgroundCustomEmojiID is a custom emoji identifier of the emoji chosen by
 319	// the chat for its profile background. Returned only in getChat.
 320	//
 321	// optional
 322	ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"`
 323	// EmojiStatusCustomEmojiID is a custom emoji identifier of emoji status of the other party
 324	// in a private chat. Returned only in getChat.
 325	//
 326	// optional
 327	EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"`
 328	// EmojiStatusExpirationDate is a date of the emoji status of the chat or the other party
 329	// in a private chat, in Unix time, if any. Returned only in getChat.
 330	//
 331	// optional
 332	EmojiStatusExpirationDate int64 `json:"emoji_status_expiration_date,omitempty"`
 333	// Bio is the bio of the other party in a private chat. Returned only in
 334	// getChat
 335	//
 336	// optional
 337	Bio string `json:"bio,omitempty"`
 338	// HasPrivateForwards is true if privacy settings of the other party in the
 339	// private chat allows to use tg://user?id=<user_id> links only in chats
 340	// with the user. Returned only in getChat.
 341	//
 342	// optional
 343	HasPrivateForwards bool `json:"has_private_forwards,omitempty"`
 344	// HasRestrictedVoiceAndVideoMessages if the privacy settings of the other party
 345	// restrict sending voice and video note messages
 346	// in the private chat. Returned only in getChat.
 347	//
 348	// optional
 349	HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"`
 350	// JoinToSendMessages is true, if users need to join the supergroup
 351	// before they can send messages.
 352	// Returned only in getChat
 353	//
 354	// optional
 355	JoinToSendMessages bool `json:"join_to_send_messages,omitempty"`
 356	// JoinByRequest is true, if all users directly joining the supergroup
 357	// need to be approved by supergroup administrators.
 358	// Returned only in getChat.
 359	//
 360	// optional
 361	JoinByRequest bool `json:"join_by_request,omitempty"`
 362	// Description for groups, supergroups and channel chats
 363	//
 364	// optional
 365	Description string `json:"description,omitempty"`
 366	// InviteLink is a chat invite link, for groups, supergroups and channel chats.
 367	// Each administrator in a chat generates their own invite links,
 368	// so the bot must first generate the link using exportChatInviteLink
 369	//
 370	// optional
 371	InviteLink string `json:"invite_link,omitempty"`
 372	// PinnedMessage is the pinned message, for groups, supergroups and channels
 373	//
 374	// optional
 375	PinnedMessage *Message `json:"pinned_message,omitempty"`
 376	// Permissions are default chat member permissions, for groups and
 377	// supergroups. Returned only in getChat.
 378	//
 379	// optional
 380	Permissions *ChatPermissions `json:"permissions,omitempty"`
 381	// SlowModeDelay is for supergroups, the minimum allowed delay between
 382	// consecutive messages sent by each unprivileged user. Returned only in
 383	// getChat.
 384	//
 385	// optional
 386	SlowModeDelay int `json:"slow_mode_delay,omitempty"`
 387	// UnrestrictBoostCount  is for supergroups, the minimum number of boosts that
 388	// a non-administrator user needs to add in order to
 389	// ignore slow mode and chat permissions. Returned only in getChat.
 390	//
 391	// optional
 392	UnrestrictBoostCount int `json:"unrestrict_boost_count,omitempty"`
 393	// MessageAutoDeleteTime is the time after which all messages sent to the
 394	// chat will be automatically deleted; in seconds. Returned only in getChat.
 395	//
 396	// optional
 397	MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"`
 398	// HasAggressiveAntiSpamEnabled is true if aggressive anti-spam checks are enabled
 399	// in the supergroup. The field is only available to chat administrators.
 400	// Returned only in getChat.
 401	//
 402	// optional
 403	HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"`
 404	// HasHiddenMembers is true if non-administrators can only get
 405	// the list of bots and administrators in the chat.
 406	//
 407	// optional
 408	HasHiddenMembers bool `json:"has_hidden_members,omitempty"`
 409	// HasProtectedContent is true if messages from the chat can't be forwarded
 410	// to other chats. Returned only in getChat.
 411	//
 412	// optional
 413	HasProtectedContent bool `json:"has_protected_content,omitempty"`
 414	// HasVisibleHistory is True, if new chat members will have access to old messages;
 415	// available only to chat administrators. Returned only in getChat.
 416	//
 417	// optional
 418	HasVisibleHistory bool `json:"has_visible_history,omitempty"`
 419	// StickerSetName is for supergroups, name of group sticker set.Returned
 420	// only in getChat.
 421	//
 422	// optional
 423	StickerSetName string `json:"sticker_set_name,omitempty"`
 424	// CanSetStickerSet is true, if the bot can change the group sticker set.
 425	// Returned only in getChat.
 426	//
 427	// optional
 428	CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
 429	// CustomEmojiStickerSetName is for supergroups, the name of the group's 
 430	// custom emoji sticker set. Custom emoji from this set can be used by all 
 431	// users and bots in the group. Returned only in getChat.
 432	//
 433	// optional
 434	CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"`
 435	// LinkedChatID is a unique identifier for the linked chat, i.e. the
 436	// discussion group identifier for a channel and vice versa; for supergroups
 437	// and channel chats.
 438	//
 439	// optional
 440	LinkedChatID int64 `json:"linked_chat_id,omitempty"`
 441	// Location is for supergroups, the location to which the supergroup is
 442	// connected. Returned only in getChat.
 443	//
 444	// optional
 445	Location *ChatLocation `json:"location,omitempty"`
 446}
 447
 448// IsPrivate returns if the Chat is a private conversation.
 449func (c Chat) IsPrivate() bool {
 450	return c.Type == "private"
 451}
 452
 453// IsGroup returns if the Chat is a group.
 454func (c Chat) IsGroup() bool {
 455	return c.Type == "group"
 456}
 457
 458// IsSuperGroup returns if the Chat is a supergroup.
 459func (c Chat) IsSuperGroup() bool {
 460	return c.Type == "supergroup"
 461}
 462
 463// IsChannel returns if the Chat is a channel.
 464func (c Chat) IsChannel() bool {
 465	return c.Type == "channel"
 466}
 467
 468// ChatConfig returns a ChatConfig struct for chat related methods.
 469func (c Chat) ChatConfig() ChatConfig {
 470	return ChatConfig{ChatID: c.ID}
 471}
 472
 473// InaccessibleMessage describes a message that was deleted or is otherwise inaccessible to the bot.
 474type InaccessibleMessage struct {
 475	// Chat the message belonged to
 476	Chat Chat `json:"chat"`
 477	// MessageID is unique message identifier inside the chat
 478	MessageID int `json:"message_id"`
 479	// Date is always 0. The field can be used to differentiate regular and inaccessible messages.
 480	Date int `json:"date"`
 481}
 482
 483// Message represents a message.
 484type Message struct {
 485	// MessageID is a unique message identifier inside this chat
 486	MessageID int `json:"message_id"`
 487	// Unique identifier of a message thread to which the message belongs;
 488	// for supergroups only
 489	//
 490	// optional
 491	MessageThreadID int `json:"message_thread_id,omitempty"`
 492	// From is a sender, empty for messages sent to channels;
 493	//
 494	// optional
 495	From *User `json:"from,omitempty"`
 496	// SenderChat is the sender of the message, sent on behalf of a chat. The
 497	// channel itself for channel messages. The supergroup itself for messages
 498	// from anonymous group administrators. The linked channel for messages
 499	// automatically forwarded to the discussion group
 500	//
 501	// optional
 502	SenderChat *Chat `json:"sender_chat,omitempty"`
 503	// SenderBoostCount is the number of boosts added by the user,
 504	// if the sender of the message boosted the chat
 505	//
 506	// optional
 507	SenderBoostCount int `json:"sender_boost_count,omitempty"`
 508	// Date of the message was sent in Unix time
 509	Date int `json:"date"`
 510	// Chat is the conversation the message belongs to
 511	Chat Chat `json:"chat"`
 512	// ForwardOrigin is information about the original message for forwarded messages
 513	//
 514	// optional
 515	ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"`
 516	// IsTopicMessage true if the message is sent to a forum topic
 517	//
 518	// optional
 519	IsTopicMessage bool `json:"is_topic_message,omitempty"`
 520	// IsAutomaticForward is true if the message is a channel post that was
 521	// automatically forwarded to the connected discussion group.
 522	//
 523	// optional
 524	IsAutomaticForward bool `json:"is_automatic_forward,omitempty"`
 525	// ReplyToMessage for replies, the original message.
 526	// Note that the Message object in this field will not contain further ReplyToMessage fields
 527	// even if it itself is a reply;
 528	//
 529	// optional
 530	ReplyToMessage *Message `json:"reply_to_message,omitempty"`
 531	// ExternalReply is an information about the message that is being replied to,
 532	// which may come from another chat or forum topic.
 533	//
 534	// optional
 535	ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"`
 536	// Quote for replies that quote part of the original message, the quoted part of the message
 537	//
 538	// optional
 539	Quote *TextQuote `json:"text_quote,omitempty"`
 540	// ReplyToStory for replies to a story, the original story
 541	//
 542	// ReplyToStory
 543	ReplyToStory *Story `json:"reply_to_story"`
 544	// ViaBot through which the message was sent;
 545	//
 546	// optional
 547	ViaBot *User `json:"via_bot,omitempty"`
 548	// EditDate of the message was last edited in Unix time;
 549	//
 550	// optional
 551	EditDate int `json:"edit_date,omitempty"`
 552	// HasProtectedContent is true if the message can't be forwarded.
 553	//
 554	// optional
 555	HasProtectedContent bool `json:"has_protected_content,omitempty"`
 556	// MediaGroupID is the unique identifier of a media message group this message belongs to;
 557	//
 558	// optional
 559	MediaGroupID string `json:"media_group_id,omitempty"`
 560	// AuthorSignature is the signature of the post author for messages in channels;
 561	//
 562	// optional
 563	AuthorSignature string `json:"author_signature,omitempty"`
 564	// Text is for text messages, the actual UTF-8 text of the message, 0-4096 characters;
 565	//
 566	// optional
 567	Text string `json:"text,omitempty"`
 568	// Entities are for text messages, special entities like usernames,
 569	// URLs, bot commands, etc. that appear in the text;
 570	//
 571	// optional
 572	Entities []MessageEntity `json:"entities,omitempty"`
 573	// LinkPreviewOptions are options used for link preview generation for the message,
 574	// if it is a text message and link preview options were changed
 575	//
 576	// Optional
 577	LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
 578	// Animation message is an animation, information about the animation.
 579	// For backward compatibility, when this field is set, the document field will also be set;
 580	//
 581	// optional
 582	Animation *Animation `json:"animation,omitempty"`
 583	// PremiumAnimation message is an animation, information about the animation.
 584	// For backward compatibility, when this field is set, the document field will also be set;
 585	//
 586	// optional
 587	PremiumAnimation *Animation `json:"premium_animation,omitempty"`
 588	// Audio message is an audio file, information about the file;
 589	//
 590	// optional
 591	Audio *Audio `json:"audio,omitempty"`
 592	// Document message is a general file, information about the file;
 593	//
 594	// optional
 595	Document *Document `json:"document,omitempty"`
 596	// Photo message is a photo, available sizes of the photo;
 597	//
 598	// optional
 599	Photo []PhotoSize `json:"photo,omitempty"`
 600	// Sticker message is a sticker, information about the sticker;
 601	//
 602	// optional
 603	Sticker *Sticker `json:"sticker,omitempty"`
 604	// Story message is a forwarded story;
 605	//
 606	// optional
 607	Story *Story `json:"story,omitempty"`
 608	// Video message is a video, information about the video;
 609	//
 610	// optional
 611	Video *Video `json:"video,omitempty"`
 612	// VideoNote message is a video note, information about the video message;
 613	//
 614	// optional
 615	VideoNote *VideoNote `json:"video_note,omitempty"`
 616	// Voice message is a voice message, information about the file;
 617	//
 618	// optional
 619	Voice *Voice `json:"voice,omitempty"`
 620	// Caption for the animation, audio, document, photo, video or voice, 0-1024 characters;
 621	//
 622	// optional
 623	Caption string `json:"caption,omitempty"`
 624	// CaptionEntities;
 625	//
 626	// optional
 627	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
 628	// HasSpoiler True, if the message media is covered by a spoiler animation
 629	//
 630	// optional
 631	HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"`
 632	// Contact message is a shared contact, information about the contact;
 633	//
 634	// optional
 635	Contact *Contact `json:"contact,omitempty"`
 636	// Dice is a dice with random value;
 637	//
 638	// optional
 639	Dice *Dice `json:"dice,omitempty"`
 640	// Game message is a game, information about the game;
 641	//
 642	// optional
 643	Game *Game `json:"game,omitempty"`
 644	// Poll is a native poll, information about the poll;
 645	//
 646	// optional
 647	Poll *Poll `json:"poll,omitempty"`
 648	// Venue message is a venue, information about the venue.
 649	// For backward compatibility, when this field is set, the location field
 650	// will also be set;
 651	//
 652	// optional
 653	Venue *Venue `json:"venue,omitempty"`
 654	// Location message is a shared location, information about the location;
 655	//
 656	// optional
 657	Location *Location `json:"location,omitempty"`
 658	// NewChatMembers that were added to the group or supergroup
 659	// and information about them (the bot itself may be one of these members);
 660	//
 661	// optional
 662	NewChatMembers []User `json:"new_chat_members,omitempty"`
 663	// LeftChatMember is a member was removed from the group,
 664	// information about them (this member may be the bot itself);
 665	//
 666	// optional
 667	LeftChatMember *User `json:"left_chat_member,omitempty"`
 668	// NewChatTitle is a chat title was changed to this value;
 669	//
 670	// optional
 671	NewChatTitle string `json:"new_chat_title,omitempty"`
 672	// NewChatPhoto is a chat photo was change to this value;
 673	//
 674	// optional
 675	NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"`
 676	// DeleteChatPhoto is a service message: the chat photo was deleted;
 677	//
 678	// optional
 679	DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"`
 680	// GroupChatCreated is a service message: the group has been created;
 681	//
 682	// optional
 683	GroupChatCreated bool `json:"group_chat_created,omitempty"`
 684	// SuperGroupChatCreated is a service message: the supergroup has been created.
 685	// This field can't be received in a message coming through updates,
 686	// because bot can't be a member of a supergroup when it is created.
 687	// It can only be found in ReplyToMessage if someone replies to a very first message
 688	// in a directly created supergroup;
 689	//
 690	// optional
 691	SuperGroupChatCreated bool `json:"supergroup_chat_created,omitempty"`
 692	// ChannelChatCreated is a service message: the channel has been created.
 693	// This field can't be received in a message coming through updates,
 694	// because bot can't be a member of a channel when it is created.
 695	// It can only be found in ReplyToMessage
 696	// if someone replies to a very first message in a channel;
 697	//
 698	// optional
 699	ChannelChatCreated bool `json:"channel_chat_created,omitempty"`
 700	// MessageAutoDeleteTimerChanged is a service message: auto-delete timer
 701	// settings changed in the chat.
 702	//
 703	// optional
 704	MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"`
 705	// MigrateToChatID is the group has been migrated to a supergroup with the specified identifier.
 706	// This number may be greater than 32 bits and some programming languages
 707	// may have difficulty/silent defects in interpreting it.
 708	// But it is smaller than 52 bits, so a signed 64-bit integer
 709	// or double-precision float type are safe for storing this identifier;
 710	//
 711	// optional
 712	MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
 713	// MigrateFromChatID is the supergroup has been migrated from a group with the specified identifier.
 714	// This number may be greater than 32 bits and some programming languages
 715	// may have difficulty/silent defects in interpreting it.
 716	// But it is smaller than 52 bits, so a signed 64-bit integer
 717	// or double-precision float type are safe for storing this identifier;
 718	//
 719	// optional
 720	MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"`
 721	// Specified message was pinned.
 722	// Note that the Message object in this field will not contain
 723	// further reply_to_message fields even if it itself is a reply.
 724	//
 725	// optional
 726	PinnedMessage *Message `json:"pinned_message,omitempty"`
 727	// Invoice message is an invoice for a payment;
 728	//
 729	// optional
 730	Invoice *Invoice `json:"invoice,omitempty"`
 731	// SuccessfulPayment message is a service message about a successful payment,
 732	// information about the payment;
 733	//
 734	// optional
 735	SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"`
 736	// UsersShared is a service message: the users were shared with the bot
 737	//
 738	// optional
 739	UsersShared *UsersShared `json:"users_shared,omitempty"`
 740	// ChatShared is a service message: a chat was shared with the bot
 741	//
 742	// optional
 743	ChatShared *ChatShared `json:"chat_shared,omitempty"`
 744	// ConnectedWebsite is the domain name of the website on which the user has
 745	// logged in;
 746	//
 747	// optional
 748	ConnectedWebsite string `json:"connected_website,omitempty"`
 749	// WriteAccessAllowed is a service message: the user allowed the bot
 750	// added to the attachment menu to write messages
 751	//
 752	// optional
 753	WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"`
 754	// PassportData is a Telegram Passport data;
 755	//
 756	// optional
 757	PassportData *PassportData `json:"passport_data,omitempty"`
 758	// ProximityAlertTriggered is a service message. A user in the chat
 759	// triggered another user's proximity alert while sharing Live Location
 760	//
 761	// optional
 762	ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"`
 763	// BoostAdded is a service message: user boosted the chat
 764	//
 765	// optional
 766	BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"`
 767	// ForumTopicCreated is a service message: forum topic created
 768	//
 769	// optional
 770	ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"`
 771	// ForumTopicClosed is a service message: forum topic edited
 772	//
 773	// optional
 774	ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"`
 775	// ForumTopicClosed is a service message: forum topic closed
 776	//
 777	// optional
 778	ForumTopicClosed *ForumTopicClosed `json:"forum_topic_closed,omitempty"`
 779	// ForumTopicReopened is a service message: forum topic reopened
 780	//
 781	// optional
 782	ForumTopicReopened *ForumTopicReopened `json:"forum_topic_reopened,omitempty"`
 783	// GeneralForumTopicHidden is a service message: the 'General' forum topic hidden
 784	//
 785	// optional
 786	GeneralForumTopicHidden *GeneralForumTopicHidden `json:"general_forum_topic_hidden,omitempty"`
 787	// GeneralForumTopicUnhidden is a service message: the 'General' forum topic unhidden
 788	//
 789	// optional
 790	GeneralForumTopicUnhidden *GeneralForumTopicUnhidden `json:"general_forum_topic_unhidden,omitempty"`
 791	// GiveawayCreated is as service message: a scheduled giveaway was created
 792	//
 793	// optional
 794	GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"`
 795	// Giveaway is a scheduled giveaway message
 796	//
 797	// optional
 798	Giveaway *Giveaway `json:"giveaway,omitempty"`
 799	// GiveawayWinners is a giveaway with public winners was completed
 800	//
 801	// optional
 802	GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"`
 803	// GiveawayCompleted is a service message: a giveaway without public winners was completed
 804	//
 805	// optional
 806	GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"`
 807	// VideoChatScheduled is a service message: video chat scheduled.
 808	//
 809	// optional
 810	VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"`
 811	// VideoChatStarted is a service message: video chat started.
 812	//
 813	// optional
 814	VideoChatStarted *VideoChatStarted `json:"video_chat_started,omitempty"`
 815	// VideoChatEnded is a service message: video chat ended.
 816	//
 817	// optional
 818	VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"`
 819	// VideoChatParticipantsInvited is a service message: new participants
 820	// invited to a video chat.
 821	//
 822	// optional
 823	VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"`
 824	// WebAppData is a service message: data sent by a Web App.
 825	//
 826	// optional
 827	WebAppData *WebAppData `json:"web_app_data,omitempty"`
 828	// ReplyMarkup is the Inline keyboard attached to the message.
 829	// login_url buttons are represented as ordinary url buttons.
 830	//
 831	// optional
 832	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
 833}
 834
 835// Time converts the message timestamp into a Time.
 836func (m *Message) Time() time.Time {
 837	return time.Unix(int64(m.Date), 0)
 838}
 839
 840// IsCommand returns true if message starts with a "bot_command" entity.
 841func (m *Message) IsCommand() bool {
 842	if m.Entities == nil || len(m.Entities) == 0 {
 843		return false
 844	}
 845
 846	entity := m.Entities[0]
 847	return entity.Offset == 0 && entity.IsCommand()
 848}
 849
 850// Command checks if the message was a command and if it was, returns the
 851// command. If the Message was not a command, it returns an empty string.
 852//
 853// If the command contains the at name syntax, it is removed. Use
 854// CommandWithAt() if you do not want that.
 855func (m *Message) Command() string {
 856	command := m.CommandWithAt()
 857
 858	if i := strings.Index(command, "@"); i != -1 {
 859		command = command[:i]
 860	}
 861
 862	return command
 863}
 864
 865// CommandWithAt checks if the message was a command and if it was, returns the
 866// command. If the Message was not a command, it returns an empty string.
 867//
 868// If the command contains the at name syntax, it is not removed. Use Command()
 869// if you want that.
 870func (m *Message) CommandWithAt() string {
 871	if !m.IsCommand() {
 872		return ""
 873	}
 874
 875	// IsCommand() checks that the message begins with a bot_command entity
 876	entity := m.Entities[0]
 877	return m.Text[1:entity.Length]
 878}
 879
 880// CommandArguments checks if the message was a command and if it was,
 881// returns all text after the command name. If the Message was not a
 882// command, it returns an empty string.
 883//
 884// Note: The first character after the command name is omitted:
 885// - "/foo bar baz" yields "bar baz", not " bar baz"
 886// - "/foo-bar baz" yields "bar baz", too
 887// Even though the latter is not a command conforming to the spec, the API
 888// marks "/foo" as command entity.
 889func (m *Message) CommandArguments() string {
 890	if !m.IsCommand() {
 891		return ""
 892	}
 893
 894	// IsCommand() checks that the message begins with a bot_command entity
 895	entity := m.Entities[0]
 896
 897	if len(m.Text) == entity.Length {
 898		return "" // The command makes up the whole message
 899	}
 900
 901	return m.Text[entity.Length+1:]
 902}
 903
 904// MessageID represents a unique message identifier.
 905type MessageID struct {
 906	MessageID int `json:"message_id"`
 907}
 908
 909// MessageEntity represents one special entity in a text message.
 910type MessageEntity struct {
 911	// Type of the entity.
 912	// Can be:
 913	//  “mention” (@username),
 914	//  “hashtag” (#hashtag),
 915	//  “cashtag” ($USD),
 916	//  “bot_command” (/start@jobs_bot),
 917	//  “url” (https://telegram.org),
 918	//  “email” (do-not-reply@telegram.org),
 919	//  “phone_number” (+1-212-555-0123),
 920	//  “bold” (bold text),
 921	//  “italic” (italic text),
 922	//  “underline” (underlined text),
 923	//  “strikethrough” (strikethrough text),
 924	//  "spoiler" (spoiler message),
 925	//  “blockquote” (block quotation),
 926	//  “code” (monowidth string),
 927	//  “pre” (monowidth block),
 928	//  “text_link” (for clickable text URLs),
 929	//  “text_mention” (for users without usernames)
 930	//  “text_mention” (for inline custom emoji stickers)
 931	Type string `json:"type"`
 932	// Offset in UTF-16 code units to the start of the entity
 933	Offset int `json:"offset"`
 934	// Length
 935	Length int `json:"length"`
 936	// URL for “text_link” only, url that will be opened after user taps on the text
 937	//
 938	// optional
 939	URL string `json:"url,omitempty"`
 940	// User for “text_mention” only, the mentioned user
 941	//
 942	// optional
 943	User *User `json:"user,omitempty"`
 944	// Language for “pre” only, the programming language of the entity text
 945	//
 946	// optional
 947	Language string `json:"language,omitempty"`
 948	// CustomEmojiID for “custom_emoji” only, unique identifier of the custom emoji
 949	//
 950	// optional
 951	CustomEmojiID string `json:"custom_emoji_id"`
 952}
 953
 954// ParseURL attempts to parse a URL contained within a MessageEntity.
 955func (e MessageEntity) ParseURL() (*url.URL, error) {
 956	if e.URL == "" {
 957		return nil, errors.New(ErrBadURL)
 958	}
 959
 960	return url.Parse(e.URL)
 961}
 962
 963// IsMention returns true if the type of the message entity is "mention" (@username).
 964func (e MessageEntity) IsMention() bool {
 965	return e.Type == "mention"
 966}
 967
 968// IsTextMention returns true if the type of the message entity is "text_mention"
 969// (At this time, the user field exists, and occurs when tagging a member without a username)
 970func (e MessageEntity) IsTextMention() bool {
 971	return e.Type == "text_mention"
 972}
 973
 974// IsHashtag returns true if the type of the message entity is "hashtag".
 975func (e MessageEntity) IsHashtag() bool {
 976	return e.Type == "hashtag"
 977}
 978
 979// IsCommand returns true if the type of the message entity is "bot_command".
 980func (e MessageEntity) IsCommand() bool {
 981	return e.Type == "bot_command"
 982}
 983
 984// IsURL returns true if the type of the message entity is "url".
 985func (e MessageEntity) IsURL() bool {
 986	return e.Type == "url"
 987}
 988
 989// IsEmail returns true if the type of the message entity is "email".
 990func (e MessageEntity) IsEmail() bool {
 991	return e.Type == "email"
 992}
 993
 994// IsBold returns true if the type of the message entity is "bold" (bold text).
 995func (e MessageEntity) IsBold() bool {
 996	return e.Type == "bold"
 997}
 998
 999// IsItalic returns true if the type of the message entity is "italic" (italic text).
1000func (e MessageEntity) IsItalic() bool {
1001	return e.Type == "italic"
1002}
1003
1004// IsCode returns true if the type of the message entity is "code" (monowidth string).
1005func (e MessageEntity) IsCode() bool {
1006	return e.Type == "code"
1007}
1008
1009// IsPre returns true if the type of the message entity is "pre" (monowidth block).
1010func (e MessageEntity) IsPre() bool {
1011	return e.Type == "pre"
1012}
1013
1014// IsTextLink returns true if the type of the message entity is "text_link" (clickable text URL).
1015func (e MessageEntity) IsTextLink() bool {
1016	return e.Type == "text_link"
1017}
1018
1019// TextQuote contains information about the quoted part of a message
1020// that is replied to by the given message
1021type TextQuote struct {
1022	// Text of the quoted part of a message that is replied to by the given message
1023	Text string `json:"text"`
1024	// Entities special entities that appear in the quote.
1025	// Currently, only bold, italic, underline, strikethrough, spoiler,
1026	// and custom_emoji entities are kept in quotes.
1027	//
1028	// optional
1029	Entities []MessageEntity `json:"entities,omitempty"`
1030	// Position is approximate quote position in the original message
1031	// in UTF-16 code units as specified by the sender
1032	Position int `json:"position"`
1033	// IsManual True, if the quote was chosen manually by the message sender.
1034	// Otherwise, the quote was added automatically by the server.
1035	//
1036	// optional
1037	IsManual bool `json:"is_manual,omitempty"`
1038}
1039
1040// ExternalReplyInfo contains information about a message that is being replied to,
1041// which may come from another chat or forum topic.
1042type ExternalReplyInfo struct {
1043	// Origin of the message replied to by the given message
1044	Origin MessageOrigin `json:"origin"`
1045	// Chat is the conversation the message belongs to
1046	Chat *Chat `json:"chat"`
1047	// MessageID is a unique message identifier inside this chat
1048	MessageID int `json:"message_id"`
1049	// LinkPreviewOptions used for link preview generation for the original message,
1050	// if it is a text message
1051	//
1052	// Optional
1053	LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
1054	// Animation message is an animation, information about the animation.
1055	// For backward compatibility, when this field is set, the document field will also be set;
1056	//
1057	// optional
1058	Animation *Animation `json:"animation,omitempty"`
1059	// Audio message is an audio file, information about the file;
1060	//
1061	// optional
1062	Audio *Audio `json:"audio,omitempty"`
1063	// Document message is a general file, information about the file;
1064	//
1065	// optional
1066	Document *Document `json:"document,omitempty"`
1067	// Photo message is a photo, available sizes of the photo;
1068	//
1069	// optional
1070	Photo []PhotoSize `json:"photo,omitempty"`
1071	// Sticker message is a sticker, information about the sticker;
1072	//
1073	// optional
1074	Sticker *Sticker `json:"sticker,omitempty"`
1075	// Story message is a forwarded story;
1076	//
1077	// optional
1078	Story *Story `json:"story,omitempty"`
1079	// Video message is a video, information about the video;
1080	//
1081	// optional
1082	Video *Video `json:"video,omitempty"`
1083	// VideoNote message is a video note, information about the video message;
1084	//
1085	// optional
1086	VideoNote *VideoNote `json:"video_note,omitempty"`
1087	// Voice message is a voice message, information about the file;
1088	//
1089	// optional
1090	Voice *Voice `json:"voice,omitempty"`
1091	// HasMediaSpoiler True, if the message media is covered by a spoiler animation
1092	//
1093	// optional
1094	HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"`
1095	// Contact message is a shared contact, information about the contact;
1096	//
1097	// optional
1098	Contact *Contact `json:"contact,omitempty"`
1099	// Dice is a dice with random value;
1100	//
1101	// optional
1102	Dice *Dice `json:"dice,omitempty"`
1103	// Game message is a game, information about the game;
1104	//
1105	// optional
1106	Game *Game `json:"game,omitempty"`
1107	// Giveaway is information about the giveaway
1108	//
1109	// optional
1110	Giveaway *Giveaway `json:"giveaway,omitempty"`
1111	// GiveawayWinners a giveaway with public winners was completed
1112	//
1113	// optional
1114	GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"`
1115	// Invoice message is an invoice for a payment;
1116	//
1117	// optional
1118	Invoice *Invoice `json:"invoice,omitempty"`
1119	// Location message is a shared location, information about the location;
1120	//
1121	// optional
1122	Location *Location `json:"location,omitempty"`
1123	// Poll is a native poll, information about the poll;
1124	//
1125	// optional
1126	Poll *Poll `json:"poll,omitempty"`
1127	// Venue message is a venue, information about the venue.
1128	// For backward compatibility, when this field is set, the location field
1129	// will also be set;
1130	//
1131	// optional
1132	Venue *Venue `json:"venue,omitempty"`
1133}
1134
1135// ReplyParameters describes reply parameters for the message that is being sent.
1136type ReplyParameters struct {
1137	// MessageID identifier of the message that will be replied to in
1138	// the current chat, or in the chat chat_id if it is specified
1139	MessageID int `json:"message_id"`
1140	// ChatID if the message to be replied to is from a different chat,
1141	// unique identifier for the chat or username of the channel (in the format @channelusername)
1142	//
1143	// optional
1144	ChatID interface{} `json:"chat_id,omitempty"`
1145	// AllowSendingWithoutReply true if the message should be sent even
1146	// if the specified message to be replied to is not found;
1147	// can be used only for replies in the same chat and forum topic.
1148	//
1149	// optional
1150	AllowSendingWithoutReply bool `json:"allow_sending_without_reply,omitempty"`
1151	// Quote is a quoted part of the message to be replied to;
1152	// 0-1024 characters after entities parsing. The quote must be
1153	// an exact substring of the message to be replied to,
1154	// including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities.
1155	// The message will fail to send if the quote isn't found in the original message.
1156	//
1157	// optional
1158	Quote string `json:"quote,omitempty"`
1159	// QuoteParseMode mode for parsing entities in the quote.
1160	//
1161	// optional
1162	QuoteParseMode string `json:"quote_parse_mode,omitempty"`
1163	// QuoteEntities a JSON-serialized list of special entities that appear in the quote.
1164	// It can be specified instead of quote_parse_mode.
1165	//
1166	// optional
1167	QuoteEntities []MessageEntity `json:"quote_entities,omitempty"`
1168	// QuotePosition is a position of the quote in the original message in UTF-16 code units
1169	//
1170	// optional
1171	QuotePosition int `json:"quote_position,omitempty"`
1172}
1173
1174const (
1175	MessageOriginUser       = "user"
1176	MessageOriginHiddenUser = "hidden_user"
1177	MessageOriginChat       = "chat"
1178	MessageOriginChannel    = "channel"
1179)
1180
1181// MessageOrigin describes the origin of a message. It can be one of: "user", "hidden_user", "origin_chat", "origin_channel"
1182type MessageOrigin struct {
1183	// Type of the message origin.
1184	Type string `json:"type"`
1185	// Date the message was sent originally in Unix time
1186	Date int64 `json:"date"`
1187	// SenderUser "user" only.
1188	// Is a user that sent the message originally
1189	SenderUser *User `json:"sender_user,omitempty"`
1190	// SenderUserName "hidden_user" only.
1191	// Name of the user that sent the message originally
1192	SenderUserName string `json:"sender_user_name,omitempty"`
1193	// SenderChat "chat" only.
1194	// Chat that sent the message originally
1195	SenderChat *Chat `json:"sender_chat,omitempty"`
1196	// Chat "channel" only.
1197	// Channel chat to which the message was originally sent
1198	Chat *Chat `json:"chat,omitempty"`
1199	// AuthorSignature "chat" and "channel".
1200	// For "chat": For messages originally sent by an anonymous chat administrator,
1201	// original message author signature.
1202	// For "channel": Signature of the original post author
1203	//
1204	// Optional
1205	AuthorSignature string `json:"author_signature,omitempty"`
1206	// MessageID "channel" only.
1207	// Unique message identifier inside the chat
1208	//
1209	// Optional
1210	MessageID int `json:"message_id,omitempty"`
1211}
1212
1213func (m MessageOrigin) IsUser() bool {
1214	return m.Type == MessageOriginUser
1215}
1216
1217func (m MessageOrigin) IsHiddenUser() bool {
1218	return m.Type == MessageOriginHiddenUser
1219}
1220
1221func (m MessageOrigin) IsChat() bool {
1222	return m.Type == MessageOriginChat
1223}
1224
1225func (m MessageOrigin) IsChannel() bool {
1226	return m.Type == MessageOriginChannel
1227}
1228
1229// PhotoSize represents one size of a photo or a file / sticker thumbnail.
1230type PhotoSize struct {
1231	// FileID identifier for this file, which can be used to download or reuse
1232	// the file
1233	FileID string `json:"file_id"`
1234	// FileUniqueID is the unique identifier for this file, which is supposed to
1235	// be the same over time and for different bots. Can't be used to download
1236	// or reuse the file.
1237	FileUniqueID string `json:"file_unique_id"`
1238	// Width photo width
1239	Width int `json:"width"`
1240	// Height photo height
1241	Height int `json:"height"`
1242	// FileSize file size
1243	//
1244	// optional
1245	FileSize int `json:"file_size,omitempty"`
1246}
1247
1248// Animation represents an animation file.
1249type Animation struct {
1250	// FileID is the identifier for this file, which can be used to download or reuse
1251	// the file
1252	FileID string `json:"file_id"`
1253	// FileUniqueID is the unique identifier for this file, which is supposed to
1254	// be the same over time and for different bots. Can't be used to download
1255	// or reuse the file.
1256	FileUniqueID string `json:"file_unique_id"`
1257	// Width video width as defined by sender
1258	Width int `json:"width"`
1259	// Height video height as defined by sender
1260	Height int `json:"height"`
1261	// Duration of the video in seconds as defined by sender
1262	Duration int `json:"duration"`
1263	// Thumbnail animation thumbnail as defined by sender
1264	//
1265	// optional
1266	Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
1267	// FileName original animation filename as defined by sender
1268	//
1269	// optional
1270	FileName string `json:"file_name,omitempty"`
1271	// MimeType of the file as defined by sender
1272	//
1273	// optional
1274	MimeType string `json:"mime_type,omitempty"`
1275	// FileSize file size
1276	//
1277	// optional
1278	FileSize int64 `json:"file_size,omitempty"`
1279}
1280
1281// Audio represents an audio file to be treated as music by the Telegram clients.
1282type Audio struct {
1283	// FileID is an identifier for this file, which can be used to download or
1284	// reuse the file
1285	FileID string `json:"file_id"`
1286	// FileUniqueID is the unique identifier for this file, which is supposed to
1287	// be the same over time and for different bots. Can't be used to download
1288	// or reuse the file.
1289	FileUniqueID string `json:"file_unique_id"`
1290	// Duration of the audio in seconds as defined by sender
1291	Duration int `json:"duration"`
1292	// Performer of the audio as defined by sender or by audio tags
1293	//
1294	// optional
1295	Performer string `json:"performer,omitempty"`
1296	// Title of the audio as defined by sender or by audio tags
1297	//
1298	// optional
1299	Title string `json:"title,omitempty"`
1300	// FileName is the original filename as defined by sender
1301	//
1302	// optional
1303	FileName string `json:"file_name,omitempty"`
1304	// MimeType of the file as defined by sender
1305	//
1306	// optional
1307	MimeType string `json:"mime_type,omitempty"`
1308	// FileSize file size
1309	//
1310	// optional
1311	FileSize int64 `json:"file_size,omitempty"`
1312	// Thumbnail is the album cover to which the music file belongs
1313	//
1314	// optional
1315	Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
1316}
1317
1318// Document represents a general file.
1319type Document struct {
1320	// FileID is an identifier for this file, which can be used to download or
1321	// reuse the file
1322	FileID string `json:"file_id"`
1323	// FileUniqueID is the unique identifier for this file, which is supposed to
1324	// be the same over time and for different bots. Can't be used to download
1325	// or reuse the file.
1326	FileUniqueID string `json:"file_unique_id"`
1327	// Thumbnail document thumbnail as defined by sender
1328	//
1329	// optional
1330	Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
1331	// FileName original filename as defined by sender
1332	//
1333	// optional
1334	FileName string `json:"file_name,omitempty"`
1335	// MimeType  of the file as defined by sender
1336	//
1337	// optional
1338	MimeType string `json:"mime_type,omitempty"`
1339	// FileSize file size
1340	//
1341	// optional
1342	FileSize int64 `json:"file_size,omitempty"`
1343}
1344
1345// Story represents a message about a forwarded story in the chat.
1346type Story struct {
1347	// Chat that posted the story
1348	Chat Chat `json:"chat"`
1349	// ID is an unique identifier for the story in the chat
1350	ID int `json:"id"`
1351}
1352
1353// Video represents a video file.
1354type Video struct {
1355	// FileID identifier for this file, which can be used to download or reuse
1356	// the file
1357	FileID string `json:"file_id"`
1358	// FileUniqueID is the unique identifier for this file, which is supposed to
1359	// be the same over time and for different bots. Can't be used to download
1360	// or reuse the file.
1361	FileUniqueID string `json:"file_unique_id"`
1362	// Width video width as defined by sender
1363	Width int `json:"width"`
1364	// Height video height as defined by sender
1365	Height int `json:"height"`
1366	// Duration of the video in seconds as defined by sender
1367	Duration int `json:"duration"`
1368	// Thumbnail video thumbnail
1369	//
1370	// optional
1371	Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
1372	// FileName is the original filename as defined by sender
1373	//
1374	// optional
1375	FileName string `json:"file_name,omitempty"`
1376	// MimeType of a file as defined by sender
1377	//
1378	// optional
1379	MimeType string `json:"mime_type,omitempty"`
1380	// FileSize file size
1381	//
1382	// optional
1383	FileSize int64 `json:"file_size,omitempty"`
1384}
1385
1386// VideoNote object represents a video message.
1387type VideoNote struct {
1388	// FileID identifier for this file, which can be used to download or reuse the file
1389	FileID string `json:"file_id"`
1390	// FileUniqueID is the unique identifier for this file, which is supposed to
1391	// be the same over time and for different bots. Can't be used to download
1392	// or reuse the file.
1393	FileUniqueID string `json:"file_unique_id"`
1394	// Length video width and height (diameter of the video message) as defined by sender
1395	Length int `json:"length"`
1396	// Duration of the video in seconds as defined by sender
1397	Duration int `json:"duration"`
1398	// Thumbnail video thumbnail
1399	//
1400	// optional
1401	Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
1402	// FileSize file size
1403	//
1404	// optional
1405	FileSize int `json:"file_size,omitempty"`
1406}
1407
1408// Voice represents a voice note.
1409type Voice struct {
1410	// FileID identifier for this file, which can be used to download or reuse the file
1411	FileID string `json:"file_id"`
1412	// FileUniqueID is the unique identifier for this file, which is supposed to
1413	// be the same over time and for different bots. Can't be used to download
1414	// or reuse the file.
1415	FileUniqueID string `json:"file_unique_id"`
1416	// Duration of the audio in seconds as defined by sender
1417	Duration int `json:"duration"`
1418	// MimeType of the file as defined by sender
1419	//
1420	// optional
1421	MimeType string `json:"mime_type,omitempty"`
1422	// FileSize file size
1423	//
1424	// optional
1425	FileSize int64 `json:"file_size,omitempty"`
1426}
1427
1428// Contact represents a phone contact.
1429//
1430// Note that LastName and UserID may be empty.
1431type Contact struct {
1432	// PhoneNumber contact's phone number
1433	PhoneNumber string `json:"phone_number"`
1434	// FirstName contact's first name
1435	FirstName string `json:"first_name"`
1436	// LastName contact's last name
1437	//
1438	// optional
1439	LastName string `json:"last_name,omitempty"`
1440	// UserID contact's user identifier in Telegram
1441	//
1442	// optional
1443	UserID int64 `json:"user_id,omitempty"`
1444	// VCard is additional data about the contact in the form of a vCard.
1445	//
1446	// optional
1447	VCard string `json:"vcard,omitempty"`
1448}
1449
1450// Dice represents an animated emoji that displays a random value.
1451type Dice struct {
1452	// Emoji on which the dice throw animation is based
1453	Emoji string `json:"emoji"`
1454	// Value of the dice
1455	Value int `json:"value"`
1456}
1457
1458// PollOption contains information about one answer option in a poll.
1459type PollOption struct {
1460	// Text is the option text, 1-100 characters
1461	Text string `json:"text"`
1462	// VoterCount is the number of users that voted for this option
1463	VoterCount int `json:"voter_count"`
1464}
1465
1466// PollAnswer represents an answer of a user in a non-anonymous poll.
1467type PollAnswer struct {
1468	// PollID is the unique poll identifier
1469	PollID string `json:"poll_id"`
1470	// Chat that changed the answer to the poll, if the voter is anonymous.
1471	//
1472	// Optional
1473	VoterChat *Chat `json:"voter_chat,omitempty"`
1474	// User who changed the answer to the poll, if the voter isn't anonymous
1475	// For backward compatibility, the field user in such objects
1476	// will contain the user 136817688 (@Channel_Bot).
1477	//
1478	// Optional
1479	User *User `json:"user,omitempty"`
1480	// OptionIDs is the 0-based identifiers of poll options chosen by the user.
1481	// May be empty if user retracted vote.
1482	OptionIDs []int `json:"option_ids"`
1483}
1484
1485// Poll contains information about a poll.
1486type Poll struct {
1487	// ID is the unique poll identifier
1488	ID string `json:"id"`
1489	// Question is the poll question, 1-255 characters
1490	Question string `json:"question"`
1491	// Options is the list of poll options
1492	Options []PollOption `json:"options"`
1493	// TotalVoterCount is the total numbers of users who voted in the poll
1494	TotalVoterCount int `json:"total_voter_count"`
1495	// IsClosed is if the poll is closed
1496	IsClosed bool `json:"is_closed"`
1497	// IsAnonymous is if the poll is anonymous
1498	IsAnonymous bool `json:"is_anonymous"`
1499	// Type is the poll type, currently can be "regular" or "quiz"
1500	Type string `json:"type"`
1501	// AllowsMultipleAnswers is true, if the poll allows multiple answers
1502	AllowsMultipleAnswers bool `json:"allows_multiple_answers"`
1503	// CorrectOptionID is the 0-based identifier of the correct answer option.
1504	// Available only for polls in quiz mode, which are closed, or was sent (not
1505	// forwarded) by the bot or to the private chat with the bot.
1506	//
1507	// optional
1508	CorrectOptionID int `json:"correct_option_id,omitempty"`
1509	// Explanation is text that is shown when a user chooses an incorrect answer
1510	// or taps on the lamp icon in a quiz-style poll, 0-200 characters
1511	//
1512	// optional
1513	Explanation string `json:"explanation,omitempty"`
1514	// ExplanationEntities are special entities like usernames, URLs, bot
1515	// commands, etc. that appear in the explanation
1516	//
1517	// optional
1518	ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
1519	// OpenPeriod is the amount of time in seconds the poll will be active
1520	// after creation
1521	//
1522	// optional
1523	OpenPeriod int `json:"open_period,omitempty"`
1524	// CloseDate is the point in time (unix timestamp) when the poll will be
1525	// automatically closed
1526	//
1527	// optional
1528	CloseDate int `json:"close_date,omitempty"`
1529}
1530
1531// Location represents a point on the map.
1532type Location struct {
1533	// Longitude as defined by sender
1534	Longitude float64 `json:"longitude"`
1535	// Latitude as defined by sender
1536	Latitude float64 `json:"latitude"`
1537	// HorizontalAccuracy is the radius of uncertainty for the location,
1538	// measured in meters; 0-1500
1539	//
1540	// optional
1541	HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
1542	// LivePeriod is time relative to the message sending date, during which the
1543	// location can be updated, in seconds. For active live locations only.
1544	//
1545	// optional
1546	LivePeriod int `json:"live_period,omitempty"`
1547	// Heading is the direction in which user is moving, in degrees; 1-360. For
1548	// active live locations only.
1549	//
1550	// optional
1551	Heading int `json:"heading,omitempty"`
1552	// ProximityAlertRadius is the maximum distance for proximity alerts about
1553	// approaching another chat member, in meters. For sent live locations only.
1554	//
1555	// optional
1556	ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
1557}
1558
1559// Venue represents a venue.
1560type Venue struct {
1561	// Location is the venue location
1562	Location Location `json:"location"`
1563	// Title is the name of the venue
1564	Title string `json:"title"`
1565	// Address of the venue
1566	Address string `json:"address"`
1567	// FoursquareID is the foursquare identifier of the venue
1568	//
1569	// optional
1570	FoursquareID string `json:"foursquare_id,omitempty"`
1571	// FoursquareType is the foursquare type of the venue
1572	//
1573	// optional
1574	FoursquareType string `json:"foursquare_type,omitempty"`
1575	// GooglePlaceID is the Google Places identifier of the venue
1576	//
1577	// optional
1578	GooglePlaceID string `json:"google_place_id,omitempty"`
1579	// GooglePlaceType is the Google Places type of the venue
1580	//
1581	// optional
1582	GooglePlaceType string `json:"google_place_type,omitempty"`
1583}
1584
1585// WebAppData Contains data sent from a Web App to the bot.
1586type WebAppData struct {
1587	// Data is the data. Be aware that a bad client can send arbitrary data in this field.
1588	Data string `json:"data"`
1589	// ButtonText is the text of the web_app keyboard button, from which the Web App
1590	// was opened. Be aware that a bad client can send arbitrary data in this field.
1591	ButtonText string `json:"button_text"`
1592}
1593
1594// ProximityAlertTriggered represents a service message sent when a user in the
1595// chat triggers a proximity alert sent by another user.
1596type ProximityAlertTriggered struct {
1597	// Traveler is the user that triggered the alert
1598	Traveler User `json:"traveler"`
1599	// Watcher is the user that set the alert
1600	Watcher User `json:"watcher"`
1601	// Distance is the distance between the users
1602	Distance int `json:"distance"`
1603}
1604
1605// MessageAutoDeleteTimerChanged represents a service message about a change in
1606// auto-delete timer settings.
1607type MessageAutoDeleteTimerChanged struct {
1608	// New auto-delete time for messages in the chat.
1609	MessageAutoDeleteTime int `json:"message_auto_delete_time"`
1610}
1611
1612// ChatBoostAdded represents a service message about a user boosting a chat.
1613type ChatBoostAdded struct {
1614	// BoostCount is a number of boosts added by the user
1615	BoostCount int `json:"boost_count"`
1616}
1617
1618// ForumTopicCreated represents a service message about a new forum topic
1619// created in the chat.
1620type ForumTopicCreated struct {
1621	// Name is the name of topic
1622	Name string `json:"name"`
1623	// IconColor is the color of the topic icon in RGB format
1624	IconColor int `json:"icon_color"`
1625	// IconCustomEmojiID is the unique identifier of the custom emoji
1626	// shown as the topic icon
1627	//
1628	// optional
1629	IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
1630}
1631
1632// ForumTopicClosed represents a service message about a forum topic
1633// closed in the chat. Currently holds no information.
1634type ForumTopicClosed struct {
1635}
1636
1637// ForumTopicEdited object represents a service message about an edited forum topic.
1638type ForumTopicEdited struct {
1639	// Name is the new name of the topic, if it was edited
1640	//
1641	// optional
1642	Name string `json:"name,omitempty"`
1643	// IconCustomEmojiID is the new identifier of the custom emoji
1644	// shown as the topic icon, if it was edited;
1645	// an empty string if the icon was removed
1646	//
1647	// optional
1648	IconCustomEmojiID *string `json:"icon_custom_emoji_id,omitempty"`
1649}
1650
1651// ForumTopicReopened represents a service message about a forum topic
1652// reopened in the chat. Currently holds no information.
1653type ForumTopicReopened struct {
1654}
1655
1656// GeneralForumTopicHidden represents a service message about General forum topic
1657// hidden in the chat. Currently holds no information.
1658type GeneralForumTopicHidden struct {
1659}
1660
1661// GeneralForumTopicUnhidden represents a service message about General forum topic
1662// unhidden in the chat. Currently holds no information.
1663type GeneralForumTopicUnhidden struct {
1664}
1665
1666// UsersShared object contains information about the user whose identifier
1667// was shared with the bot using a KeyboardButtonRequestUser button.
1668type UsersShared struct {
1669	// RequestID is an indentifier of the request.
1670	RequestID int `json:"request_id"`
1671	// UserIDs are identifiers of the shared user.
1672	UserIDs []int64 `json:"user_ids"`
1673}
1674
1675// ChatShared contains information about the chat whose identifier
1676// was shared with the bot using a KeyboardButtonRequestChat button.
1677type ChatShared struct {
1678	// RequestID is an indentifier of the request.
1679	RequestID int `json:"request_id"`
1680	// ChatID is an identifier of the shared chat.
1681	ChatID int64 `json:"chat_id"`
1682}
1683
1684// WriteAccessAllowed represents a service message about a user allowing a bot
1685// to write messages after adding the bot to the attachment menu or launching
1686// a Web App from a link.
1687type WriteAccessAllowed struct {
1688	// FromRequest is true, if the access was granted after
1689	// the user accepted an explicit request from a Web App
1690	// sent by the method requestWriteAccess.
1691	//
1692	// Optional
1693	FromRequest bool `json:"from_request,omitempty"`
1694	// Name of the Web App which was launched from a link
1695	//
1696	// Optional
1697	WebAppName string `json:"web_app_name,omitempty"`
1698	// FromAttachmentMenu is true, if the access was granted when
1699	// the bot was added to the attachment or side menu
1700	//
1701	// Optional
1702	FromAttachmentMenu bool `json:"from_attachment_menu,omitempty"`
1703}
1704
1705// VideoChatScheduled represents a service message about a voice chat scheduled
1706// in the chat.
1707type VideoChatScheduled struct {
1708	// Point in time (Unix timestamp) when the voice chat is supposed to be
1709	// started by a chat administrator
1710	StartDate int `json:"start_date"`
1711}
1712
1713// Time converts the scheduled start date into a Time.
1714func (m *VideoChatScheduled) Time() time.Time {
1715	return time.Unix(int64(m.StartDate), 0)
1716}
1717
1718// VideoChatStarted represents a service message about a voice chat started in
1719// the chat.
1720type VideoChatStarted struct{}
1721
1722// VideoChatEnded represents a service message about a voice chat ended in the
1723// chat.
1724type VideoChatEnded struct {
1725	// Voice chat duration; in seconds.
1726	Duration int `json:"duration"`
1727}
1728
1729// VideoChatParticipantsInvited represents a service message about new members
1730// invited to a voice chat.
1731type VideoChatParticipantsInvited struct {
1732	// New members that were invited to the voice chat.
1733	//
1734	// optional
1735	Users []User `json:"users,omitempty"`
1736}
1737
1738// This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.
1739type GiveawayCreated struct{}
1740
1741// Giveaway represents a message about a scheduled giveaway.
1742type Giveaway struct {
1743	// Chats is the list of chats which the user must join to participate in the giveaway
1744	Chats []Chat `json:"chats"`
1745	// WinnersSelectionDate is point in time (Unix timestamp) when
1746	// winners of the giveaway will be selected
1747	WinnersSelectionDate int64 `json:"winners_selection_date"`
1748	// WinnerCount is the number of users which are supposed
1749	// to be selected as winners of the giveaway
1750	WinnerCount int `json:"winner_count"`
1751	// OnlyNewMembers True, if only users who join the chats after
1752	// the giveaway started should be eligible to win
1753	//
1754	// optional
1755	OnlyNewMembers bool `json:"only_new_members,omitempty"`
1756	// HasPublicWinners True, if the list of giveaway winners will be visible to everyone
1757	//
1758	// optional
1759	HasPublicWinners bool `json:"has_public_winners,omitempty"`
1760	// PrizeDescription is description of additional giveaway prize
1761	//
1762	// optional
1763	PrizeDescription string `json:"prize_description,omitempty"`
1764	// CountryCodes is a list of two-letter ISO 3166-1 alpha-2 country codes
1765	// indicating the countries from which eligible users for the giveaway must come.
1766	// If empty, then all users can participate in the giveaway.
1767	//
1768	// optional
1769	CountryCodes []string `json:"country_codes,omitempty"`
1770	// PremiumSubscriptionMonthCount the number of months the Telegram Premium
1771	// subscription won from the giveaway will be active for
1772	//
1773	// optional
1774	PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"`
1775}
1776
1777// Giveaway represents a message about a scheduled giveaway.
1778type GiveawayWinners struct {
1779	// Chat that created the giveaway
1780	Chat Chat `json:"chat"`
1781	// GiveawayMessageID is the identifier of the messsage with the giveaway in the chat
1782	GiveawayMessageID int `json:"giveaway_message_id"`
1783	// WinnersSelectionDate is point in time (Unix timestamp) when
1784	// winners of the giveaway will be selected
1785	WinnersSelectionDate int64 `json:"winners_selection_date"`
1786	// WinnerCount is the number of users which are supposed
1787	// to be selected as winners of the giveaway
1788	WinnerCount int `json:"winner_count"`
1789	// Winners is a list of up to 100 winners of the giveaway
1790	Winners []User `json:"winners"`
1791	// AdditionalChatCount is the number of other chats
1792	// the user had to join in order to be eligible for the giveaway
1793	//
1794	// optional
1795	AdditionalChatCount int `json:"additional_chat_count,omitempty"`
1796	// PremiumSubscriptionMonthCount the number of months the Telegram Premium
1797	// subscription won from the giveaway will be active for
1798	//
1799	// optional
1800	PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"`
1801	// UnclaimedPrizeCount is the number of undistributed prizes
1802	//
1803	// optional
1804	UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"`
1805	// OnlyNewMembers True, if only users who join the chats after
1806	// the giveaway started should be eligible to win
1807	//
1808	// optional
1809	OnlyNewMembers bool `json:"only_new_members,omitempty"`
1810	// WasRefunded True, if the giveaway was canceled because the payment for it was refunded
1811	//
1812	// optional
1813	WasRefunded bool `json:"was_refunded,omitempty"`
1814	// PrizeDescription is description of additional giveaway prize
1815	//
1816	// optional
1817	PrizeDescription string `json:"prize_description,omitempty"`
1818}
1819
1820// This object represents a service message about the completion of a giveaway without public winners.
1821type GiveawayCompleted struct {
1822	// Number of winners in the giveaway
1823	WinnerCount int `json:"winner_count"`
1824	// Number of undistributed prizes
1825	//
1826	// optional
1827	UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"`
1828	// Message with the giveaway that was completed, if it wasn't deleted
1829	//
1830	// optional
1831	GiveawayMessage *Message `json:"giveaway_message,omitempty"`
1832}
1833
1834// LinkPreviewOptions describes the options used for link preview generation.
1835type LinkPreviewOptions struct {
1836	// IsDisabled True, if the link preview is disabled
1837	//
1838	// optional
1839	IsDisabled bool `json:"is_disabled,omitempty"`
1840	// URL to use for the link preview. If empty,
1841	// then the first URL found in the message text will be used
1842	//
1843	// optional
1844	URL string `json:"url,omitempty"`
1845	// PreferSmallMedia True, if the media in the link preview is suppposed
1846	//  to be shrunk; ignored if the URL isn't explicitly specified
1847	// or media size change isn't supported for the preview
1848	//
1849	// optional
1850	PreferSmallMedia bool `json:"prefer_small_media,omitempty"`
1851	// PreferLargeMedia True, if the media in the link preview is suppposed
1852	// to be enlarged; ignored if the URL isn't explicitly specified
1853	// or media size change isn't supported for the preview
1854	//
1855	// optional
1856	PreferLargeMedia bool `json:"prefer_large_media,omitempty"`
1857	// ShowAboveText True, if the link preview must be shown above the message text;
1858	// otherwise, the link preview will be shown below the message text
1859	//
1860	// optional
1861	ShowAboveText bool `json:"show_above_text,omitempty"`
1862}
1863
1864// UserProfilePhotos contains a set of user profile photos.
1865type UserProfilePhotos struct {
1866	// TotalCount total number of profile pictures the target user has
1867	TotalCount int `json:"total_count"`
1868	// Photos requested profile pictures (in up to 4 sizes each)
1869	Photos [][]PhotoSize `json:"photos"`
1870}
1871
1872// File contains information about a file to download from Telegram.
1873type File struct {
1874	// FileID identifier for this file, which can be used to download or reuse
1875	// the file
1876	FileID string `json:"file_id"`
1877	// FileUniqueID is the unique identifier for this file, which is supposed to
1878	// be the same over time and for different bots. Can't be used to download
1879	// or reuse the file.
1880	FileUniqueID string `json:"file_unique_id"`
1881	// FileSize file size, if known
1882	//
1883	// optional
1884	FileSize int64 `json:"file_size,omitempty"`
1885	// FilePath file path
1886	//
1887	// optional
1888	FilePath string `json:"file_path,omitempty"`
1889}
1890
1891// Link returns a full path to the download URL for a File.
1892//
1893// It requires the Bot token to create the link.
1894func (f *File) Link(token string) string {
1895	return fmt.Sprintf(FileEndpoint, token, f.FilePath)
1896}
1897
1898// WebAppInfo contains information about a Web App.
1899type WebAppInfo struct {
1900	// URL is the HTTPS URL of a Web App to be opened with additional data as
1901	// specified in Initializing Web Apps.
1902	URL string `json:"url"`
1903}
1904
1905// ReplyKeyboardMarkup represents a custom keyboard with reply options.
1906type ReplyKeyboardMarkup struct {
1907	// Keyboard is an array of button rows, each represented by an Array of KeyboardButton objects
1908	Keyboard [][]KeyboardButton `json:"keyboard"`
1909	// IsPersistent requests clients to always show the keyboard
1910	// when the regular keyboard is hidden.
1911	// Defaults to false, in which case the custom keyboard can be hidden
1912	// and opened with a keyboard icon.
1913	//
1914	// optional
1915	IsPersistent bool `json:"is_persistent"`
1916	// ResizeKeyboard requests clients to resize the keyboard vertically for optimal fit
1917	// (e.g., make the keyboard smaller if there are just two rows of buttons).
1918	// Defaults to false, in which case the custom keyboard
1919	// is always of the same height as the app's standard keyboard.
1920	//
1921	// optional
1922	ResizeKeyboard bool `json:"resize_keyboard,omitempty"`
1923	// OneTimeKeyboard requests clients to hide the keyboard as soon as it's been used.
1924	// The keyboard will still be available, but clients will automatically display
1925	// the usual letter-keyboard in the chat – the user can press a special button
1926	// in the input field to see the custom keyboard again.
1927	// Defaults to false.
1928	//
1929	// optional
1930	OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`
1931	// InputFieldPlaceholder is the placeholder to be shown in the input field when
1932	// the keyboard is active; 1-64 characters.
1933	//
1934	// optional
1935	InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
1936	// Selective use this parameter if you want to show the keyboard to specific users only.
1937	// Targets:
1938	//  1) users that are @mentioned in the text of the Message object;
1939	//  2) if the bot's message is a reply (has Message.ReplyToMessage not nil), sender of the original message.
1940	//
1941	// Example: A user requests to change the bot's language,
1942	// bot replies to the request with a keyboard to select the new language.
1943	// Other users in the group don't see the keyboard.
1944	//
1945	// optional
1946	Selective bool `json:"selective,omitempty"`
1947}
1948
1949// KeyboardButton represents one button of the reply keyboard. For simple text
1950// buttons String can be used instead of this object to specify text of the
1951// button. Optional fields request_contact, request_location, and request_poll
1952// are mutually exclusive.
1953type KeyboardButton struct {
1954	// Text of the button. If none of the optional fields are used,
1955	// it will be sent as a message when the button is pressed.
1956	Text string `json:"text"`
1957	// RequestUsers if specified, pressing the button will open
1958	// a list of suitable users. Tapping on any user will send
1959	// their identifier to the bot in a "user_shared" service message.
1960	// Available in private chats only.
1961	//
1962	// optional
1963	RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"`
1964	// RequestChat if specified, pressing the button will open
1965	// a list of suitable chats. Tapping on a chat will send
1966	// its identifier to the bot in a "chat_shared" service message.
1967	// Available in private chats only.
1968	//
1969	// optional
1970	RequestChat *KeyboardButtonRequestChat `json:"request_chat,omitempty"`
1971	// RequestContact if True, the user's phone number will be sent
1972	// as a contact when the button is pressed.
1973	// Available in private chats only.
1974	//
1975	// optional
1976	RequestContact bool `json:"request_contact,omitempty"`
1977	// RequestLocation if True, the user's current location will be sent when
1978	// the button is pressed.
1979	// Available in private chats only.
1980	//
1981	// optional
1982	RequestLocation bool `json:"request_location,omitempty"`
1983	// RequestPoll if specified, the user will be asked to create a poll and send it
1984	// to the bot when the button is pressed. Available in private chats only
1985	//
1986	// optional
1987	RequestPoll *KeyboardButtonPollType `json:"request_poll,omitempty"`
1988	// WebApp if specified, the described Web App will be launched when the button
1989	// is pressed. The Web App will be able to send a “web_app_data” service
1990	// message. Available in private chats only.
1991	//
1992	// optional
1993	WebApp *WebAppInfo `json:"web_app,omitempty"`
1994}
1995
1996// KeyboardButtonRequestUsers defines the criteria used to request
1997// a suitable user. The identifier of the selected user will be shared
1998// with the bot when the corresponding button is pressed.
1999type KeyboardButtonRequestUsers struct {
2000	// RequestID is a signed 32-bit identifier of the request.
2001	RequestID int `json:"request_id"`
2002	// UserIsBot pass True to request a bot,
2003	// pass False to request a regular user.
2004	// If not specified, no additional restrictions are applied.
2005	//
2006	// optional
2007	UserIsBot *bool `json:"user_is_bot,omitempty"`
2008	// UserIsPremium pass True to request a premium user,
2009	// pass False to request a non-premium user.
2010	// If not specified, no additional restrictions are applied.
2011	//
2012	// optional
2013	UserIsPremium *bool `json:"user_is_premium,omitempty"`
2014	// MaxQuantity is the maximum number of users to be selected.
2015	// 1-10. Defaults to 1
2016	//
2017	// optional
2018	MaxQuantity int `json:"max_quantity,omitempty"`
2019}
2020
2021// KeyboardButtonRequestChat defines the criteria used to request
2022// a suitable chat. The identifier of the selected chat will be shared
2023// with the bot when the corresponding button is pressed.
2024type KeyboardButtonRequestChat struct {
2025	// RequestID is a signed 32-bit identifier of the request.
2026	RequestID int `json:"request_id"`
2027	// ChatIsChannel pass True to request a channel chat,
2028	// pass False to request a group or a supergroup chat.
2029	ChatIsChannel bool `json:"chat_is_channel"`
2030	// ChatIsForum pass True to request a forum supergroup,
2031	// pass False to request a non-forum chat.
2032	// If not specified, no additional restrictions are applied.
2033	//
2034	// optional
2035	ChatIsForum bool `json:"chat_is_forum,omitempty"`
2036	// ChatHasUsername pass True to request a supergroup or a channel with a username,
2037	// pass False to request a chat without a username.
2038	// If not specified, no additional restrictions are applied.
2039	//
2040	// optional
2041	ChatHasUsername bool `json:"chat_has_username,omitempty"`
2042	// ChatIsCreated pass True to request a chat owned by the user.
2043	// Otherwise, no additional restrictions are applied.
2044	//
2045	// optional
2046	ChatIsCreated bool `json:"chat_is_created,omitempty"`
2047	// UserAdministratorRights is a JSON-serialized object listing
2048	// the required administrator rights of the user in the chat.
2049	// If not specified, no additional restrictions are applied.
2050	//
2051	// optional
2052	UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights,omitempty"`
2053	// BotAdministratorRights is a JSON-serialized object listing
2054	// the required administrator rights of the bot in the chat.
2055	// The rights must be a subset of user_administrator_rights.
2056	// If not specified, no additional restrictions are applied.
2057	//
2058	// optional
2059	BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights,omitempty"`
2060	// BotIsMember pass True to request a chat with the bot as a member.
2061	// Otherwise, no additional restrictions are applied.
2062	//
2063	// optional
2064	BotIsMember bool `json:"bot_is_member,omitempty"`
2065}
2066
2067// KeyboardButtonPollType represents type of poll, which is allowed to
2068// be created and sent when the corresponding button is pressed.
2069type KeyboardButtonPollType struct {
2070	// Type is if quiz is passed, the user will be allowed to create only polls
2071	// in the quiz mode. If regular is passed, only regular polls will be
2072	// allowed. Otherwise, the user will be allowed to create a poll of any type.
2073	Type string `json:"type"`
2074}
2075
2076// ReplyKeyboardRemove Upon receiving a message with this object, Telegram
2077// clients will remove the current custom keyboard and display the default
2078// letter-keyboard. By default, custom keyboards are displayed until a new
2079// keyboard is sent by a bot. An exception is made for one-time keyboards
2080// that are hidden immediately after the user presses a button.
2081type ReplyKeyboardRemove struct {
2082	// RemoveKeyboard requests clients to remove the custom keyboard
2083	// (user will not be able to summon this keyboard;
2084	// if you want to hide the keyboard from sight but keep it accessible,
2085	// use one_time_keyboard in ReplyKeyboardMarkup).
2086	RemoveKeyboard bool `json:"remove_keyboard"`
2087	// Selective use this parameter if you want to remove the keyboard for specific users only.
2088	// Targets:
2089	//  1) users that are @mentioned in the text of the Message object;
2090	//  2) if the bot's message is a reply (has Message.ReplyToMessage not nil), sender of the original message.
2091	//
2092	// Example: A user votes in a poll, bot returns confirmation message
2093	// in reply to the vote and removes the keyboard for that user,
2094	// while still showing the keyboard with poll options to users who haven't voted yet.
2095	//
2096	// optional
2097	Selective bool `json:"selective,omitempty"`
2098}
2099
2100// InlineKeyboardMarkup represents an inline keyboard that appears right next to
2101// the message it belongs to.
2102type InlineKeyboardMarkup struct {
2103	// InlineKeyboard array of button rows, each represented by an Array of
2104	// InlineKeyboardButton objects
2105	InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
2106}
2107
2108// InlineKeyboardButton represents one button of an inline keyboard. You must
2109// use exactly one of the optional fields.
2110//
2111// Note that some values are references as even an empty string
2112// will change behavior.
2113//
2114// CallbackGame, if set, MUST be first button in first row.
2115type InlineKeyboardButton struct {
2116	// Text label text on the button
2117	Text string `json:"text"`
2118	// URL HTTP or tg:// url to be opened when button is pressed.
2119	//
2120	// optional
2121	URL *string `json:"url,omitempty"`
2122	// LoginURL is an HTTP URL used to automatically authorize the user. Can be
2123	// used as a replacement for the Telegram Login Widget
2124	//
2125	// optional
2126	LoginURL *LoginURL `json:"login_url,omitempty"`
2127	// CallbackData data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.
2128	//
2129	// optional
2130	CallbackData *string `json:"callback_data,omitempty"`
2131	// WebApp is the Description of the Web App that will be launched when the user presses the button.
2132	// The Web App will be able to send an arbitrary message on behalf of the user using the method
2133	// answerWebAppQuery. Available only in private chats between a user and the bot.
2134	//
2135	// optional
2136	WebApp *WebAppInfo `json:"web_app,omitempty"`
2137	// SwitchInlineQuery if set, pressing the button will prompt the user to select one of their chats,
2138	// open that chat and insert the bot's username and the specified inline query in the input field.
2139	// Can be empty, in which case just the bot's username will be inserted.
2140	//
2141	// This offers an easy way for users to start using your bot
2142	// in inline mode when they are currently in a private chat with it.
2143	// Especially useful when combined with switch_pm… actions – in this case
2144	// the user will be automatically returned to the chat they switched from,
2145	// skipping the chat selection screen.
2146	//
2147	// optional
2148	SwitchInlineQuery *string `json:"switch_inline_query,omitempty"`
2149	// SwitchInlineQueryCurrentChat if set, pressing the button will insert the bot's username
2150	// and the specified inline query in the current chat's input field.
2151	// Can be empty, in which case only the bot's username will be inserted.
2152	//
2153	// This offers a quick way for the user to open your bot in inline mode
2154	// in the same chat – good for selecting something from multiple options.
2155	//
2156	// optional
2157	SwitchInlineQueryCurrentChat *string `json:"switch_inline_query_current_chat,omitempty"`
2158	//SwitchInlineQueryChosenChat If set, pressing the button will prompt the user to
2159	//select one of their chats of the specified type, open that chat and insert the bot's
2160	//username and the specified inline query in the input field
2161	//
2162	//optional
2163	SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"`
2164	// CallbackGame description of the game that will be launched when the user presses the button.
2165	//
2166	// optional
2167	CallbackGame *CallbackGame `json:"callback_game,omitempty"`
2168	// Pay specify True, to send a Pay button.
2169	//
2170	// NOTE: This type of button must always be the first button in the first row.
2171	//
2172	// optional
2173	Pay bool `json:"pay,omitempty"`
2174}
2175
2176// LoginURL represents a parameter of the inline keyboard button used to
2177// automatically authorize a user. Serves as a great replacement for the
2178// Telegram Login Widget when the user is coming from Telegram. All the user
2179// needs to do is tap/click a button and confirm that they want to log in.
2180type LoginURL struct {
2181	// URL is an HTTP URL to be opened with user authorization data added to the
2182	// query string when the button is pressed. If the user refuses to provide
2183	// authorization data, the original URL without information about the user
2184	// will be opened. The data added is the same as described in Receiving
2185	// authorization data.
2186	//
2187	// NOTE: You must always check the hash of the received data to verify the
2188	// authentication and the integrity of the data as described in Checking
2189	// authorization.
2190	URL string `json:"url"`
2191	// ForwardText is the new text of the button in forwarded messages
2192	//
2193	// optional
2194	ForwardText string `json:"forward_text,omitempty"`
2195	// BotUsername is the username of a bot, which will be used for user
2196	// authorization. See Setting up a bot for more details. If not specified,
2197	// the current bot's username will be assumed. The url's domain must be the
2198	// same as the domain linked with the bot. See Linking your domain to the
2199	// bot for more details.
2200	//
2201	// optional
2202	BotUsername string `json:"bot_username,omitempty"`
2203	// RequestWriteAccess if true requests permission for your bot to send
2204	// messages to the user
2205	//
2206	// optional
2207	RequestWriteAccess bool `json:"request_write_access,omitempty"`
2208}
2209
2210// CallbackQuery represents an incoming callback query from a callback button in
2211// an inline keyboard. If the button that originated the query was attached to a
2212// message sent by the bot, the field message will be present. If the button was
2213// attached to a message sent via the bot (in inline mode), the field
2214// inline_message_id will be present. Exactly one of the fields data or
2215// game_short_name will be present.
2216type CallbackQuery struct {
2217	// ID unique identifier for this query
2218	ID string `json:"id"`
2219	// From sender
2220	From *User `json:"from"`
2221	// Message sent by the bot with the callback button that originated the query
2222	//
2223	// optional
2224	Message *Message `json:"message,omitempty"`
2225	// InlineMessageID identifier of the message sent via the bot in inline
2226	// mode, that originated the query.
2227	//
2228	// optional
2229	InlineMessageID string `json:"inline_message_id,omitempty"`
2230	// ChatInstance global identifier, uniquely corresponding to the chat to
2231	// which the message with the callback button was sent. Useful for high
2232	// scores in games.
2233	ChatInstance string `json:"chat_instance"`
2234	// Data associated with the callback button. Be aware that
2235	// a bad client can send arbitrary data in this field.
2236	//
2237	// optional
2238	Data string `json:"data,omitempty"`
2239	// GameShortName short name of a Game to be returned, serves as the unique identifier for the game.
2240	//
2241	// optional
2242	GameShortName string `json:"game_short_name,omitempty"`
2243}
2244
2245// IsInaccessibleMessage method that shows whether message is inaccessible
2246func (c CallbackQuery) IsInaccessibleMessage() bool {
2247	return c.Message != nil && c.Message.Date == 0
2248}
2249
2250func (c CallbackQuery) GetInaccessibleMessage() InaccessibleMessage {
2251	if c.Message == nil {
2252		return InaccessibleMessage{}
2253	}
2254	return InaccessibleMessage{
2255		Chat:      c.Message.Chat,
2256		MessageID: c.Message.MessageID,
2257	}
2258}
2259
2260// ForceReply when receiving a message with this object, Telegram clients will
2261// display a reply interface to the user (act as if the user has selected the
2262// bot's message and tapped 'Reply'). This can be extremely useful if you  want
2263// to create user-friendly step-by-step interfaces without having to sacrifice
2264// privacy mode.
2265type ForceReply struct {
2266	// ForceReply shows reply interface to the user,
2267	// as if they manually selected the bot's message and tapped 'Reply'.
2268	ForceReply bool `json:"force_reply"`
2269	// InputFieldPlaceholder is the placeholder to be shown in the input field when
2270	// the reply is active; 1-64 characters.
2271	//
2272	// optional
2273	InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`
2274	// Selective use this parameter if you want to force reply from specific users only.
2275	// Targets:
2276	//  1) users that are @mentioned in the text of the Message object;
2277	//  2) if the bot's message is a reply (has Message.ReplyToMessage not nil), sender of the original message.
2278	//
2279	// optional
2280	Selective bool `json:"selective,omitempty"`
2281}
2282
2283// ChatPhoto represents a chat photo.
2284type ChatPhoto struct {
2285	// SmallFileID is a file identifier of small (160x160) chat photo.
2286	// This file_id can be used only for photo download and
2287	// only for as long as the photo is not changed.
2288	SmallFileID string `json:"small_file_id"`
2289	// SmallFileUniqueID is a unique file identifier of small (160x160) chat
2290	// photo, which is supposed to be the same over time and for different bots.
2291	// Can't be used to download or reuse the file.
2292	SmallFileUniqueID string `json:"small_file_unique_id"`
2293	// BigFileID is a file identifier of big (640x640) chat photo.
2294	// This file_id can be used only for photo download and
2295	// only for as long as the photo is not changed.
2296	BigFileID string `json:"big_file_id"`
2297	// BigFileUniqueID is a file identifier of big (640x640) chat photo, which
2298	// is supposed to be the same over time and for different bots. Can't be
2299	// used to download or reuse the file.
2300	BigFileUniqueID string `json:"big_file_unique_id"`
2301}
2302
2303// ChatInviteLink represents an invite link for a chat.
2304type ChatInviteLink struct {
2305	// InviteLink is the invite link. If the link was created by another chat
2306	// administrator, then the second part of the link will be replaced with “…”.
2307	InviteLink string `json:"invite_link"`
2308	// Creator of the link.
2309	Creator User `json:"creator"`
2310	// CreatesJoinRequest is true if users joining the chat via the link need to
2311	// be approved by chat administrators.
2312	//
2313	// optional
2314	CreatesJoinRequest bool `json:"creates_join_request,omitempty"`
2315	// IsPrimary is true, if the link is primary.
2316	IsPrimary bool `json:"is_primary"`
2317	// IsRevoked is true, if the link is revoked.
2318	IsRevoked bool `json:"is_revoked"`
2319	// Name is the name of the invite link.
2320	//
2321	// optional
2322	Name string `json:"name,omitempty"`
2323	// ExpireDate is the point in time (Unix timestamp) when the link will
2324	// expire or has been expired.
2325	//
2326	// optional
2327	ExpireDate int `json:"expire_date,omitempty"`
2328	// MemberLimit is the maximum number of users that can be members of the
2329	// chat simultaneously after joining the chat via this invite link; 1-99999.
2330	//
2331	// optional
2332	MemberLimit int `json:"member_limit,omitempty"`
2333	// PendingJoinRequestCount is the number of pending join requests created
2334	// using this link.
2335	//
2336	// optional
2337	PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"`
2338}
2339
2340type ChatAdministratorRights struct {
2341	IsAnonymous         bool `json:"is_anonymous"`
2342	CanManageChat       bool `json:"can_manage_chat"`
2343	CanDeleteMessages   bool `json:"can_delete_messages"`
2344	CanManageVideoChats bool `json:"can_manage_video_chats"`
2345	CanRestrictMembers  bool `json:"can_restrict_members"`
2346	CanPromoteMembers   bool `json:"can_promote_members"`
2347	CanChangeInfo       bool `json:"can_change_info"`
2348	CanInviteUsers      bool `json:"can_invite_users"`
2349	CanPostMessages     bool `json:"can_post_messages"`
2350	CanEditMessages     bool `json:"can_edit_messages"`
2351	CanPinMessages      bool `json:"can_pin_messages"`
2352	CanPostStories      bool `json:"can_post_stories"`
2353	CanEditStories      bool `json:"can_edit_stories"`
2354	CanDeleteStories    bool `json:"can_delete_stories"`
2355	CanManageTopics     bool `json:"can_manage_topics"`
2356}
2357
2358// ChatMember contains information about one member of a chat.
2359type ChatMember struct {
2360	// User information about the user
2361	User *User `json:"user"`
2362	// Status the member's status in the chat.
2363	// Can be
2364	//  “creator”,
2365	//  “administrator”,
2366	//  “member”,
2367	//  “restricted”,
2368	//  “left” or
2369	//  “kicked”
2370	Status string `json:"status"`
2371	// CustomTitle owner and administrators only. Custom title for this user
2372	//
2373	// optional
2374	CustomTitle string `json:"custom_title,omitempty"`
2375	// IsAnonymous owner and administrators only. True, if the user's presence
2376	// in the chat is hidden
2377	//
2378	// optional
2379	IsAnonymous bool `json:"is_anonymous,omitempty"`
2380	// UntilDate restricted and kicked only.
2381	// Date when restrictions will be lifted for this user;
2382	// unix time.
2383	//
2384	// optional
2385	UntilDate int64 `json:"until_date,omitempty"`
2386	// CanBeEdited administrators only.
2387	// True, if the bot is allowed to edit administrator privileges of that user.
2388	//
2389	// optional
2390	CanBeEdited bool `json:"can_be_edited,omitempty"`
2391	// CanManageChat administrators only.
2392	// True, if the administrator can access the chat event log, chat
2393	// statistics, message statistics in channels, see channel members, see
2394	// anonymous administrators in supergroups and ignore slow mode. Implied by
2395	// any other administrator privilege.
2396	//
2397	// optional
2398	CanManageChat bool `json:"can_manage_chat,omitempty"`
2399	// CanPostMessages administrators only.
2400	// True, if the administrator can post in the channel;
2401	// channels only.
2402	//
2403	// optional
2404	CanPostMessages bool `json:"can_post_messages,omitempty"`
2405	// CanEditMessages administrators only.
2406	// True, if the administrator can edit messages of other users and can pin messages;
2407	// channels only.
2408	//
2409	// optional
2410	CanEditMessages bool `json:"can_edit_messages,omitempty"`
2411	// CanDeleteMessages administrators only.
2412	// True, if the administrator can delete messages of other users.
2413	//
2414	// optional
2415	CanDeleteMessages bool `json:"can_delete_messages,omitempty"`
2416	// CanManageVideoChats administrators only.
2417	// True, if the administrator can manage video chats.
2418	//
2419	// optional
2420	CanManageVideoChats bool `json:"can_manage_video_chats,omitempty"`
2421	// CanRestrictMembers administrators only.
2422	// True, if the administrator can restrict, ban or unban chat members.
2423	//
2424	// optional
2425	CanRestrictMembers bool `json:"can_restrict_members,omitempty"`
2426	// CanPromoteMembers administrators only.
2427	// True, if the administrator can add new administrators
2428	// with a subset of their own privileges or demote administrators that he has promoted,
2429	// directly or indirectly (promoted by administrators that were appointed by the user).
2430	//
2431	// optional
2432	CanPromoteMembers bool `json:"can_promote_members,omitempty"`
2433	// CanChangeInfo administrators and restricted only.
2434	// True, if the user is allowed to change the chat title, photo and other settings.
2435	//
2436	// optional
2437	CanChangeInfo bool `json:"can_change_info,omitempty"`
2438	// CanInviteUsers administrators and restricted only.
2439	// True, if the user is allowed to invite new users to the chat.
2440	//
2441	// optional
2442	CanInviteUsers bool `json:"can_invite_users,omitempty"`
2443	// CanPinMessages administrators and restricted only.
2444	// True, if the user is allowed to pin messages; groups and supergroups only
2445	//
2446	// optional
2447	CanPinMessages bool `json:"can_pin_messages,omitempty"`
2448	// CanPostStories administrators only.
2449	// True, if the administrator can post stories in the channel; channels only
2450	//
2451	// optional
2452	CanPostStories bool `json:"can_post_stories,omitempty"`
2453	// CanEditStories administrators only.
2454	// True, if the administrator can edit stories posted by other users; channels only
2455	//
2456	// optional
2457	CanEditStories bool `json:"can_edit_stories,omitempty"`
2458	// CanDeleteStories administrators only.
2459	// True, if the administrator can delete stories posted by other users; channels only
2460	//
2461	// optional
2462	CanDeleteStories bool `json:"can_delete_stories,omitempty"`
2463	// CanManageTopics administrators and restricted only.
2464	// True, if the user is allowed to create, rename,
2465	// close, and reopen forum topics; supergroups only
2466	//
2467	// optional
2468	CanManageTopics bool `json:"can_manage_topics,omitempty"`
2469	// IsMember is true, if the user is a member of the chat at the moment of
2470	// the request
2471	IsMember bool `json:"is_member"`
2472	// CanSendMessages
2473	//
2474	// optional
2475	CanSendMessages bool `json:"can_send_messages,omitempty"`
2476	// CanSendAudios restricted only.
2477	// True, if the user is allowed to send audios
2478	//
2479	// optional
2480	CanSendAudios bool `json:"can_send_audios,omitempty"`
2481	// CanSendDocuments restricted only.
2482	// True, if the user is allowed to send documents
2483	//
2484	// optional
2485	CanSendDocuments bool `json:"can_send_documents,omitempty"`
2486	// CanSendPhotos is restricted only.
2487	// True, if the user is allowed to send photos
2488	//
2489	// optional
2490	CanSendPhotos bool `json:"can_send_photos,omitempty"`
2491	// CanSendVideos restricted only.
2492	// True, if the user is allowed to send videos
2493	//
2494	// optional
2495	CanSendVideos bool `json:"can_send_videos,omitempty"`
2496	// CanSendVideoNotes restricted only.
2497	// True, if the user is allowed to send video notes
2498	//
2499	// optional
2500	CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"`
2501	// CanSendVoiceNotes restricted only.
2502	// True, if the user is allowed to send voice notes
2503	//
2504	// optional
2505	CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"`
2506	// CanSendPolls restricted only.
2507	// True, if the user is allowed to send polls
2508	//
2509	// optional
2510	CanSendPolls bool `json:"can_send_polls,omitempty"`
2511	// CanSendOtherMessages restricted only.
2512	// True, if the user is allowed to send audios, documents,
2513	// photos, videos, video notes and voice notes.
2514	//
2515	// optional
2516	CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"`
2517	// CanAddWebPagePreviews restricted only.
2518	// True, if the user is allowed to add web page previews to their messages.
2519	//
2520	// optional
2521	CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"`
2522}
2523
2524// IsCreator returns if the ChatMember was the creator of the chat.
2525func (chat ChatMember) IsCreator() bool { return chat.Status == "creator" }
2526
2527// IsAdministrator returns if the ChatMember is a chat administrator.
2528func (chat ChatMember) IsAdministrator() bool { return chat.Status == "administrator" }
2529
2530// HasLeft returns if the ChatMember left the chat.
2531func (chat ChatMember) HasLeft() bool { return chat.Status == "left" }
2532
2533// WasKicked returns if the ChatMember was kicked from the chat.
2534func (chat ChatMember) WasKicked() bool { return chat.Status == "kicked" }
2535
2536// SetCanSendMediaMessages is a method to replace field "can_send_media_messages".
2537// It sets CanSendAudio, CanSendDocuments, CanSendPhotos, CanSendVideos,
2538// CanSendVideoNotes, CanSendVoiceNotes to passed value.
2539func (chat *ChatMember) SetCanSendMediaMessages(b bool) {
2540	chat.CanSendAudios = b
2541	chat.CanSendDocuments = b
2542	chat.CanSendPhotos = b
2543	chat.CanSendVideos = b
2544	chat.CanSendVideoNotes = b
2545	chat.CanSendVoiceNotes = b
2546}
2547
2548// CanSendMediaMessages method to replace field "can_send_media_messages".
2549// It returns true if CanSendAudio and CanSendDocuments and CanSendPhotos and CanSendVideos and
2550// CanSendVideoNotes and CanSendVoiceNotes are true.
2551func (chat *ChatMember) CanSendMediaMessages() bool {
2552	return chat.CanSendAudios && chat.CanSendDocuments &&
2553		chat.CanSendPhotos && chat.CanSendVideos &&
2554		chat.CanSendVideoNotes && chat.CanSendVoiceNotes
2555}
2556
2557// ChatMemberUpdated represents changes in the status of a chat member.
2558type ChatMemberUpdated struct {
2559	// Chat the user belongs to.
2560	Chat Chat `json:"chat"`
2561	// From is the performer of the action, which resulted in the change.
2562	From User `json:"from"`
2563	// Date the change was done in Unix time.
2564	Date int `json:"date"`
2565	// Previous information about the chat member.
2566	OldChatMember ChatMember `json:"old_chat_member"`
2567	// New information about the chat member.
2568	NewChatMember ChatMember `json:"new_chat_member"`
2569	// InviteLink is the link which was used by the user to join the chat;
2570	// for joining by invite link events only.
2571	//
2572	// optional
2573	InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
2574	// ViaChatFolderInviteLink is True, if the user joined the chat
2575	// via a chat folder invite link
2576	//
2577	// optional
2578	ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link,omitempty"`
2579}
2580
2581// ChatJoinRequest represents a join request sent to a chat.
2582type ChatJoinRequest struct {
2583	// Chat to which the request was sent.
2584	Chat Chat `json:"chat"`
2585	// User that sent the join request.
2586	From User `json:"from"`
2587	// UserChatID identifier of a private chat with the user who sent the join request.
2588	UserChatID int64 `json:"user_chat_id"`
2589	// Date the request was sent in Unix time.
2590	Date int `json:"date"`
2591	// Bio of the user.
2592	//
2593	// optional
2594	Bio string `json:"bio,omitempty"`
2595	// InviteLink is the link that was used by the user to send the join request.
2596	//
2597	// optional
2598	InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
2599}
2600
2601// ChatPermissions describes actions that a non-administrator user is
2602// allowed to take in a chat. All fields are optional.
2603type ChatPermissions struct {
2604	// CanSendMessages is true, if the user is allowed to send text messages,
2605	// contacts, locations and venues
2606	//
2607	// optional
2608	CanSendMessages bool `json:"can_send_messages,omitempty"`
2609	// CanSendAudios is true, if the user is allowed to send audios
2610	//
2611	// optional
2612	CanSendAudios bool `json:"can_send_audios,omitempty"`
2613	// CanSendDocuments is true, if the user is allowed to send documents
2614	//
2615	// optional
2616	CanSendDocuments bool `json:"can_send_documents,omitempty"`
2617	// CanSendPhotos is true, if the user is allowed to send photos
2618	//
2619	// optional
2620	CanSendPhotos bool `json:"can_send_photos,omitempty"`
2621	// CanSendVideos is true, if the user is allowed to send videos
2622	//
2623	// optional
2624	CanSendVideos bool `json:"can_send_videos,omitempty"`
2625	// CanSendVideoNotes is true, if the user is allowed to send video notes
2626	//
2627	// optional
2628	CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"`
2629	// CanSendVoiceNotes is true, if the user is allowed to send voice notes
2630	//
2631	// optional
2632	CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"`
2633	// CanSendPolls is true, if the user is allowed to send polls, implies
2634	// can_send_messages
2635	//
2636	// optional
2637	CanSendPolls bool `json:"can_send_polls,omitempty"`
2638	// CanSendOtherMessages is true, if the user is allowed to send animations,
2639	// games, stickers and use inline bots, implies can_send_media_messages
2640	//
2641	// optional
2642	CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"`
2643	// CanAddWebPagePreviews is true, if the user is allowed to add web page
2644	// previews to their messages, implies can_send_media_messages
2645	//
2646	// optional
2647	CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"`
2648	// CanChangeInfo is true, if the user is allowed to change the chat title,
2649	// photo and other settings. Ignored in public supergroups
2650	//
2651	// optional
2652	CanChangeInfo bool `json:"can_change_info,omitempty"`
2653	// CanInviteUsers is true, if the user is allowed to invite new users to the
2654	// chat
2655	//
2656	// optional
2657	CanInviteUsers bool `json:"can_invite_users,omitempty"`
2658	// CanPinMessages is true, if the user is allowed to pin messages. Ignored
2659	// in public supergroups
2660	//
2661	// optional
2662	CanPinMessages bool `json:"can_pin_messages,omitempty"`
2663	// CanManageTopics is true, if the user is allowed to create forum topics.
2664	// If omitted defaults to the value of can_pin_messages
2665	//
2666	// optional
2667	CanManageTopics bool `json:"can_manage_topics,omitempty"`
2668}
2669
2670// SetCanSendMediaMessages is a method to replace field "can_send_media_messages".
2671// It sets CanSendAudio, CanSendDocuments, CanSendPhotos, CanSendVideos,
2672// CanSendVideoNotes, CanSendVoiceNotes to passed value.
2673func (c *ChatPermissions) SetCanSendMediaMessages(b bool) {
2674	c.CanSendAudios = b
2675	c.CanSendDocuments = b
2676	c.CanSendPhotos = b
2677	c.CanSendVideos = b
2678	c.CanSendVideoNotes = b
2679	c.CanSendVoiceNotes = b
2680}
2681
2682// CanSendMediaMessages method to replace field "can_send_media_messages".
2683// It returns true if CanSendAudio and CanSendDocuments and CanSendPhotos and CanSendVideos and
2684// CanSendVideoNotes and CanSendVoiceNotes are true.
2685func (c *ChatPermissions) CanSendMediaMessages() bool {
2686	return c.CanSendAudios && c.CanSendDocuments &&
2687		c.CanSendPhotos && c.CanSendVideos &&
2688		c.CanSendVideoNotes && c.CanSendVoiceNotes
2689}
2690
2691// ChatLocation represents a location to which a chat is connected.
2692type ChatLocation struct {
2693	// Location is the location to which the supergroup is connected. Can't be a
2694	// live location.
2695	Location Location `json:"location"`
2696	// Address is the location address; 1-64 characters, as defined by the chat
2697	// owner
2698	Address string `json:"address"`
2699}
2700
2701const (
2702	ReactionTypeEmoji       = "emoji"
2703	ReactionTypeCustomEmoji = "custom_emoji"
2704)
2705
2706// ReactionType describes the type of a reaction. Currently, it can be one of: "emoji", "custom_emoji"
2707type ReactionType struct {
2708	// Type of the reaction. Can be "emoji", "custom_emoji"
2709	Type string `json:"type"`
2710	// Emoji type "emoji" only. Is a reaction emoji.
2711	Emoji string `json:"emoji"`
2712	// CustomEmoji type "custom_emoji" only. Is a custom emoji identifier.
2713	CustomEmoji string `json:"custom_emoji"`
2714}
2715
2716func (r ReactionType) IsEmoji() bool {
2717	return r.Type == ReactionTypeEmoji
2718}
2719
2720func (r ReactionType) IsCustomEmoji() bool {
2721	return r.Type == ReactionTypeCustomEmoji
2722}
2723
2724// ReactionCount represents a reaction added to a message along with the number of times it was added.
2725type ReactionCount struct {
2726	// Type of the reaction
2727	Type ReactionType `json:"type"`
2728	// TotalCount number of times the reaction was added
2729	TotalCount int `json:"total_count"`
2730}
2731
2732// MessageReactionUpdated represents a change of a reaction on a message performed by a user.
2733type MessageReactionUpdated struct {
2734	// Chat containing the message the user reacted to.
2735	Chat Chat `json:"chat"`
2736	// MessageID unique identifier of the message inside the chat.
2737	MessageID int `json:"message_id"`
2738	// User that changed the reaction, if the user isn't anonymous.
2739	//
2740	// optional
2741	User *User `json:"user"`
2742	// ActorChat the chat on behalf of which the reaction was changed,
2743	// if the user is anonymous.
2744	//
2745	// optional
2746	ActorChat *Chat `json:"actor_chat"`
2747	// Date of the change in Unix time.
2748	Date int64 `json:"date"`
2749	// OldReaction is a previous list of reaction types that were set by the user.
2750	OldReaction []ReactionType `json:"old_reaction"`
2751	// NewReaction is a new list of reaction types that have been set by the user.
2752	NewReaction []ReactionType `json:"new_reaction"`
2753}
2754
2755// MessageReactionCountUpdated represents reaction changes on a message with anonymous reactions.
2756type MessageReactionCountUpdated struct {
2757	// Chat containing the message.
2758	Chat Chat `json:"chat"`
2759	// MessageID unique identifier of the message inside the chat.
2760	MessageID int `json:"message_id"`
2761	// Date of the change in Unix time.
2762	Date int64 `json:"date"`
2763	// Reactions is a list of reactions that are present on the message.
2764	Reactions []ReactionCount `json:"reactions"`
2765}
2766
2767// ForumTopic represents a forum topic.
2768type ForumTopic struct {
2769	// MessageThreadID is the unique identifier of the forum topic
2770	MessageThreadID int `json:"message_thread_id"`
2771	// Name is the name of the topic
2772	Name string `json:"name"`
2773	// IconColor is the color of the topic icon in RGB format
2774	IconColor int `json:"icon_color"`
2775	// IconCustomEmojiID is the unique identifier of the custom emoji
2776	// shown as the topic icon
2777	//
2778	// optional
2779	IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
2780}
2781
2782// BotCommand represents a bot command.
2783type BotCommand struct {
2784	// Command text of the command, 1-32 characters.
2785	// Can contain only lowercase English letters, digits and underscores.
2786	Command string `json:"command"`
2787	// Description of the command, 3-256 characters.
2788	Description string `json:"description"`
2789}
2790
2791// BotCommandScope represents the scope to which bot commands are applied.
2792//
2793// It contains the fields for all types of scopes, different types only support
2794// specific (or no) fields.
2795type BotCommandScope struct {
2796	Type   string `json:"type"`
2797	ChatID int64  `json:"chat_id,omitempty"`
2798	UserID int64  `json:"user_id,omitempty"`
2799}
2800
2801// BotName represents the bot's name.
2802type BotName struct {
2803	Name string `json:"name"`
2804}
2805
2806// BotDescription represents the bot's description.
2807type BotDescription struct {
2808	Description string `json:"description"`
2809}
2810
2811// BotShortDescription represents the bot's short description
2812type BotShortDescription struct {
2813	ShortDescription string `json:"short_description"`
2814}
2815
2816// MenuButton describes the bot's menu button in a private chat.
2817type MenuButton struct {
2818	// Type is the type of menu button, must be one of:
2819	// - `commands`
2820	// - `web_app`
2821	// - `default`
2822	Type string `json:"type"`
2823	// Text is the text on the button, for `web_app` type.
2824	Text string `json:"text,omitempty"`
2825	// WebApp is the description of the Web App that will be launched when the
2826	// user presses the button for the `web_app` type.
2827	WebApp *WebAppInfo `json:"web_app,omitempty"`
2828}
2829
2830const (
2831	ChatBoostSourcePremium  = "premium"
2832	ChatBoostSourceGiftCode = "gift_code"
2833	ChatBoostSourceGiveaway = "giveaway"
2834)
2835
2836// ChatBoostSource describes the source of a chat boost
2837type ChatBoostSource struct {
2838	// Source of the boost, It can be one of:
2839	// "premium", "gift_code", "giveaway"
2840	Source string `json:"source"`
2841	// For "premium": User that boosted the chat
2842	// For "gift_code": User for which the gift code was created
2843	// Optional for "giveaway": User that won the prize in the giveaway if any
2844	User *User `json:"user,omitempty"`
2845	// GiveawayMessageID "giveaway" only.
2846	// Is an identifier of a message in the chat with the giveaway;
2847	// the message could have been deleted already. May be 0 if the message isn't sent yet.
2848	GiveawayMessageID int `json:"giveaway_message_id,omitempty"`
2849	// IsUnclaimed "giveaway" only.
2850	// True, if the giveaway was completed, but there was no user to win the prize
2851	//
2852	// optional
2853	IsUnclaimed bool `json:"is_unclaimed,omitempty"`
2854}
2855
2856func (c ChatBoostSource) IsPremium() bool {
2857	return c.Source == ChatBoostSourcePremium
2858}
2859
2860func (c ChatBoostSource) IsGiftCode() bool {
2861	return c.Source == ChatBoostSourceGiftCode
2862}
2863
2864func (c ChatBoostSource) IsGiveaway() bool {
2865	return c.Source == ChatBoostSourceGiveaway
2866}
2867
2868// ChatBoost contains information about a chat boost.
2869type ChatBoost struct {
2870	// BoostID is an unique identifier of the boost
2871	BoostID string `json:"boost_id"`
2872	// AddDate is a point in time (Unix timestamp) when the chat was boosted
2873	AddDate int64 `json:"add_date"`
2874	// ExpirationDate is a point in time (Unix timestamp) when the boost will
2875	// automatically expire, unless the booster's Telegram Premium subscription is prolonged
2876	ExpirationDate int64 `json:"expiration_date"`
2877	// Source of the added boost
2878	Source ChatBoostSource `json:"source"`
2879}
2880
2881// ChatBoostUpdated represents a boost added to a chat or changed.
2882type ChatBoostUpdated struct {
2883	// Chat which was boosted
2884	Chat Chat `json:"chat"`
2885	// Boost infomation about the chat boost
2886	Boost ChatBoost `json:"boost"`
2887}
2888
2889// ChatBoostRemoved represents a boost removed from a chat.
2890type ChatBoostRemoved struct {
2891	// Chat which was boosted
2892	Chat Chat `json:"chat"`
2893	// BoostID unique identifier of the boost
2894	BoostID string `json:"boost_id"`
2895	// RemoveDate point in time (Unix timestamp) when the boost was removed
2896	RemoveDate int64 `json:"remove_date"`
2897	// Source of the removed boost
2898	Source ChatBoostSource `json:"source"`
2899}
2900
2901// UserChatBoosts represents a list of boosts added to a chat by a user.
2902type UserChatBoosts struct {
2903	// Boosts is the list of boosts added to the chat by the user
2904	Boosts []ChatBoost `json:"boosts"`
2905}
2906
2907// ResponseParameters are various errors that can be returned in APIResponse.
2908type ResponseParameters struct {
2909	// The group has been migrated to a supergroup with the specified identifier.
2910	//
2911	// optional
2912	MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
2913	// In case of exceeding flood control, the number of seconds left to wait
2914	// before the request can be repeated.
2915	//
2916	// optional
2917	RetryAfter int `json:"retry_after,omitempty"`
2918}
2919
2920// BaseInputMedia is a base type for the InputMedia types.
2921type BaseInputMedia struct {
2922	// Type of the result.
2923	Type string `json:"type"`
2924	// Media file to send. Pass a file_id to send a file
2925	// that exists on the Telegram servers (recommended),
2926	// pass an HTTP URL for Telegram to get a file from the Internet,
2927	// or pass “attach://<file_attach_name>” to upload a new one
2928	// using multipart/form-data under <file_attach_name> name.
2929	Media RequestFileData `json:"media"`
2930	// thumb intentionally missing as it is not currently compatible
2931
2932	// Caption of the video to be sent, 0-1024 characters after entities parsing.
2933	//
2934	// optional
2935	Caption string `json:"caption,omitempty"`
2936	// ParseMode mode for parsing entities in the video caption.
2937	// See formatting options for more details
2938	// (https://core.telegram.org/bots/api#formatting-options).
2939	//
2940	// optional
2941	ParseMode string `json:"parse_mode,omitempty"`
2942	// CaptionEntities is a list of special entities that appear in the caption,
2943	// which can be specified instead of parse_mode
2944	//
2945	// optional
2946	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
2947	// HasSpoiler pass True, if the photo needs to be covered with a spoiler animation
2948	//
2949	// optional
2950	HasSpoiler bool `json:"has_spoiler,omitempty"`
2951}
2952
2953// InputMediaPhoto is a photo to send as part of a media group.
2954type InputMediaPhoto struct {
2955	BaseInputMedia
2956}
2957
2958// InputMediaVideo is a video to send as part of a media group.
2959type InputMediaVideo struct {
2960	BaseInputMedia
2961	// Thumbnail of the file sent; can be ignored if thumbnail generation for
2962	// the file is supported server-side.
2963	//
2964	// optional
2965	Thumb RequestFileData `json:"thumbnail,omitempty"`
2966	// Width video width
2967	//
2968	// optional
2969	Width int `json:"width,omitempty"`
2970	// Height video height
2971	//
2972	// optional
2973	Height int `json:"height,omitempty"`
2974	// Duration video duration
2975	//
2976	// optional
2977	Duration int `json:"duration,omitempty"`
2978	// SupportsStreaming pass True, if the uploaded video is suitable for streaming.
2979	//
2980	// optional
2981	SupportsStreaming bool `json:"supports_streaming,omitempty"`
2982	// HasSpoiler pass True, if the video needs to be covered with a spoiler animation
2983	//
2984	// optional
2985	HasSpoiler bool `json:"has_spoiler,omitempty"`
2986}
2987
2988// InputMediaAnimation is an animation to send as part of a media group.
2989type InputMediaAnimation struct {
2990	BaseInputMedia
2991	// Thumbnail of the file sent; can be ignored if thumbnail generation for
2992	// the file is supported server-side.
2993	//
2994	// optional
2995	Thumb RequestFileData `json:"thumbnail,omitempty"`
2996	// Width video width
2997	//
2998	// optional
2999	Width int `json:"width,omitempty"`
3000	// Height video height
3001	//
3002	// optional
3003	Height int `json:"height,omitempty"`
3004	// Duration video duration
3005	//
3006	// optional
3007	Duration int `json:"duration,omitempty"`
3008	// HasSpoiler pass True, if the photo needs to be covered with a spoiler animation
3009	//
3010	// optional
3011	HasSpoiler bool `json:"has_spoiler,omitempty"`
3012}
3013
3014// InputMediaAudio is an audio to send as part of a media group.
3015type InputMediaAudio struct {
3016	BaseInputMedia
3017	// Thumbnail of the file sent; can be ignored if thumbnail generation for
3018	// the file is supported server-side.
3019	//
3020	// optional
3021	Thumb RequestFileData `json:"thumbnail,omitempty"`
3022	// Duration of the audio in seconds
3023	//
3024	// optional
3025	Duration int `json:"duration,omitempty"`
3026	// Performer of the audio
3027	//
3028	// optional
3029	Performer string `json:"performer,omitempty"`
3030	// Title of the audio
3031	//
3032	// optional
3033	Title string `json:"title,omitempty"`
3034}
3035
3036// InputMediaDocument is a general file to send as part of a media group.
3037type InputMediaDocument struct {
3038	BaseInputMedia
3039	// Thumbnail of the file sent; can be ignored if thumbnail generation for
3040	// the file is supported server-side.
3041	//
3042	// optional
3043	Thumb RequestFileData `json:"thumbnail,omitempty"`
3044	// DisableContentTypeDetection disables automatic server-side content type
3045	// detection for files uploaded using multipart/form-data. Always true, if
3046	// the document is sent as part of an album
3047	//
3048	// optional
3049	DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"`
3050}
3051
3052// Constant values for sticker types
3053const (
3054	StickerTypeRegular     = "regular"
3055	StickerTypeMask        = "mask"
3056	StickerTypeCustomEmoji = "custom_emoji"
3057)
3058
3059// Sticker represents a sticker.
3060type Sticker struct {
3061	// FileID is an identifier for this file, which can be used to download or
3062	// reuse the file
3063	FileID string `json:"file_id"`
3064	// FileUniqueID is a unique identifier for this file,
3065	// which is supposed to be the same over time and for different bots.
3066	// Can't be used to download or reuse the file.
3067	FileUniqueID string `json:"file_unique_id"`
3068	// Type is a type of the sticker, currently one of “regular”,
3069	// “mask”, “custom_emoji”. The type of the sticker is independent
3070	// from its format, which is determined by the fields is_animated and is_video.
3071	Type string `json:"type"`
3072	// Width sticker width
3073	Width int `json:"width"`
3074	// Height sticker height
3075	Height int `json:"height"`
3076	// IsAnimated true, if the sticker is animated
3077	//
3078	// optional
3079	IsAnimated bool `json:"is_animated,omitempty"`
3080	// IsVideo true, if the sticker is a video sticker
3081	//
3082	// optional
3083	IsVideo bool `json:"is_video,omitempty"`
3084	// Thumbnail sticker thumbnail in the .WEBP or .JPG format
3085	//
3086	// optional
3087	Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
3088	// Emoji associated with the sticker
3089	//
3090	// optional
3091	Emoji string `json:"emoji,omitempty"`
3092	// SetName of the sticker set to which the sticker belongs
3093	//
3094	// optional
3095	SetName string `json:"set_name,omitempty"`
3096	// PremiumAnimation for premium regular stickers, premium animation for the sticker
3097	//
3098	// optional
3099	PremiumAnimation *File `json:"premium_animation,omitempty"`
3100	// MaskPosition is for mask stickers, the position where the mask should be
3101	// placed
3102	//
3103	// optional
3104	MaskPosition *MaskPosition `json:"mask_position,omitempty"`
3105	// CustomEmojiID for custom emoji stickers, unique identifier of the custom emoji
3106	//
3107	// optional
3108	CustomEmojiID string `json:"custom_emoji_id,omitempty"`
3109	// NeedsRepainting True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places
3110	//
3111	//optional
3112	NeedsRepainting bool `json:"needs_reainting,omitempty"`
3113	// FileSize
3114	//
3115	// optional
3116	FileSize int `json:"file_size,omitempty"`
3117}
3118
3119// IsRegular returns if the Sticker is regular
3120func (s Sticker) IsRegular() bool {
3121	return s.Type == StickerTypeRegular
3122}
3123
3124// IsMask returns if the Sticker is mask
3125func (s Sticker) IsMask() bool {
3126	return s.Type == StickerTypeMask
3127}
3128
3129// IsCustomEmoji returns if the Sticker is custom emoji
3130func (s Sticker) IsCustomEmoji() bool {
3131	return s.Type == StickerTypeCustomEmoji
3132}
3133
3134// StickerSet represents a sticker set.
3135type StickerSet struct {
3136	// Name sticker set name
3137	Name string `json:"name"`
3138	// Title sticker set title
3139	Title string `json:"title"`
3140	// StickerType of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
3141	StickerType string `json:"sticker_type"`
3142	// IsAnimated true, if the sticker set contains animated stickers
3143	IsAnimated bool `json:"is_animated"`
3144	// IsVideo true, if the sticker set contains video stickers
3145	IsVideo bool `json:"is_video"`
3146	// ContainsMasks true, if the sticker set contains masks
3147	//
3148	// deprecated. Use sticker_type instead
3149	ContainsMasks bool `json:"contains_masks"`
3150	// Stickers list of all set stickers
3151	Stickers []Sticker `json:"stickers"`
3152	// Thumb is the sticker set thumbnail in the .WEBP or .TGS format
3153	Thumbnail *PhotoSize `json:"thumbnail"`
3154}
3155
3156// IsRegular returns if the StickerSet is regular
3157func (s StickerSet) IsRegular() bool {
3158	return s.StickerType == StickerTypeRegular
3159}
3160
3161// IsMask returns if the StickerSet is mask
3162func (s StickerSet) IsMask() bool {
3163	return s.StickerType == StickerTypeMask
3164}
3165
3166// IsCustomEmoji returns if the StickerSet is custom emoji
3167func (s StickerSet) IsCustomEmoji() bool {
3168	return s.StickerType == StickerTypeCustomEmoji
3169}
3170
3171// MaskPosition describes the position on faces where a mask should be placed
3172// by default.
3173type MaskPosition struct {
3174	// The part of the face relative to which the mask should be placed.
3175	// One of “forehead”, “eyes”, “mouth”, or “chin”.
3176	Point string `json:"point"`
3177	// Shift by X-axis measured in widths of the mask scaled to the face size,
3178	// from left to right. For example, choosing -1.0 will place mask just to
3179	// the left of the default mask position.
3180	XShift float64 `json:"x_shift"`
3181	// Shift by Y-axis measured in heights of the mask scaled to the face size,
3182	// from top to bottom. For example, 1.0 will place the mask just below the
3183	// default mask position.
3184	YShift float64 `json:"y_shift"`
3185	// Mask scaling coefficient. For example, 2.0 means double size.
3186	Scale float64 `json:"scale"`
3187}
3188
3189// InputSticker describes a sticker to be added to a sticker set.
3190type InputSticker struct {
3191	// The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL.
3192	Sticker RequestFile `json:"sticker"`
3193	// List of 1-20 emoji associated with the sticker
3194	EmojiList []string `json:"emoji_list"`
3195	// Position where the mask should be placed on faces. For “mask” stickers only.
3196	//
3197	// optional
3198	MaskPosition *MaskPosition `json:"mask_position"`
3199	// List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.
3200	//
3201	// optional
3202	Keywords []string `json:"keywords"`
3203}
3204
3205// Game represents a game. Use BotFather to create and edit games, their short
3206// names will act as unique identifiers.
3207type Game struct {
3208	// Title of the game
3209	Title string `json:"title"`
3210	// Description of the game
3211	Description string `json:"description"`
3212	// Photo that will be displayed in the game message in chats.
3213	Photo []PhotoSize `json:"photo"`
3214	// Text a brief description of the game or high scores included in the game message.
3215	// Can be automatically edited to include current high scores for the game
3216	// when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
3217	//
3218	// optional
3219	Text string `json:"text,omitempty"`
3220	// TextEntities special entities that appear in text, such as usernames, URLs, bot commands, etc.
3221	//
3222	// optional
3223	TextEntities []MessageEntity `json:"text_entities,omitempty"`
3224	// Animation is an animation that will be displayed in the game message in chats.
3225	// Upload via BotFather (https://t.me/botfather).
3226	//
3227	// optional
3228	Animation Animation `json:"animation,omitempty"`
3229}
3230
3231// GameHighScore is a user's score and position on the leaderboard.
3232type GameHighScore struct {
3233	// Position in high score table for the game
3234	Position int `json:"position"`
3235	// User user
3236	User User `json:"user"`
3237	// Score score
3238	Score int `json:"score"`
3239}
3240
3241// CallbackGame is for starting a game in an inline keyboard button.
3242type CallbackGame struct{}
3243
3244// SwitchInlineQueryChosenChat represents an inline button that switches the current
3245// user to inline mode in a chosen chat, with an optional default inline query.
3246type SwitchInlineQueryChosenChat struct {
3247	// Query is default inline query to be inserted in the input field.
3248	// If left empty, only the bot's username will be inserted
3249	//
3250	// optional
3251	Query string `json:"query,omitempty"`
3252	// AllowUserChats is True, if private chats with users can be chosen
3253	//
3254	// optional
3255	AllowUserChats bool `json:"allow_user_chats,omitempty"`
3256	// AllowBotChats is True, if private chats with bots can be chosen
3257	//
3258	// optional
3259	AllowBotChats bool `json:"allow_bot_chats,omitempty"`
3260	// AllowGroupChats is True, if group and supergroup chats can be chosen
3261	//
3262	// optional
3263	AllowGroupChats bool `json:"allow_group_chats,omitempty"`
3264	// AllowChannelChats is True, if channel chats can be chosen
3265	//
3266	// optional
3267	AllowChannelChats bool `json:"allow_channel_chats,omitempty"`
3268}
3269
3270// WebhookInfo is information about a currently set webhook.
3271type WebhookInfo struct {
3272	// URL webhook URL, may be empty if webhook is not set up.
3273	URL string `json:"url"`
3274	// HasCustomCertificate true, if a custom certificate was provided for webhook certificate checks.
3275	HasCustomCertificate bool `json:"has_custom_certificate"`
3276	// PendingUpdateCount number of updates awaiting delivery.
3277	PendingUpdateCount int `json:"pending_update_count"`
3278	// IPAddress is the currently used webhook IP address
3279	//
3280	// optional
3281	IPAddress string `json:"ip_address,omitempty"`
3282	// LastErrorDate unix time for the most recent error
3283	// that happened when trying to deliver an update via webhook.
3284	//
3285	// optional
3286	LastErrorDate int `json:"last_error_date,omitempty"`
3287	// LastErrorMessage error message in human-readable format for the most recent error
3288	// that happened when trying to deliver an update via webhook.
3289	//
3290	// optional
3291	LastErrorMessage string `json:"last_error_message,omitempty"`
3292	// LastSynchronizationErrorDate is the unix time of the most recent error that
3293	// happened when trying to synchronize available updates with Telegram datacenters.
3294	LastSynchronizationErrorDate int `json:"last_synchronization_error_date,omitempty"`
3295	// MaxConnections maximum allowed number of simultaneous
3296	// HTTPS connections to the webhook for update delivery.
3297	//
3298	// optional
3299	MaxConnections int `json:"max_connections,omitempty"`
3300	// AllowedUpdates is a list of update types the bot is subscribed to.
3301	// Defaults to all update types
3302	//
3303	// optional
3304	AllowedUpdates []string `json:"allowed_updates,omitempty"`
3305}
3306
3307// IsSet returns true if a webhook is currently set.
3308func (info WebhookInfo) IsSet() bool {
3309	return info.URL != ""
3310}
3311
3312// InlineQuery is a Query from Telegram for an inline request.
3313type InlineQuery struct {
3314	// ID unique identifier for this query
3315	ID string `json:"id"`
3316	// From sender
3317	From *User `json:"from"`
3318	// Query text of the query (up to 256 characters).
3319	Query string `json:"query"`
3320	// Offset of the results to be returned, can be controlled by the bot.
3321	Offset string `json:"offset"`
3322	// Type of the chat, from which the inline query was sent. Can be either
3323	// “sender” for a private chat with the inline query sender, “private”,
3324	// “group”, “supergroup”, or “channel”. The chat type should be always known
3325	// for requests sent from official clients and most third-party clients,
3326	// unless the request was sent from a secret chat
3327	//
3328	// optional
3329	ChatType string `json:"chat_type,omitempty"`
3330	// Location sender location, only for bots that request user location.
3331	//
3332	// optional
3333	Location *Location `json:"location,omitempty"`
3334}
3335
3336// InlineQueryResultCachedAudio is an inline query response with cached audio.
3337type InlineQueryResultCachedAudio struct {
3338	// Type of the result, must be audio
3339	Type string `json:"type"`
3340	// ID unique identifier for this result, 1-64 bytes
3341	ID string `json:"id"`
3342	// AudioID a valid file identifier for the audio file
3343	AudioID string `json:"audio_file_id"`
3344	// Caption 0-1024 characters after entities parsing
3345	//
3346	// optional
3347	Caption string `json:"caption,omitempty"`
3348	// ParseMode mode for parsing entities in the video caption.
3349	// See formatting options for more details
3350	// (https://core.telegram.org/bots/api#formatting-options).
3351	//
3352	// optional
3353	ParseMode string `json:"parse_mode,omitempty"`
3354	// CaptionEntities is a list of special entities that appear in the caption,
3355	// which can be specified instead of parse_mode
3356	//
3357	// optional
3358	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3359	// ReplyMarkup inline keyboard attached to the message
3360	//
3361	// optional
3362	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3363	// InputMessageContent content of the message to be sent instead of the audio
3364	//
3365	// optional
3366	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3367}
3368
3369// InlineQueryResultCachedDocument is an inline query response with cached document.
3370type InlineQueryResultCachedDocument struct {
3371	// Type of the result, must be a document
3372	Type string `json:"type"`
3373	// ID unique identifier for this result, 1-64 bytes
3374	ID string `json:"id"`
3375	// DocumentID a valid file identifier for the file
3376	DocumentID string `json:"document_file_id"`
3377	// Title for the result
3378	//
3379	// optional
3380	Title string `json:"title,omitempty"`
3381	// Caption of the document to be sent, 0-1024 characters after entities parsing
3382	//
3383	// optional
3384	Caption string `json:"caption,omitempty"`
3385	// Description short description of the result
3386	//
3387	// optional
3388	Description string `json:"description,omitempty"`
3389	// ParseMode mode for parsing entities in the video caption.
3390	//	// See formatting options for more details
3391	//	// (https://core.telegram.org/bots/api#formatting-options).
3392	//
3393	// optional
3394	ParseMode string `json:"parse_mode,omitempty"`
3395	// CaptionEntities is a list of special entities that appear in the caption,
3396	// which can be specified instead of parse_mode
3397	//
3398	// optional
3399	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3400	// ReplyMarkup inline keyboard attached to the message
3401	//
3402	// optional
3403	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3404	// InputMessageContent content of the message to be sent instead of the file
3405	//
3406	// optional
3407	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3408}
3409
3410// InlineQueryResultCachedGIF is an inline query response with cached gif.
3411type InlineQueryResultCachedGIF struct {
3412	// Type of the result, must be gif.
3413	Type string `json:"type"`
3414	// ID unique identifier for this result, 1-64 bytes.
3415	ID string `json:"id"`
3416	// GifID a valid file identifier for the GIF file.
3417	GIFID string `json:"gif_file_id"`
3418	// Title for the result
3419	//
3420	// optional
3421	Title string `json:"title,omitempty"`
3422	// Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
3423	//
3424	// optional
3425	Caption string `json:"caption,omitempty"`
3426	// ParseMode mode for parsing entities in the caption.
3427	// See formatting options for more details
3428	// (https://core.telegram.org/bots/api#formatting-options).
3429	//
3430	// optional
3431	ParseMode string `json:"parse_mode,omitempty"`
3432	// CaptionEntities is a list of special entities that appear in the caption,
3433	// which can be specified instead of parse_mode
3434	//
3435	// optional
3436	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3437	// ReplyMarkup inline keyboard attached to the message.
3438	//
3439	// optional
3440	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3441	// InputMessageContent content of the message to be sent instead of the GIF animation.
3442	//
3443	// optional
3444	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3445}
3446
3447// InlineQueryResultCachedMPEG4GIF is an inline query response with cached
3448// H.264/MPEG-4 AVC video without sound gif.
3449type InlineQueryResultCachedMPEG4GIF struct {
3450	// Type of the result, must be mpeg4_gif
3451	Type string `json:"type"`
3452	// ID unique identifier for this result, 1-64 bytes
3453	ID string `json:"id"`
3454	// MPEG4FileID a valid file identifier for the MP4 file
3455	MPEG4FileID string `json:"mpeg4_file_id"`
3456	// Title for the result
3457	//
3458	// optional
3459	Title string `json:"title,omitempty"`
3460	// Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing.
3461	//
3462	// optional
3463	Caption string `json:"caption,omitempty"`
3464	// ParseMode mode for parsing entities in the caption.
3465	// See formatting options for more details
3466	// (https://core.telegram.org/bots/api#formatting-options).
3467	//
3468	// optional
3469	ParseMode string `json:"parse_mode,omitempty"`
3470	// ParseMode mode for parsing entities in the video caption.
3471	// See formatting options for more details
3472	// (https://core.telegram.org/bots/api#formatting-options).
3473	//
3474	// optional
3475	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3476	// ReplyMarkup inline keyboard attached to the message.
3477	//
3478	// optional
3479	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3480	// InputMessageContent content of the message to be sent instead of the video animation.
3481	//
3482	// optional
3483	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3484}
3485
3486// InlineQueryResultCachedPhoto is an inline query response with cached photo.
3487type InlineQueryResultCachedPhoto struct {
3488	// Type of the result, must be a photo.
3489	Type string `json:"type"`
3490	// ID unique identifier for this result, 1-64 bytes.
3491	ID string `json:"id"`
3492	// PhotoID a valid file identifier of the photo.
3493	PhotoID string `json:"photo_file_id"`
3494	// Title for the result.
3495	//
3496	// optional
3497	Title string `json:"title,omitempty"`
3498	// Description short description of the result.
3499	//
3500	// optional
3501	Description string `json:"description,omitempty"`
3502	// Caption of the photo to be sent, 0-1024 characters after entities parsing.
3503	//
3504	// optional
3505	Caption string `json:"caption,omitempty"`
3506	// ParseMode mode for parsing entities in the photo caption.
3507	// See formatting options for more details
3508	// (https://core.telegram.org/bots/api#formatting-options).
3509	//
3510	// optional
3511	ParseMode string `json:"parse_mode,omitempty"`
3512	// CaptionEntities is a list of special entities that appear in the caption,
3513	// which can be specified instead of parse_mode
3514	//
3515	// optional
3516	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3517	// ReplyMarkup inline keyboard attached to the message.
3518	//
3519	// optional
3520	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3521	// InputMessageContent content of the message to be sent instead of the photo.
3522	//
3523	// optional
3524	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3525}
3526
3527// InlineQueryResultCachedSticker is an inline query response with cached sticker.
3528type InlineQueryResultCachedSticker struct {
3529	// Type of the result, must be a sticker
3530	Type string `json:"type"`
3531	// ID unique identifier for this result, 1-64 bytes
3532	ID string `json:"id"`
3533	// StickerID a valid file identifier of the sticker
3534	StickerID string `json:"sticker_file_id"`
3535	// Title is a title
3536	Title string `json:"title"`
3537	// ReplyMarkup inline keyboard attached to the message
3538	//
3539	// optional
3540	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3541	// InputMessageContent content of the message to be sent instead of the sticker
3542	//
3543	// optional
3544	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3545}
3546
3547// InlineQueryResultCachedVideo is an inline query response with cached video.
3548type InlineQueryResultCachedVideo struct {
3549	// Type of the result, must be video
3550	Type string `json:"type"`
3551	// ID unique identifier for this result, 1-64 bytes
3552	ID string `json:"id"`
3553	// VideoID a valid file identifier for the video file
3554	VideoID string `json:"video_file_id"`
3555	// Title for the result
3556	Title string `json:"title"`
3557	// Description short description of the result
3558	//
3559	// optional
3560	Description string `json:"description,omitempty"`
3561	// Caption of the video to be sent, 0-1024 characters after entities parsing
3562	//
3563	// optional
3564	Caption string `json:"caption,omitempty"`
3565	// ParseMode mode for parsing entities in the video caption.
3566	// See formatting options for more details
3567	// (https://core.telegram.org/bots/api#formatting-options).
3568	//
3569	// optional
3570	ParseMode string `json:"parse_mode,omitempty"`
3571	// CaptionEntities is a list of special entities that appear in the caption,
3572	// which can be specified instead of parse_mode
3573	//
3574	// optional
3575	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3576	// ReplyMarkup inline keyboard attached to the message
3577	//
3578	// optional
3579	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3580	// InputMessageContent content of the message to be sent instead of the video
3581	//
3582	// optional
3583	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3584}
3585
3586// InlineQueryResultCachedVoice is an inline query response with cached voice.
3587type InlineQueryResultCachedVoice struct {
3588	// Type of the result, must be voice
3589	Type string `json:"type"`
3590	// ID unique identifier for this result, 1-64 bytes
3591	ID string `json:"id"`
3592	// VoiceID a valid file identifier for the voice message
3593	VoiceID string `json:"voice_file_id"`
3594	// Title voice message title
3595	Title string `json:"title"`
3596	// Caption 0-1024 characters after entities parsing
3597	//
3598	// optional
3599	Caption string `json:"caption,omitempty"`
3600	// ParseMode mode for parsing entities in the video caption.
3601	// See formatting options for more details
3602	// (https://core.telegram.org/bots/api#formatting-options).
3603	//
3604	// optional
3605	ParseMode string `json:"parse_mode,omitempty"`
3606	// CaptionEntities is a list of special entities that appear in the caption,
3607	// which can be specified instead of parse_mode
3608	//
3609	// optional
3610	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3611	// ReplyMarkup inline keyboard attached to the message
3612	//
3613	// optional
3614	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3615	// InputMessageContent content of the message to be sent instead of the voice message
3616	//
3617	// optional
3618	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3619}
3620
3621// InlineQueryResultArticle represents a link to an article or web page.
3622type InlineQueryResultArticle struct {
3623	// Type of the result, must be article.
3624	Type string `json:"type"`
3625	// ID unique identifier for this result, 1-64 Bytes.
3626	ID string `json:"id"`
3627	// Title of the result
3628	Title string `json:"title"`
3629	// InputMessageContent content of the message to be sent.
3630	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3631	// ReplyMarkup Inline keyboard attached to the message.
3632	//
3633	// optional
3634	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3635	// URL of the result.
3636	//
3637	// optional
3638	URL string `json:"url,omitempty"`
3639	// HideURL pass True, if you don't want the URL to be shown in the message.
3640	//
3641	// optional
3642	HideURL bool `json:"hide_url,omitempty"`
3643	// Description short description of the result.
3644	//
3645	// optional
3646	Description string `json:"description,omitempty"`
3647	// ThumbURL url of the thumbnail for the result
3648	//
3649	// optional
3650	ThumbURL string `json:"thumbnail_url,omitempty"`
3651	// ThumbWidth thumbnail width
3652	//
3653	// optional
3654	ThumbWidth int `json:"thumbnail_width,omitempty"`
3655	// ThumbHeight thumbnail height
3656	//
3657	// optional
3658	ThumbHeight int `json:"thumbnail_height,omitempty"`
3659}
3660
3661// InlineQueryResultAudio is an inline query response audio.
3662type InlineQueryResultAudio struct {
3663	// Type of the result, must be audio
3664	Type string `json:"type"`
3665	// ID unique identifier for this result, 1-64 bytes
3666	ID string `json:"id"`
3667	// URL a valid url for the audio file
3668	URL string `json:"audio_url"`
3669	// Title is a title
3670	Title string `json:"title"`
3671	// Caption 0-1024 characters after entities parsing
3672	//
3673	// optional
3674	Caption string `json:"caption,omitempty"`
3675	// ParseMode mode for parsing entities in the video caption.
3676	// See formatting options for more details
3677	// (https://core.telegram.org/bots/api#formatting-options).
3678	//
3679	// optional
3680	ParseMode string `json:"parse_mode,omitempty"`
3681	// CaptionEntities is a list of special entities that appear in the caption,
3682	// which can be specified instead of parse_mode
3683	//
3684	// optional
3685	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3686	// Performer is a performer
3687	//
3688	// optional
3689	Performer string `json:"performer,omitempty"`
3690	// Duration audio duration in seconds
3691	//
3692	// optional
3693	Duration int `json:"audio_duration,omitempty"`
3694	// ReplyMarkup inline keyboard attached to the message
3695	//
3696	// optional
3697	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3698	// InputMessageContent content of the message to be sent instead of the audio
3699	//
3700	// optional
3701	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3702}
3703
3704// InlineQueryResultContact is an inline query response contact.
3705type InlineQueryResultContact struct {
3706	Type                string                `json:"type"`         // required
3707	ID                  string                `json:"id"`           // required
3708	PhoneNumber         string                `json:"phone_number"` // required
3709	FirstName           string                `json:"first_name"`   // required
3710	LastName            string                `json:"last_name"`
3711	VCard               string                `json:"vcard"`
3712	ReplyMarkup         *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3713	InputMessageContent interface{}           `json:"input_message_content,omitempty"`
3714	ThumbURL            string                `json:"thumbnail_url"`
3715	ThumbWidth          int                   `json:"thumbnail_width"`
3716	ThumbHeight         int                   `json:"thumbnail_height"`
3717}
3718
3719// InlineQueryResultGame is an inline query response game.
3720type InlineQueryResultGame struct {
3721	// Type of the result, must be game
3722	Type string `json:"type"`
3723	// ID unique identifier for this result, 1-64 bytes
3724	ID string `json:"id"`
3725	// GameShortName short name of the game
3726	GameShortName string `json:"game_short_name"`
3727	// ReplyMarkup inline keyboard attached to the message
3728	//
3729	// optional
3730	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3731}
3732
3733// InlineQueryResultDocument is an inline query response document.
3734type InlineQueryResultDocument struct {
3735	// Type of the result, must be a document
3736	Type string `json:"type"`
3737	// ID unique identifier for this result, 1-64 bytes
3738	ID string `json:"id"`
3739	// Title for the result
3740	Title string `json:"title"`
3741	// Caption of the document to be sent, 0-1024 characters after entities parsing
3742	//
3743	// optional
3744	Caption string `json:"caption,omitempty"`
3745	// URL a valid url for the file
3746	URL string `json:"document_url"`
3747	// MimeType of the content of the file, either “application/pdf” or “application/zip”
3748	MimeType string `json:"mime_type"`
3749	// Description short description of the result
3750	//
3751	// optional
3752	Description string `json:"description,omitempty"`
3753	// ReplyMarkup inline keyboard attached to the message
3754	//
3755	// optional
3756	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3757	// InputMessageContent content of the message to be sent instead of the file
3758	//
3759	// optional
3760	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3761	// ThumbURL url of the thumbnail (jpeg only) for the file
3762	//
3763	// optional
3764	ThumbURL string `json:"thumbnail_url,omitempty"`
3765	// ThumbWidth thumbnail width
3766	//
3767	// optional
3768	ThumbWidth int `json:"thumbnail_width,omitempty"`
3769	// ThumbHeight thumbnail height
3770	//
3771	// optional
3772	ThumbHeight int `json:"thumbnail_height,omitempty"`
3773}
3774
3775// InlineQueryResultGIF is an inline query response GIF.
3776type InlineQueryResultGIF struct {
3777	// Type of the result, must be gif.
3778	Type string `json:"type"`
3779	// ID unique identifier for this result, 1-64 bytes.
3780	ID string `json:"id"`
3781	// URL a valid URL for the GIF file. File size must not exceed 1MB.
3782	URL string `json:"gif_url"`
3783	// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
3784	ThumbURL string `json:"thumbnail_url"`
3785	// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
3786	ThumbMimeType string `json:"thumbnail_mime_type,omitempty"`
3787	// Width of the GIF
3788	//
3789	// optional
3790	Width int `json:"gif_width,omitempty"`
3791	// Height of the GIF
3792	//
3793	// optional
3794	Height int `json:"gif_height,omitempty"`
3795	// Duration of the GIF
3796	//
3797	// optional
3798	Duration int `json:"gif_duration,omitempty"`
3799	// Title for the result
3800	//
3801	// optional
3802	Title string `json:"title,omitempty"`
3803	// Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
3804	//
3805	// optional
3806	Caption string `json:"caption,omitempty"`
3807	// ParseMode mode for parsing entities in the video caption.
3808	// See formatting options for more details
3809	// (https://core.telegram.org/bots/api#formatting-options).
3810	//
3811	// optional
3812	ParseMode string `json:"parse_mode,omitempty"`
3813	// CaptionEntities is a list of special entities that appear in the caption,
3814	// which can be specified instead of parse_mode
3815	//
3816	// optional
3817	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3818	// ReplyMarkup inline keyboard attached to the message
3819	//
3820	// optional
3821	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3822	// InputMessageContent content of the message to be sent instead of the GIF animation.
3823	//
3824	// optional
3825	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3826}
3827
3828// InlineQueryResultLocation is an inline query response location.
3829type InlineQueryResultLocation struct {
3830	// Type of the result, must be location
3831	Type string `json:"type"`
3832	// ID unique identifier for this result, 1-64 Bytes
3833	ID string `json:"id"`
3834	// Latitude  of the location in degrees
3835	Latitude float64 `json:"latitude"`
3836	// Longitude of the location in degrees
3837	Longitude float64 `json:"longitude"`
3838	// Title of the location
3839	Title string `json:"title"`
3840	// HorizontalAccuracy is the radius of uncertainty for the location,
3841	// measured in meters; 0-1500
3842	//
3843	// optional
3844	HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
3845	// LivePeriod is the period in seconds for which the location can be
3846	// updated, should be between 60 and 86400.
3847	//
3848	// optional
3849	LivePeriod int `json:"live_period,omitempty"`
3850	// Heading is for live locations, a direction in which the user is moving,
3851	// in degrees. Must be between 1 and 360 if specified.
3852	//
3853	// optional
3854	Heading int `json:"heading,omitempty"`
3855	// ProximityAlertRadius is for live locations, a maximum distance for
3856	// proximity alerts about approaching another chat member, in meters. Must
3857	// be between 1 and 100000 if specified.
3858	//
3859	// optional
3860	ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
3861	// ReplyMarkup inline keyboard attached to the message
3862	//
3863	// optional
3864	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3865	// InputMessageContent content of the message to be sent instead of the location
3866	//
3867	// optional
3868	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3869	// ThumbURL url of the thumbnail for the result
3870	//
3871	// optional
3872	ThumbURL string `json:"thumbnail_url,omitempty"`
3873	// ThumbWidth thumbnail width
3874	//
3875	// optional
3876	ThumbWidth int `json:"thumbnail_width,omitempty"`
3877	// ThumbHeight thumbnail height
3878	//
3879	// optional
3880	ThumbHeight int `json:"thumbnail_height,omitempty"`
3881}
3882
3883// InlineQueryResultMPEG4GIF is an inline query response MPEG4 GIF.
3884type InlineQueryResultMPEG4GIF struct {
3885	// Type of the result, must be mpeg4_gif
3886	Type string `json:"type"`
3887	// ID unique identifier for this result, 1-64 bytes
3888	ID string `json:"id"`
3889	// URL a valid URL for the MP4 file. File size must not exceed 1MB
3890	URL string `json:"mpeg4_url"`
3891	// Width video width
3892	//
3893	// optional
3894	Width int `json:"mpeg4_width,omitempty"`
3895	// Height vVideo height
3896	//
3897	// optional
3898	Height int `json:"mpeg4_height,omitempty"`
3899	// Duration video duration
3900	//
3901	// optional
3902	Duration int `json:"mpeg4_duration,omitempty"`
3903	// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
3904	ThumbURL string `json:"thumbnail_url"`
3905	// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
3906	ThumbMimeType string `json:"thumbnail_mime_type,omitempty"`
3907	// Title for the result
3908	//
3909	// optional
3910	Title string `json:"title,omitempty"`
3911	// Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing.
3912	//
3913	// optional
3914	Caption string `json:"caption,omitempty"`
3915	// ParseMode mode for parsing entities in the video caption.
3916	// See formatting options for more details
3917	// (https://core.telegram.org/bots/api#formatting-options).
3918	//
3919	// optional
3920	ParseMode string `json:"parse_mode,omitempty"`
3921	// CaptionEntities is a list of special entities that appear in the caption,
3922	// which can be specified instead of parse_mode
3923	//
3924	// optional
3925	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3926	// ReplyMarkup inline keyboard attached to the message
3927	//
3928	// optional
3929	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3930	// InputMessageContent content of the message to be sent instead of the video animation
3931	//
3932	// optional
3933	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3934}
3935
3936// InlineQueryResultPhoto is an inline query response photo.
3937type InlineQueryResultPhoto struct {
3938	// Type of the result, must be article.
3939	Type string `json:"type"`
3940	// ID unique identifier for this result, 1-64 Bytes.
3941	ID string `json:"id"`
3942	// URL a valid URL of the photo. Photo must be in jpeg format.
3943	// Photo size must not exceed 5MB.
3944	URL string `json:"photo_url"`
3945	// MimeType
3946	MimeType string `json:"mime_type"`
3947	// Width of the photo
3948	//
3949	// optional
3950	Width int `json:"photo_width,omitempty"`
3951	// Height of the photo
3952	//
3953	// optional
3954	Height int `json:"photo_height,omitempty"`
3955	// ThumbURL url of the thumbnail for the photo.
3956	//
3957	// optional
3958	ThumbURL string `json:"thumbnail_url,omitempty"`
3959	// Title for the result
3960	//
3961	// optional
3962	Title string `json:"title,omitempty"`
3963	// Description short description of the result
3964	//
3965	// optional
3966	Description string `json:"description,omitempty"`
3967	// Caption of the photo to be sent, 0-1024 characters after entities parsing.
3968	//
3969	// optional
3970	Caption string `json:"caption,omitempty"`
3971	// ParseMode mode for parsing entities in the photo caption.
3972	// See formatting options for more details
3973	// (https://core.telegram.org/bots/api#formatting-options).
3974	//
3975	// optional
3976	ParseMode string `json:"parse_mode,omitempty"`
3977	// ReplyMarkup inline keyboard attached to the message.
3978	//
3979	// optional
3980	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
3981	// CaptionEntities is a list of special entities that appear in the caption,
3982	// which can be specified instead of parse_mode
3983	//
3984	// optional
3985	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
3986	// InputMessageContent content of the message to be sent instead of the photo.
3987	//
3988	// optional
3989	InputMessageContent interface{} `json:"input_message_content,omitempty"`
3990}
3991
3992// InlineQueryResultVenue is an inline query response venue.
3993type InlineQueryResultVenue struct {
3994	// Type of the result, must be venue
3995	Type string `json:"type"`
3996	// ID unique identifier for this result, 1-64 Bytes
3997	ID string `json:"id"`
3998	// Latitude of the venue location in degrees
3999	Latitude float64 `json:"latitude"`
4000	// Longitude of the venue location in degrees
4001	Longitude float64 `json:"longitude"`
4002	// Title of the venue
4003	Title string `json:"title"`
4004	// Address of the venue
4005	Address string `json:"address"`
4006	// FoursquareID foursquare identifier of the venue if known
4007	//
4008	// optional
4009	FoursquareID string `json:"foursquare_id,omitempty"`
4010	// FoursquareType foursquare type of the venue, if known.
4011	// (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
4012	//
4013	// optional
4014	FoursquareType string `json:"foursquare_type,omitempty"`
4015	// GooglePlaceID is the Google Places identifier of the venue
4016	//
4017	// optional
4018	GooglePlaceID string `json:"google_place_id,omitempty"`
4019	// GooglePlaceType is the Google Places type of the venue
4020	//
4021	// optional
4022	GooglePlaceType string `json:"google_place_type,omitempty"`
4023	// ReplyMarkup inline keyboard attached to the message
4024	//
4025	// optional
4026	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
4027	// InputMessageContent content of the message to be sent instead of the venue
4028	//
4029	// optional
4030	InputMessageContent interface{} `json:"input_message_content,omitempty"`
4031	// ThumbURL url of the thumbnail for the result
4032	//
4033	// optional
4034	ThumbURL string `json:"thumbnail_url,omitempty"`
4035	// ThumbWidth thumbnail width
4036	//
4037	// optional
4038	ThumbWidth int `json:"thumbnail_width,omitempty"`
4039	// ThumbHeight thumbnail height
4040	//
4041	// optional
4042	ThumbHeight int `json:"thumbnail_height,omitempty"`
4043}
4044
4045// InlineQueryResultVideo is an inline query response video.
4046type InlineQueryResultVideo struct {
4047	// Type of the result, must be video
4048	Type string `json:"type"`
4049	// ID unique identifier for this result, 1-64 bytes
4050	ID string `json:"id"`
4051	// URL a valid url for the embedded video player or video file
4052	URL string `json:"video_url"`
4053	// MimeType of the content of video url, “text/html” or “video/mp4”
4054	MimeType string `json:"mime_type"`
4055	//
4056	// ThumbURL url of the thumbnail (jpeg only) for the video
4057	// optional
4058	ThumbURL string `json:"thumbnail_url,omitempty"`
4059	// Title for the result
4060	Title string `json:"title"`
4061	// Caption of the video to be sent, 0-1024 characters after entities parsing
4062	//
4063	// optional
4064	Caption string `json:"caption,omitempty"`
4065	// Width video width
4066	//
4067	// optional
4068	Width int `json:"video_width,omitempty"`
4069	// Height video height
4070	//
4071	// optional
4072	Height int `json:"video_height,omitempty"`
4073	// Duration video duration in seconds
4074	//
4075	// optional
4076	Duration int `json:"video_duration,omitempty"`
4077	// Description short description of the result
4078	//
4079	// optional
4080	Description string `json:"description,omitempty"`
4081	// ReplyMarkup inline keyboard attached to the message
4082	//
4083	// optional
4084	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
4085	// InputMessageContent content of the message to be sent instead of the video.
4086	// This field is required if InlineQueryResultVideo is used to send
4087	// an HTML-page as a result (e.g., a YouTube video).
4088	//
4089	// optional
4090	InputMessageContent interface{} `json:"input_message_content,omitempty"`
4091}
4092
4093// InlineQueryResultVoice is an inline query response voice.
4094type InlineQueryResultVoice struct {
4095	// Type of the result, must be voice
4096	Type string `json:"type"`
4097	// ID unique identifier for this result, 1-64 bytes
4098	ID string `json:"id"`
4099	// URL a valid URL for the voice recording
4100	URL string `json:"voice_url"`
4101	// Title recording title
4102	Title string `json:"title"`
4103	// Caption 0-1024 characters after entities parsing
4104	//
4105	// optional
4106	Caption string `json:"caption,omitempty"`
4107	// ParseMode mode for parsing entities in the video caption.
4108	// See formatting options for more details
4109	// (https://core.telegram.org/bots/api#formatting-options).
4110	//
4111	// optional
4112	ParseMode string `json:"parse_mode,omitempty"`
4113	// CaptionEntities is a list of special entities that appear in the caption,
4114	// which can be specified instead of parse_mode
4115	//
4116	// optional
4117	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
4118	// Duration recording duration in seconds
4119	//
4120	// optional
4121	Duration int `json:"voice_duration,omitempty"`
4122	// ReplyMarkup inline keyboard attached to the message
4123	//
4124	// optional
4125	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
4126	// InputMessageContent content of the message to be sent instead of the voice recording
4127	//
4128	// optional
4129	InputMessageContent interface{} `json:"input_message_content,omitempty"`
4130}
4131
4132// ChosenInlineResult is an inline query result chosen by a User
4133type ChosenInlineResult struct {
4134	// ResultID the unique identifier for the result that was chosen
4135	ResultID string `json:"result_id"`
4136	// From the user that chose the result
4137	From *User `json:"from"`
4138	// Location sender location, only for bots that require user location
4139	//
4140	// optional
4141	Location *Location `json:"location,omitempty"`
4142	// InlineMessageID identifier of the sent inline message.
4143	// Available only if there is an inline keyboard attached to the message.
4144	// Will be also received in callback queries and can be used to edit the message.
4145	//
4146	// optional
4147	InlineMessageID string `json:"inline_message_id,omitempty"`
4148	// Query the query that was used to obtain the result
4149	Query string `json:"query"`
4150}
4151
4152// SentWebAppMessage contains information about an inline message sent by a Web App
4153// on behalf of a user.
4154type SentWebAppMessage struct {
4155	// Identifier of the sent inline message. Available only if there is an inline
4156	// keyboard attached to the message.
4157	//
4158	// optional
4159	InlineMessageID string `json:"inline_message_id,omitempty"`
4160}
4161
4162// InputTextMessageContent contains text for displaying
4163// as an inline query result.
4164type InputTextMessageContent struct {
4165	// Text of the message to be sent, 1-4096 characters
4166	Text string `json:"message_text"`
4167	// ParseMode mode for parsing entities in the message text.
4168	// See formatting options for more details
4169	// (https://core.telegram.org/bots/api#formatting-options).
4170	//
4171	// optional
4172	ParseMode string `json:"parse_mode,omitempty"`
4173	// Entities is a list of special entities that appear in message text, which
4174	// can be specified instead of parse_mode
4175	//
4176	// optional
4177	Entities []MessageEntity `json:"entities,omitempty"`
4178	// LinkPreviewOptions used for link preview generation for the original message
4179	//
4180	// Optional
4181	LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
4182}
4183
4184// InputLocationMessageContent contains a location for displaying
4185// as an inline query result.
4186type InputLocationMessageContent struct {
4187	// Latitude of the location in degrees
4188	Latitude float64 `json:"latitude"`
4189	// Longitude of the location in degrees
4190	Longitude float64 `json:"longitude"`
4191	// HorizontalAccuracy is the radius of uncertainty for the location,
4192	// measured in meters; 0-1500
4193	//
4194	// optional
4195	HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
4196	// LivePeriod is the period in seconds for which the location can be
4197	// updated, should be between 60 and 86400
4198	//
4199	// optional
4200	LivePeriod int `json:"live_period,omitempty"`
4201	// Heading is for live locations, a direction in which the user is moving,
4202	// in degrees. Must be between 1 and 360 if specified.
4203	//
4204	// optional
4205	Heading int `json:"heading,omitempty"`
4206	// ProximityAlertRadius is for live locations, a maximum distance for
4207	// proximity alerts about approaching another chat member, in meters. Must
4208	// be between 1 and 100000 if specified.
4209	//
4210	// optional
4211	ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
4212}
4213
4214// InputVenueMessageContent contains a venue for displaying
4215// as an inline query result.
4216type InputVenueMessageContent struct {
4217	// Latitude of the venue in degrees
4218	Latitude float64 `json:"latitude"`
4219	// Longitude of the venue in degrees
4220	Longitude float64 `json:"longitude"`
4221	// Title name of the venue
4222	Title string `json:"title"`
4223	// Address of the venue
4224	Address string `json:"address"`
4225	// FoursquareID foursquare identifier of the venue, if known
4226	//
4227	// optional
4228	FoursquareID string `json:"foursquare_id,omitempty"`
4229	// FoursquareType Foursquare type of the venue, if known
4230	//
4231	// optional
4232	FoursquareType string `json:"foursquare_type,omitempty"`
4233	// GooglePlaceID is the Google Places identifier of the venue
4234	//
4235	// optional
4236	GooglePlaceID string `json:"google_place_id,omitempty"`
4237	// GooglePlaceType is the Google Places type of the venue
4238	//
4239	// optional
4240	GooglePlaceType string `json:"google_place_type,omitempty"`
4241}
4242
4243// InputContactMessageContent contains a contact for displaying
4244// as an inline query result.
4245type InputContactMessageContent struct {
4246	// 	PhoneNumber contact's phone number
4247	PhoneNumber string `json:"phone_number"`
4248	// FirstName contact's first name
4249	FirstName string `json:"first_name"`
4250	// LastName contact's last name
4251	//
4252	// optional
4253	LastName string `json:"last_name,omitempty"`
4254	// Additional data about the contact in the form of a vCard
4255	//
4256	// optional
4257	VCard string `json:"vcard,omitempty"`
4258}
4259
4260// InputInvoiceMessageContent represents the content of an invoice message to be
4261// sent as the result of an inline query.
4262type InputInvoiceMessageContent struct {
4263	// Product name, 1-32 characters
4264	Title string `json:"title"`
4265	// Product description, 1-255 characters
4266	Description string `json:"description"`
4267	// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to
4268	// the user, use for your internal processes.
4269	Payload string `json:"payload"`
4270	// Payment provider token, obtained via Botfather
4271	ProviderToken string `json:"provider_token"`
4272	// Three-letter ISO 4217 currency code
4273	Currency string `json:"currency"`
4274	// Price breakdown, a JSON-serialized list of components (e.g. product
4275	// price, tax, discount, delivery cost, delivery tax, bonus, etc.)
4276	Prices []LabeledPrice `json:"prices"`
4277	// The maximum accepted amount for tips in the smallest units of the
4278	// currency (integer, not float/double).
4279	//
4280	// optional
4281	MaxTipAmount int `json:"max_tip_amount,omitempty"`
4282	// An array of suggested amounts of tip in the smallest units of the
4283	// currency (integer, not float/double). At most 4 suggested tip amounts can
4284	// be specified. The suggested tip amounts must be positive, passed in a
4285	// strictly increased order and must not exceed max_tip_amount.
4286	//
4287	// optional
4288	SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"`
4289	// A JSON-serialized object for data about the invoice, which will be shared
4290	// with the payment provider. A detailed description of the required fields
4291	// should be provided by the payment provider.
4292	//
4293	// optional
4294	ProviderData string `json:"provider_data,omitempty"`
4295	// URL of the product photo for the invoice. Can be a photo of the goods or
4296	// a marketing image for a service. People like it better when they see what
4297	// they are paying for.
4298	//
4299	// optional
4300	PhotoURL string `json:"photo_url,omitempty"`
4301	// Photo size
4302	//
4303	// optional
4304	PhotoSize int `json:"photo_size,omitempty"`
4305	// Photo width
4306	//
4307	// optional
4308	PhotoWidth int `json:"photo_width,omitempty"`
4309	// Photo height
4310	//
4311	// optional
4312	PhotoHeight int `json:"photo_height,omitempty"`
4313	// Pass True, if you require the user's full name to complete the order
4314	//
4315	// optional
4316	NeedName bool `json:"need_name,omitempty"`
4317	// Pass True, if you require the user's phone number to complete the order
4318	//
4319	// optional
4320	NeedPhoneNumber bool `json:"need_phone_number,omitempty"`
4321	// Pass True, if you require the user's email address to complete the order
4322	//
4323	// optional
4324	NeedEmail bool `json:"need_email,omitempty"`
4325	// Pass True, if you require the user's shipping address to complete the order
4326	//
4327	// optional
4328	NeedShippingAddress bool `json:"need_shipping_address,omitempty"`
4329	// Pass True, if user's phone number should be sent to provider
4330	//
4331	// optional
4332	SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"`
4333	// Pass True, if user's email address should be sent to provider
4334	//
4335	// optional
4336	SendEmailToProvider bool `json:"send_email_to_provider,omitempty"`
4337	// Pass True, if the final price depends on the shipping method
4338	//
4339	// optional
4340	IsFlexible bool `json:"is_flexible,omitempty"`
4341}
4342
4343// LabeledPrice represents a portion of the price for goods or services.
4344type LabeledPrice struct {
4345	// Label portion label
4346	Label string `json:"label"`
4347	// Amount price of the product in the smallest units of the currency (integer, not float/double).
4348	// For example, for a price of US$ 1.45 pass amount = 145.
4349	// See the exp parameter in currencies.json
4350	// (https://core.telegram.org/bots/payments/currencies.json),
4351	// it shows the number of digits past the decimal point
4352	// for each currency (2 for the majority of currencies).
4353	Amount int `json:"amount"`
4354}
4355
4356// Invoice contains basic information about an invoice.
4357type Invoice struct {
4358	// Title product name
4359	Title string `json:"title"`
4360	// Description product description
4361	Description string `json:"description"`
4362	// StartParameter unique bot deep-linking parameter that can be used to generate this invoice
4363	StartParameter string `json:"start_parameter"`
4364	// Currency three-letter ISO 4217 currency code
4365	// (see https://core.telegram.org/bots/payments#supported-currencies)
4366	Currency string `json:"currency"`
4367	// TotalAmount total price in the smallest units of the currency (integer, not float/double).
4368	// For example, for a price of US$ 1.45 pass amount = 145.
4369	// See the exp parameter in currencies.json
4370	// (https://core.telegram.org/bots/payments/currencies.json),
4371	// it shows the number of digits past the decimal point
4372	// for each currency (2 for the majority of currencies).
4373	TotalAmount int `json:"total_amount"`
4374}
4375
4376// ShippingAddress represents a shipping address.
4377type ShippingAddress struct {
4378	// CountryCode ISO 3166-1 alpha-2 country code
4379	CountryCode string `json:"country_code"`
4380	// State if applicable
4381	State string `json:"state"`
4382	// City city
4383	City string `json:"city"`
4384	// StreetLine1 first line for the address
4385	StreetLine1 string `json:"street_line1"`
4386	// StreetLine2 second line for the address
4387	StreetLine2 string `json:"street_line2"`
4388	// PostCode address post code
4389	PostCode string `json:"post_code"`
4390}
4391
4392// OrderInfo represents information about an order.
4393type OrderInfo struct {
4394	// Name user name
4395	//
4396	// optional
4397	Name string `json:"name,omitempty"`
4398	// PhoneNumber user's phone number
4399	//
4400	// optional
4401	PhoneNumber string `json:"phone_number,omitempty"`
4402	// Email user email
4403	//
4404	// optional
4405	Email string `json:"email,omitempty"`
4406	// ShippingAddress user shipping address
4407	//
4408	// optional
4409	ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"`
4410}
4411
4412// ShippingOption represents one shipping option.
4413type ShippingOption struct {
4414	// ID shipping option identifier
4415	ID string `json:"id"`
4416	// Title option title
4417	Title string `json:"title"`
4418	// Prices list of price portions
4419	Prices []LabeledPrice `json:"prices"`
4420}
4421
4422// SuccessfulPayment contains basic information about a successful payment.
4423type SuccessfulPayment struct {
4424	// Currency three-letter ISO 4217 currency code
4425	// (see https://core.telegram.org/bots/payments#supported-currencies)
4426	Currency string `json:"currency"`
4427	// TotalAmount total price in the smallest units of the currency (integer, not float/double).
4428	// For example, for a price of US$ 1.45 pass amount = 145.
4429	// See the exp parameter in currencies.json,
4430	// (https://core.telegram.org/bots/payments/currencies.json)
4431	// it shows the number of digits past the decimal point
4432	// for each currency (2 for the majority of currencies).
4433	TotalAmount int `json:"total_amount"`
4434	// InvoicePayload bot specified invoice payload
4435	InvoicePayload string `json:"invoice_payload"`
4436	// ShippingOptionID identifier of the shipping option chosen by the user
4437	//
4438	// optional
4439	ShippingOptionID string `json:"shipping_option_id,omitempty"`
4440	// OrderInfo order info provided by the user
4441	//
4442	// optional
4443	OrderInfo *OrderInfo `json:"order_info,omitempty"`
4444	// TelegramPaymentChargeID telegram payment identifier
4445	TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
4446	// ProviderPaymentChargeID provider payment identifier
4447	ProviderPaymentChargeID string `json:"provider_payment_charge_id"`
4448}
4449
4450// ShippingQuery contains information about an incoming shipping query.
4451type ShippingQuery struct {
4452	// ID unique query identifier
4453	ID string `json:"id"`
4454	// From user who sent the query
4455	From *User `json:"from"`
4456	// InvoicePayload bot specified invoice payload
4457	InvoicePayload string `json:"invoice_payload"`
4458	// ShippingAddress user specified shipping address
4459	ShippingAddress *ShippingAddress `json:"shipping_address"`
4460}
4461
4462// PreCheckoutQuery contains information about an incoming pre-checkout query.
4463type PreCheckoutQuery struct {
4464	// ID unique query identifier
4465	ID string `json:"id"`
4466	// From user who sent the query
4467	From *User `json:"from"`
4468	// Currency three-letter ISO 4217 currency code
4469	//	// (see https://core.telegram.org/bots/payments#supported-currencies)
4470	Currency string `json:"currency"`
4471	// TotalAmount total price in the smallest units of the currency (integer, not float/double).
4472	//	// For example, for a price of US$ 1.45 pass amount = 145.
4473	//	// See the exp parameter in currencies.json,
4474	//	// (https://core.telegram.org/bots/payments/currencies.json)
4475	//	// it shows the number of digits past the decimal point
4476	//	// for each currency (2 for the majority of currencies).
4477	TotalAmount int `json:"total_amount"`
4478	// InvoicePayload bot specified invoice payload
4479	InvoicePayload string `json:"invoice_payload"`
4480	// ShippingOptionID identifier of the shipping option chosen by the user
4481	//
4482	// optional
4483	ShippingOptionID string `json:"shipping_option_id,omitempty"`
4484	// OrderInfo order info provided by the user
4485	//
4486	// optional
4487	OrderInfo *OrderInfo `json:"order_info,omitempty"`
4488}