1
0
telegram/models.go

1981 lines
69 KiB
Go
Raw Normal View History

2017-09-04 18:31:19 +00:00
package telegram
2017-10-17 11:11:43 +00:00
import "encoding/json"
2017-09-04 18:31:19 +00:00
type (
2017-10-06 07:55:54 +00:00
// Response represents a response from the Telegram API with the result
// stored raw. If ok equals true, the request was successful, and the result
// of the query can be found in the result field. In case of an unsuccessful
// request, ok equals false, and the error is explained in the error field.
2017-09-04 18:31:19 +00:00
Response struct {
Ok bool `json:"ok"`
2017-10-17 11:11:43 +00:00
ErrorCode int `json:"error_code,omitempty"`
Description string `json:"description,omitempty"`
Result *json.RawMessage `json:"result,omitempty"`
Parameters *ResponseParameters `json:"parameters,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Update represents an incoming update.
//
// At most one of the optional parameters can be present in any given update.
Update struct {
2017-10-06 07:55:54 +00:00
// The updates unique identifier. Update identifiers start from a
// certain positive number and increase sequentially. This ID becomes
// especially handy if youre using Webhooks, since it allows you to
// ignore repeated updates or to restore the correct update sequence,
// should they get out of order.
2017-09-04 18:31:19 +00:00
ID int `json:"update_id"`
// New incoming message of any kind — text, photo, sticker, etc.
2017-10-06 07:55:54 +00:00
Message *Message `json:"message,omitempty"`
2017-09-04 18:31:19 +00:00
// New version of a message that is known to the bot and was edited
2017-10-06 07:55:54 +00:00
EditedMessage *Message `json:"edited_message,omitempty"`
2017-09-04 18:31:19 +00:00
// New incoming channel post of any kind — text, photo, sticker, etc.
2017-10-06 07:55:54 +00:00
ChannelPost *Message `json:"channel_post,omitempty"`
2017-09-04 18:31:19 +00:00
// New version of a channel post that is known to the bot and was edited
2017-10-06 07:55:54 +00:00
EditedChannelPost *Message `json:"adited_channel_post,omitempty"`
2017-09-04 18:31:19 +00:00
// New incoming inline query
2017-10-06 07:55:54 +00:00
InlineQuery *InlineQuery `json:"inline_query,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// The result of an inline query that was chosen by a user and sent to
// their chat partner.
ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`
2017-09-04 18:31:19 +00:00
// New incoming callback query
2017-10-06 07:55:54 +00:00
CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`
2017-09-04 18:31:19 +00:00
// New incoming shipping query. Only for invoices with flexible price
2017-10-06 07:55:54 +00:00
ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// New incoming pre-checkout query. Contains full information about
// checkout
PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"`
2017-09-04 18:31:19 +00:00
}
// WebhookInfo contains information about the current status of a webhook.
WebhookInfo struct {
// Webhook URL, may be empty if webhook is not set up
URL string `json:"url"`
// Error message in human-readable format for the most recent error that
// happened when trying to deliver an update via webhook
LastErrorMessage string `json:"last_error_message,omitempty"`
2017-10-06 07:55:54 +00:00
// True, if a custom certificate was provided for webhook certificate
// checks
2017-09-04 18:31:19 +00:00
HasCustomCertificate bool `json:"has_custom_certificate"`
// Number of updates awaiting delivery
PendingUpdateCount int `json:"pending_update_count"`
2017-10-06 07:55:54 +00:00
// Maximum allowed number of simultaneous HTTPS connections to the
// webhook for update delivery
MaxConnections int `json:"max_connections,omitempty"`
2017-09-04 18:31:19 +00:00
// Unix time for the most recent error that happened when trying to
// deliver an update via webhook
LastErrorDate int64 `json:"last_error_date,omitempty"`
2017-10-06 07:55:54 +00:00
// A list of update types the bot is subscribed to. Defaults to all
// update types
AllowedUpdates []string `json:"allowed_updates,omitempty"`
2017-09-04 18:31:19 +00:00
}
// User represents a Telegram user or bot.
User struct {
// Unique identifier for this user or bot
ID int `json:"id"`
// True, if this user is a bot
IsBot bool `json:"is_bot"`
// Users or bots first name
FirstName string `json:"first_name"`
// Users or bots last name
2017-10-06 07:55:54 +00:00
LastName string `json:"last_name,omitempty"`
2017-09-04 18:31:19 +00:00
// Users or bots username
2017-10-06 07:55:54 +00:00
Username string `json:"username,omitempty"`
2017-09-04 18:31:19 +00:00
// IETF language tag of the user's language
2017-10-06 07:55:54 +00:00
LanguageCode string `json:"language_code,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Chat represents a chat.
Chat struct {
// Unique identifier for this chat.
ID int64 `json:"id"`
2017-10-06 07:55:54 +00:00
// Type of chat, can be either "private", "group", "supergroup" or
// "channel"
2017-09-04 18:31:19 +00:00
Type string `json:"type"`
2017-10-25 08:21:36 +00:00
// Title, for supergroups, channels and group chats
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Username, for private chats, supergroups and channels if available
2017-10-06 07:55:54 +00:00
Username string `json:"username,omitempty"`
2017-09-04 18:31:19 +00:00
// First name of the other party in a private chat
2017-10-06 07:55:54 +00:00
FirstName string `json:"first_name,omitempty"`
2017-09-04 18:31:19 +00:00
// Last name of the other party in a private chat
2017-10-06 07:55:54 +00:00
LastName string `json:"last_name,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Description, for supergroups and channel chats. Returned only in
// getChat.
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Chat invite link, for supergroups and channel chats. Returned only in
// getChat.
InviteLink string `json:"invite_link,omitempty"`
2017-09-04 18:31:19 +00:00
// For supergroups, name of Group sticker set. Returned only in getChat.
StickerSetName string `json:"sticker_set_name,omitempty"`
// True if a group has All Members Are Admins enabled.
AllMembersAreAdministrators bool `json:"all_members_are_administrators,omitempty"`
2017-10-17 11:11:43 +00:00
// True, if the bot can change group the sticker set. Returned only in
// getChat.
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
// Chat photo. Returned only in getChat.
Photo *ChatPhoto `json:"photo,omitempty"`
// Pinned message, for supergroups. Returned only in getChat.
PinnedMessage *Message `json:"pinned_message,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Message represents a message.
Message struct {
2017-10-06 07:55:54 +00:00
// Unique message identifier inside this chat
ID int `json:"message_id"`
2017-09-04 18:31:19 +00:00
// For messages forwarded from channels, identifier of the original
// message in the channel
ForwardFromMessageID int `json:"forward_from_message_id,omitempty"`
2017-09-04 18:31:19 +00:00
// Sender, empty for messages sent to channels
2017-10-06 07:55:54 +00:00
From *User `json:"from,omitempty"`
2017-09-04 18:31:19 +00:00
// For forwarded messages, sender of the original message
ForwardFrom *User `json:"forward_from,omitempty"`
// A member was removed from the group, information about them (this
// member may be the bot itself)
LeftChatMember *User `json:"left_chat_member,omitempty"`
2017-09-04 18:31:19 +00:00
// Date the message was sent in Unix time
2017-10-17 11:11:43 +00:00
Date int64 `json:"date"`
2017-09-04 18:31:19 +00:00
// For forwarded messages, date the original message was sent in Unix
// time
ForwardDate int64 `json:"forward_date,omitempty"`
// Date the message was last edited in Unix time
EditDate int64 `json:"edit_date,omitempty"`
// The group has been migrated to a supergroup with the specified
// identifier.
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
// The supergroup has been migrated from a group with the specified
// identifier.
MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"`
2017-09-04 18:31:19 +00:00
// Conversation the message belongs to
Chat *Chat `json:"chat"`
2017-10-06 07:55:54 +00:00
// For messages forwarded from channels, information about the original
// channel
ForwardFromChat *Chat `json:"forward_from_chat,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// For messages forwarded from channels, signature of the post author if
// present
ForwardSignature string `json:"forward_signature,omitempty"`
2017-09-04 18:31:19 +00:00
// The unique identifier of a media message group this message belongs to
MediaGroupID string `json:"media_group_id,omitempty"`
2017-09-04 18:31:19 +00:00
// Signature of the post author for messages in channels
2017-10-06 07:55:54 +00:00
AuthorSignature string `json:"author_signature,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// For text messages, the actual UTF-8 text of the message, 0-4096
// characters.
Text string `json:"text,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption for the document, photo or video, 0-200 characters
Caption string `json:"caption,omitempty"`
// A chat title was changed to this value
NewChatTitle string `json:"new_chat_title,omitempty"`
// The domain name of the website on which the user has logged in.
ConnectedWebsite string `json:"connected_website,omitempty"`
// For replies, the original message. Note that the Message object in
// this field will not contain further reply_to_message fields even if it
// itself is a reply.
ReplyToMessage *Message `json:"reply_to_message,omitempty"`
// Specified message was pinned. Note that the Message object in this
// field will not contain further reply_to_message fields even if it is
// itself a reply.
PinnedMessage *Message `json:"pinned_message,omitempty"`
2017-10-06 07:55:54 +00:00
// For text messages, special entities like usernames, URLs, bot
// commands, etc. that appear in the text
2017-10-06 08:51:37 +00:00
Entities []MessageEntity `json:"entities,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-25 08:21:36 +00:00
// For messages with a caption, special entities like usernames, URLs,
// bot commands, etc. that appear in the caption
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is an audio file, information about the file
2017-10-06 08:51:37 +00:00
Audio *Audio `json:"audio,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a general file, information about the file
2017-10-06 07:55:54 +00:00
Document *Document `json:"document,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Message is a game, information about the game.
Game *Game `json:"game,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a photo, available sizes of the photo
2017-10-06 08:51:37 +00:00
Photo []PhotoSize `json:"photo,omitempty"`
2017-09-04 18:31:19 +00:00
// A chat photo was change to this value
NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a sticker, information about the sticker
2017-10-06 07:55:54 +00:00
Sticker *Sticker `json:"sticker,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a video, information about the video
2017-10-06 07:55:54 +00:00
Video *Video `json:"video,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a voice message, information about the file
2017-10-06 07:55:54 +00:00
Voice *Voice `json:"voice,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a video note, information about the video message
2017-10-06 07:55:54 +00:00
VideoNote *VideoNote `json:"video_note,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a shared contact, information about the contact
2017-10-06 07:55:54 +00:00
Contact *Contact `json:"contact,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a shared location, information about the location
2017-10-06 07:55:54 +00:00
Location *Location `json:"location,omitempty"`
2017-09-04 18:31:19 +00:00
// Message is a venue, information about the venue
2017-10-06 07:55:54 +00:00
Venue *Venue `json:"venue,omitempty"`
2017-09-04 18:31:19 +00:00
// New members that were added to the group or supergroup and information
// about them (the bot itself may be one of these members)
NewChatMembers []User `json:"new_chat_members,omitempty"`
2017-09-04 18:31:19 +00:00
// Service message: the chat photo was deleted
2017-10-06 07:55:54 +00:00
DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"`
2017-09-04 18:31:19 +00:00
// Service message: the group has been created
2017-10-06 07:55:54 +00:00
GroupChatCreated bool `json:"group_chat_created,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Service message: the supergroup has been created. This field cant be
// received in a message coming through updates, because bot cant be a
// member of a supergroup when it is created. It can only be found in
// reply_to_message if someone replies to a very first message in a
// directly created supergroup.
SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Service message: the channel has been created. This field cant be
// received in a message coming through updates, because bot cant be a
// member of a channel when it is created. It can only be found in
// reply_to_message if someone replies to a very first message in a
// channel.
ChannelChatCreated bool `json:"channel_chat_created,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Message is an invoice for a payment, information about the invoice.
Invoice *Invoice `json:"invoice,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Message is a service message about a successful payment, information
// about the payment.
SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// MessageEntity represents one special entity in a text message. For
// example, hashtags, usernames, URLs, etc.
2017-09-04 18:31:19 +00:00
MessageEntity struct {
2017-10-06 07:55:54 +00:00
// Type of the entity. Can be mention (@username), hashtag, bot_command,
// url, email, bold (bold text), italic (italic text), code (monowidth
// string), pre (monowidth block), text_link (for clickable text URLs),
// text_mention (for users without usernames)
2017-09-04 18:31:19 +00:00
Type string `json:"type"`
// For "text_link" only, url that will be opened after user taps on the
// text
URL string `json:"url,omitempty"`
2017-09-04 18:31:19 +00:00
// Offset in UTF-16 code units to the start of the entity
Offset int `json:"offset"`
// Length of the entity in UTF-16 code units
Length int `json:"length"`
2017-10-06 07:55:54 +00:00
// For "text_mention" only, the mentioned user
User *User `json:"user,omitempty"`
2017-09-04 18:31:19 +00:00
}
// PhotoSize represents one size of a photo or a file / sticker thumbnail.
PhotoSize struct {
// Unique identifier for this file
FileID string `json:"file_id"`
// Photo width
Width int `json:"width"`
// Photo height
Height int `json:"height"`
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// Audio represents an audio file to be treated as music by the Telegram
// clients.
2017-09-04 18:31:19 +00:00
Audio struct {
// Unique identifier for this file
FileID string `json:"file_id"`
// Performer of the audio as defined by sender or by audio tags
2017-10-06 07:55:54 +00:00
Performer string `json:"performer,omitempty"`
2017-09-04 18:31:19 +00:00
// Title of the audio as defined by sender or by audio tags
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// MIME type of the file as defined by sender
2017-10-06 07:55:54 +00:00
MimeType string `json:"mime_type,omitempty"`
2017-09-04 18:31:19 +00:00
// Duration of the audio in seconds as defined by sender
Duration int `json:"duration"`
2017-09-04 18:31:19 +00:00
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// Document represents a general file (as opposed to photos, voice messages
// and audio files).
2017-09-04 18:31:19 +00:00
Document struct {
// Unique file identifier
FileID string `json:"file_id"`
// Original filename as defined by sender
2017-10-06 07:55:54 +00:00
FileName string `json:"file_name,omitempty"`
2017-09-04 18:31:19 +00:00
// MIME type of the file as defined by sender
2017-10-06 07:55:54 +00:00
MimeType string `json:"mime_type,omitempty"`
2017-09-04 18:31:19 +00:00
// Document thumbnail as defined by sender
Thumb *PhotoSize `json:"thumb,omitempty"`
2017-09-04 18:31:19 +00:00
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Video represents a video file.
Video struct {
// Unique identifier for this file
FileID string `json:"file_id"`
// Mime type of a file as defined by sender
MimeType string `json:"mime_type,omitempty"`
2017-09-04 18:31:19 +00:00
// Video width as defined by sender
Width int `json:"width"`
// Video height as defined by sender
Height int `json:"height"`
// Duration of the video in seconds as defined by sender
Duration int `json:"duration"`
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
// Video thumbnail
Thumb *PhotoSize `json:"thumb,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Voice represents a voice note.
Voice struct {
// Unique identifier for this file
FileID string `json:"file_id"`
// MIME type of the file as defined by sender
2017-10-06 07:55:54 +00:00
MimeType string `json:"mime_type,omitempty"`
2017-09-04 18:31:19 +00:00
// Duration of the audio in seconds as defined by sender
Duration int `json:"duration"`
2017-09-04 18:31:19 +00:00
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// VideoNote represents a video message (available in Telegram apps as of
// v.4.0).
2017-09-04 18:31:19 +00:00
VideoNote struct {
// Unique identifier for this file
FileID string `json:"file_id"`
// Video width and height as defined by sender
Length int `json:"length"`
2017-09-04 18:31:19 +00:00
// Duration of the video in seconds as defined by sender
Duration int `json:"duration"`
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
// Video thumbnail
Thumb *PhotoSize `json:"thumb,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Contact represents a phone contact.
Contact struct {
// Contact's phone number
PhoneNumber string `json:"phone_number"`
// Contact's first name
FirstName string `json:"first_name"`
// Contact's last name
2017-10-06 07:55:54 +00:00
LastName string `json:"last_name,omitempty"`
2017-09-04 18:31:19 +00:00
// Contact's user identifier in Telegram
2017-10-06 07:55:54 +00:00
UserID int `json:"user_id,omitempty"`
2017-09-04 18:31:19 +00:00
}
// Location represents a point on the map.
Location struct {
// Longitude as defined by sender
Longitude float32 `json:"longitude"`
// Latitude as defined by sender
Latitude float32 `json:"latitude"`
}
// Venue represents a venue.
Venue struct {
// Venue location
Location *Location `json:"location"`
// Name of the venue
Title string `json:"title"`
// Address of the venue
Address string `json:"address"`
// Foursquare identifier of the venue
2017-10-06 07:55:54 +00:00
FoursquareID string `json:"foursquare_id,omitempty"`
2017-09-04 18:31:19 +00:00
}
// UserProfilePhotos represent a user's profile pictures.
UserProfilePhotos struct {
// Total number of profile pictures the target user has
TotalCount int `json:"total_count"`
// Requested profile pictures (in up to 4 sizes each)
2017-10-06 08:51:37 +00:00
Photos [][]PhotoSize `json:"photos"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// File represents a file ready to be downloaded. The file can be downloaded
// via the link https://api.telegram.org/file/bot<token>/<file_path>. It is
// guaranteed that the link will be valid for at least 1 hour. When the link
// expires, a new one can be requested by calling getFile.
2017-09-04 18:31:19 +00:00
//
// Maximum file size to download is 20 MB
File struct {
// Unique identifier for this file
FileID string `json:"file_id"`
2017-10-06 07:55:54 +00:00
// File path. Use https://api.telegram.org/file/bot<token>/<file_path> to
// get the file.
FilePath string `json:"file_path,omitempty"`
// File size, if known
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// ReplyKeyboardMarkup represents a custom keyboard with reply options (see
// Introduction to bots for details and examples).
2017-09-04 18:31:19 +00:00
ReplyKeyboardMarkup struct {
2017-10-06 07:55:54 +00:00
// Array of button rows, each represented by an Array of KeyboardButton
// objects
2017-10-05 14:08:09 +00:00
Keyboard [][]KeyboardButton `json:"keyboard"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Requests clients to resize the keyboard vertically for optimal fit
// (e.g., make the keyboard smaller if there are just two rows of
// buttons). Defaults to false, in which case the custom keyboard is
// always of the same height as the app's standard keyboard.
ResizeKeyboard bool `json:"resize_keyboard,omitempty"`
// Requests clients to hide the keyboard as soon as it's been used. The
// keyboard will still be available, but clients will automatically
// display the usual letter-keyboard in the chat the user can press a
// special button in the input field to see the custom keyboard again.
// Defaults to false.
OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`
// Use this parameter if you want to show the keyboard to specific users
// only. Targets: 1) users that are @mentioned in the text of the Message
// object; 2) if the bot's message is a reply (has reply_to_message_id),
// sender of the original message.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// Example: A user requests to change the bots language, bot replies to
// the request with a keyboard to select the new language. Other users in
// the group dont see the keyboard.
Selective bool `json:"selective,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// KeyboardButton represents one button of the reply keyboard. For simple
// text buttons String can be used instead of this object to specify text of
// the button. Optional fields are mutually exclusive.
2017-09-04 18:31:19 +00:00
KeyboardButton struct {
2017-10-06 07:55:54 +00:00
// Text of the button. If none of the optional fields are used, it will
// be sent to the bot as a message when the button is pressed
2017-09-04 18:31:19 +00:00
Text string `json:"text"`
2017-10-06 07:55:54 +00:00
// If True, the user's phone number will be sent as a contact when the
// button is pressed. Available in private chats only
RequestContact bool `json:"request_contact,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// If True, the user's current location will be sent when the button is
// pressed. Available in private chats only
RequestLocation bool `json:"request_location,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// ReplyKeyboardRemove will remove the current custom keyboard and display
// the default letter-keyboard. By default, custom keyboards are displayed
// until a new keyboard is sent by a bot. An exception is made for one-time
// keyboards that are hidden immediately after the user presses a button
// (see ReplyKeyboardMarkup).
2017-09-04 18:31:19 +00:00
ReplyKeyboardRemove struct {
2017-10-06 07:55:54 +00:00
// Requests clients to remove the custom keyboard (user will not be able
// to summon this keyboard; if you want to hide the keyboard from sight
// but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
2017-10-17 11:11:43 +00:00
RemoveKeyboard bool `json:"remove_keyboard"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Use this parameter if you want to remove the keyboard for specific
// users only. Targets: 1) users that are @mentioned in the text of the
// Message object; 2) if the bot's message is a reply (has
// reply_to_message_id), sender of the original message.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// Example: A user votes in a poll, bot returns confirmation message in
// reply to the vote and removes the keyboard for that user, while still
// showing the keyboard with poll options to users who haven't voted yet.
Selective bool `json:"selective,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineKeyboardMarkup represents an inline keyboard that appears right next
// to the message it belongs to.
2017-09-04 18:31:19 +00:00
InlineKeyboardMarkup struct {
2017-10-06 07:55:54 +00:00
// Array of button rows, each represented by an Array of
// InlineKeyboardButton objects
2017-09-04 18:31:19 +00:00
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}
2017-10-06 07:55:54 +00:00
// InlineKeyboardButton represents one button of an inline keyboard. You
// must use exactly one of the optional fields.
2017-09-04 18:31:19 +00:00
InlineKeyboardButton struct {
// Label text on the button
Text string `json:"text"`
// HTTP url to be opened when button is pressed
2017-10-06 07:55:54 +00:00
URL string `json:"url,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Data to be sent in a callback query to the bot when button is pressed,
// 1-64 bytes
CallbackData string `json:"callback_data,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// If set, pressing the button will prompt the user to select one of
// their chats, open that chat and insert the bots username and the
// specified inline query in the input field. Can be empty, in which
// case just the bots username will be inserted.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// Note: This offers an easy way for users to start using your bot in
// inline mode when they are currently in a private chat with it.
// Especially useful when combined with switch_pm… actions in this case
// the user will be automatically returned to the chat they switched
// from, skipping the chat selection screen.
SwitchInlineQuery string `json:"switch_inline_query,omitempty"`
// If set, pressing the button will insert the bots username and the
// specified inline query in the current chat's input field. Can be
// empty, in which case only the bots username will be inserted.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// This offers a quick way for the user to open your bot in inline mode
// in the same chat good for selecting something from multiple options.
SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Description of the game that will be launched when the user presses
// the button.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// NOTE: This type of button must always be the first button in the
// first row.
CallbackGame *CallbackGame `json:"callback_game,omitempty"`
2017-09-04 18:31:19 +00:00
// Specify True, to send a Pay button.
//
2017-10-06 07:55:54 +00:00
// NOTE: This type of button must always be the first button in the
// first row.
Pay bool `json:"pay,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// CallbackQuery represents an incoming callback query from a callback button
// in an inline keyboard. If the button that originated the query was
// attached to a message sent by the bot, the field message will be present.
// If the button was attached to a message sent via the bot (in inline mode),
// the field inline_message_id will be present. Exactly one of the fields
// data or game_short_name will be present.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// NOTE: After the user presses a callback button, Telegram clients will
// display a progress bar until you call answerCallbackQuery. It is,
// therefore, necessary to react by calling answerCallbackQuery even if no
// notification to the user is needed (e.g., without specifying any of the
// optional parameters).
2017-09-04 18:31:19 +00:00
CallbackQuery struct {
// Unique identifier for this query
ID string `json:"id"`
2017-10-06 07:55:54 +00:00
// Identifier of the message sent via the bot in inline mode, that
// originated the query.
InlineMessageID string `json:"inline_message_id,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Global identifier, uniquely corresponding to the chat to which the
// message with the callback button was sent. Useful for high scores in
// games.
2017-09-04 18:31:19 +00:00
ChatInstance string `json:"chat_instance"`
2017-10-06 07:55:54 +00:00
// Data associated with the callback button. Be aware that a bad client
// can send arbitrary data in this field.
Data string `json:"data,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Short name of a Game to be returned, serves as the unique identifier
// for the game
GameShortName string `json:"game_short_name,omitempty"`
// Sender
From *User `json:"from"`
// Message with the callback button that originated the query. Note that
// message content and message date will not be available if the message
// is too old
Message *Message `json:"message,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// ForceReply display a reply interface to the user (act as if the user has
// selected the bots message and tapped Reply'). This can be extremely
// useful if you want to create user-friendly step-by-step interfaces without
// having to sacrifice privacy mode.
2017-09-04 18:31:19 +00:00
ForceReply struct {
2017-10-06 07:55:54 +00:00
// Shows reply interface to the user, as if they manually selected the
// bots message and tapped Reply'
2017-09-04 18:31:19 +00:00
ForceReply bool `json:"force_reply"`
2017-10-06 07:55:54 +00:00
// Use this parameter if you want to force reply from specific users
// only. Targets: 1) users that are @mentioned in the text of the Message
// object; 2) if the bot's message is a reply (has reply_to_message_id),
// sender of the original message.
Selective bool `json:"selective,omitempty"`
2017-09-04 18:31:19 +00:00
}
// ChatPhoto represents a chat photo.
ChatPhoto struct {
2017-10-06 07:55:54 +00:00
// Unique file identifier of small (160x160) chat photo. This file_id can
// be used only for photo download.
2017-09-04 18:31:19 +00:00
SmallFileID string `json:"small_file_id"`
2017-10-06 07:55:54 +00:00
// Unique file identifier of big (640x640) chat photo. This file_id can
// be used only for photo download.
2017-09-04 18:31:19 +00:00
BigFileID string `json:"big_file_id"`
}
// ChatMember contains information about one member of a chat.
ChatMember struct {
// Information about the user
User *User `json:"user"`
2017-10-06 07:55:54 +00:00
// The member's status in the chat. Can be "creator", "administrator",
// "member", "restricted", "left" or "kicked"
2017-09-04 18:31:19 +00:00
Status string `json:"status"`
2017-10-06 07:55:54 +00:00
// Restictred and kicked only. Date when restrictions will be lifted for
// this user, unix time
UntilDate int64 `json:"until_date,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the bot is allowed to edit administrator
// privileges of that user
CanBeEdited bool `json:"can_be_edited,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can change the chat
// title, photo and other settings
CanChangeInfo bool `json:"can_change_info,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can post in the
// channel, channels only
CanPostMessages bool `json:"can_post_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can edit messages of
// other users, channels only
CanEditMessages bool `json:"can_edit_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can delete messages of
// other users
CanDeleteMessages bool `json:"can_delete_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can invite new users
// to the chat
CanInviteUsers bool `json:"can_invite_users,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can restrict, ban or
// unban chat members
CanRestrictMembers bool `json:"can_restrict_members,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can pin messages,
// supergroups only
CanPinMessages bool `json:"can_pin_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Administrators only. True, if the administrator can add new
// administrators with a subset of his own privileges or demote
// administrators that he has promoted, directly or indirectly (promoted
// by administrators that were appointed by the user)
CanPromoteMembers bool `json:"can_promote_members,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Restricted only. True, if the user can send text messages, contacts,
// locations and venues
CanSendMessages bool `json:"can_send_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Restricted only. True, if the user can send audios, documents, photos,
// videos, video notes and voice notes, implies can_send_messages
CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Restricted only. True, if the user can send animations, games,
// stickers and use inline bots, implies can_send_media_messages
CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Restricted only. True, if user may add web page previews to his
// messages, implies can_send_media_messages
CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// ResponseParameters contains information about why a request was
// unsuccessful.
2017-09-04 18:31:19 +00:00
ResponseParameters struct {
2017-10-06 07:55:54 +00:00
// The group has been migrated to a supergroup with the specified
// identifier.
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// In case of exceeding flood control, the number of seconds left to wait
// before the request can be repeated
RetryAfter int `json:"retry_after,omitempty"`
2017-09-04 18:31:19 +00:00
}
// InputMedia represents the content of a media message to be sent. It should
// be one of
InputMedia interface {
NewInputMediaPhoto(media InputFile) *InputMediaPhoto
NewInputMediaVideo(media InputFile) *InputMediaVideo
}
// InputMediaPhoto represents a photo to be sent.
InputMediaPhoto struct {
// Type of the result, must be photo
Type string `json:"type"`
// File to send. Pass a file_id to send a file that exists on the
// Telegram servers (recommended), pass an HTTP URL for Telegram to get
// a file from the Internet, or pass "attach://<file_attach_name>" to
// upload a new one using multipart/form-data under <file_attach_name>
// name.
Media string `json:"media"`
// Caption of the photo to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
}
// InputMediaVideo represents a video to be sent.
InputMediaVideo struct {
// Type of the result, must be video
Type string `json:"type"`
// File to send. Pass a file_id to send a file that exists on the
// Telegram servers (recommended), pass an HTTP URL for Telegram to get
// a file from the Internet, or pass "attach://<file_attach_name>" to
// upload a new one using multipart/form-data under <file_attach_name>
// name.
Media string `json:"media"`
// Caption of the video to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
// Video width
Width int `json:"width,omitempty"`
// Video height
Height int `json:"height,omitempty"`
// Video duration
Duration int `json:"duration,omitempty"`
// Pass true, if the uploaded video is suitable for streaming
SupportsStreaming bool `json:"supports_streaming,omitempty"`
}
2017-10-06 07:55:54 +00:00
// InputFile represents the contents of a file to be uploaded. Must be posted
// using multipart/form-data in the usual way that files are uploaded via the
// browser.
2017-09-04 18:31:19 +00:00
InputFile interface{}
// Sticker represents a sticker.
Sticker struct {
// Unique identifier for this file
FileID string `json:"file_id"`
// Emoji associated with the sticker
Emoji string `json:"emoji,omitempty"`
// Name of the sticker set to which the sticker belongs
SetName string `json:"set_name,omitempty"`
2017-09-04 18:31:19 +00:00
// Sticker width
Width int `json:"width"`
// Sticker height
Height int `json:"height"`
// File size
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
// Sticker thumbnail in the .webp or .jpg format
2017-10-06 07:55:54 +00:00
Thumb *PhotoSize `json:"thumb,omitempty"`
2017-09-04 18:31:19 +00:00
// For mask stickers, the position where the mask should be placed
2017-10-06 07:55:54 +00:00
MaskPosition *MaskPosition `json:"mask_position,omitempty"`
2017-09-04 18:31:19 +00:00
}
// StickerSet represents a sticker set.
StickerSet struct {
// Sticker set name
Name string `json:"name"`
// Sticker set title
Title string `json:"title"`
// True, if the sticker set contains masks
ContainsMasks bool `json:"contains_masks"`
// List of all set stickers
2017-10-06 08:51:37 +00:00
Stickers []Sticker `json:"stickers"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// MaskPosition describes the position on faces where a mask should be placed
// by default.
2017-09-04 18:31:19 +00:00
MaskPosition struct {
2017-10-06 07:55:54 +00:00
// The part of the face relative to which the mask should be placed. One
// of "forehead", "eyes", "mouth", or "chin".
2017-09-04 18:31:19 +00:00
Point string `json:"point"`
2017-10-06 07:55:54 +00:00
// Shift by X-axis measured in widths of the mask scaled to the face
// size, from left to right. For example, choosing -1.0 will place mask
// just to the left of the default mask position.
2017-09-04 18:31:19 +00:00
XShift float32 `json:"x_shift"`
2017-10-06 07:55:54 +00:00
// Shift by Y-axis measured in heights of the mask scaled to the face
// size, from top to bottom. For example, 1.0 will place the mask just
// below the default mask position.
2017-09-04 18:31:19 +00:00
YShift float32 `json:"y_shift"`
// Mask scaling coefficient. For example, 2.0 means double size.
Scale float32 `json:"scale"`
}
2017-10-06 07:55:54 +00:00
// InlineQuery represents an incoming inline query. When the user sends an
// empty query, your bot could return some default or trending results.
2017-09-04 18:31:19 +00:00
InlineQuery struct {
// Unique identifier for this query
ID string `json:"id"`
// Text of the query (up to 512 characters)
Query string `json:"query"`
// Offset of the results to be returned, can be controlled by the bot
Offset string `json:"offset"`
// Sender
From *User `json:"from"`
// Sender location, only for bots that request user location
Location *Location `json:"location,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-09-05 09:20:10 +00:00
// InlineQueryResult represents one result of an inline query.
2017-10-17 11:11:43 +00:00
InlineQueryResult interface {
NewInlineQueryResultCachedAudio(resultID, fileID string) *InlineQueryResultCachedAudio
NewInlineQueryResultCachedDocument(resultID, fileID, title string) *InlineQueryResultCachedDocument
NewInlineQueryResultCachedGif(resultID, fileID string) *InlineQueryResultCachedGif
NewInlineQueryResultCachedMpeg4Gif(resultID, fileID string) *InlineQueryResultCachedMpeg4Gif
NewInlineQueryResultCachedPhoto(resultID, fileID string) *InlineQueryResultCachedPhoto
NewInlineQueryResultCachedSticker(resultID, fileID string) *InlineQueryResultCachedSticker
NewInlineQueryResultCachedVideo(resultID, fileID, title string) *InlineQueryResultCachedVideo
NewInlineQueryResultCachedVoice(resultID, fileID, title string) *InlineQueryResultCachedVoice
NewInlineQueryResultArticle(resultID, title, content *InputMessageContent) *InlineQueryResultArticle
NewInlineQueryResultAudio(resultID, audioURL, title string) *InlineQueryResultAudio
NewInlineQueryResultContact(resultID, phoneNumber, firstName string) *InlineQueryResultContact
NewInlineQueryResultGame(resultID, gameShortName string) *InlineQueryResultGame
NewInlineQueryResultDocument(resultID, title, documentURL, mimeType string) *InlineQueryResultDocument
NewInlineQueryResultGif(resultID, gifURL, thumbURL string) *InlineQueryResultGif
NewInlineQueryResultLocation(resultID, title string, latitude, longitude float32) *InlineQueryResultLocation
NewInlineQueryResultMpeg4Gif(resultID, mpeg4URL, thumbURL string) *InlineQueryResultMpeg4Gif
NewInlineQueryResultPhoto(resultID, photoURL, thumbURL string) *InlineQueryResultPhoto
NewInlineQueryResultVenue(resultID, title, address string, latitude, longitude float32) *InlineQueryResultVenue
NewInlineQueryResultVideo(resultID, videoURL, mimeType, thumbURL, title string) *InlineQueryResultVideo
NewInlineQueryResultVoice(resultID, voiceURL, title string) *InlineQueryResultVoice
}
2017-09-05 09:20:10 +00:00
2017-09-04 18:31:19 +00:00
// InlineQueryResultArticle represents a link to an article or web page.
InlineQueryResultArticle struct {
// Type of the result, must be article
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
//Title of the result
Title string `json:"title"`
// URL of the result
2017-10-06 07:55:54 +00:00
URL string `json:"url,omitempty"`
2017-09-04 18:31:19 +00:00
// Short description of the result
2017-10-06 07:55:54 +00:00
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// Url of the thumbnail for the result
2017-10-06 07:55:54 +00:00
ThumbURL string `json:"thumb_url,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent
InputMessageContent interface{} `json:"input_message_content"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Pass True, if you don't want the URL to be shown in the message
HideURL bool `json:"hide_url,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail width
2017-10-06 07:55:54 +00:00
ThumbWidth int `json:"thumb_width,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail height
2017-10-06 07:55:54 +00:00
ThumbHeight int `json:"thumb_height,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultPhoto represents a link to a photo. By default, this
// photo will be sent by the user with optional caption. Alternatively, you
// can use input_message_content to send a message with the specified content
// instead of the photo.
2017-09-04 18:31:19 +00:00
InlineQueryResultPhoto struct {
// Type of the result, must be photo
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
2017-10-06 07:55:54 +00:00
// A valid URL of the photo. Photo must be in jpeg format. Photo size
// must not exceed 5MB
2017-09-04 18:31:19 +00:00
PhotoURL string `json:"photo_url"`
// URL of the thumbnail for the photo
2017-10-05 14:08:09 +00:00
ThumbURL string `json:"thumb_url"`
2017-09-04 18:31:19 +00:00
// Title for the result
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Short description of the result
2017-10-06 07:55:54 +00:00
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the photo to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
// Width of the photo
PhotoWidth int `json:"photo_width,omitempty"`
// Height of the photo
PhotoHeight int `json:"photo_height,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the photo
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultGif represents a link to an animated GIF file. By
// default, this animated GIF file will be sent by the user with optional
// caption. Alternatively, you can use input_message_content to send a
// message with the specified content instead of the animation.
2017-09-04 18:31:19 +00:00
InlineQueryResultGif struct {
// Type of the result, must be gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the GIF file. File size must not exceed 1MB
GifURL string `json:"gif_url"`
// URL of the static thumbnail for the result (jpeg or gif)
ThumbURL string `json:"thumb_url"`
// Title for the result
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the GIF file to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
// Width of the GIF
GifWidth int `json:"gif_width,omitempty"`
// Height of the GIF
GifHeight int `json:"gif_height,omitempty"`
// Duration of the GIF
GifDuration int `json:"gif_duration,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the GIF animation
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultMpeg4Gif represents a link to a video animation
// (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4
// file will be sent by the user with optional caption. Alternatively, you
// can use input_message_content to send a message with the specified content
// instead of the animation.
2017-09-04 18:31:19 +00:00
InlineQueryResultMpeg4Gif struct {
// Type of the result, must be mpeg4_gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the MP4 file. File size must not exceed 1MB
Mpeg4URL string `json:"mpeg4_url"`
// URL of the static thumbnail (jpeg or gif) for the result
ThumbURL string `json:"thumb_url"`
// Title for the result
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the MPEG-4 file to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Video width
Mpeg4Width int `json:"mpeg4_width,omitempty"`
// Video height
Mpeg4Height int `json:"mpeg4_height,omitempty"`
// Video duration
Mpeg4Duration int `json:"mpeg4_duration,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the video animation
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultVideo represents a link to a page containing an embedded
// video player or a video file. By default, this video file will be sent by
// the user with an optional caption. Alternatively, you can use
// input_message_content to send a message with the specified content
// instead of the video.
2017-09-04 18:31:19 +00:00
//
2017-10-06 07:55:54 +00:00
// If an InlineQueryResultVideo message contains an embedded video (e.g.,
// YouTube), you must replace its content using input_message_content.
2017-09-04 18:31:19 +00:00
InlineQueryResultVideo struct {
// Type of the result, must be video
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the embedded video player or video file
VideoURL string `json:"video_url"`
2017-10-06 07:55:54 +00:00
// Mime type of the content of video url, "text/html" or "video/mp4"
2017-09-04 18:31:19 +00:00
MimeType string `json:"mime_type"`
// URL of the thumbnail (jpeg only) for the video
ThumbURL string `json:"thumb_url"`
// Title for the result
Title string `json:"title"`
// Caption of the video to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
// Short description of the result
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// Video width
2017-10-06 07:55:54 +00:00
VideoWidth int `json:"video_width,omitempty"`
2017-09-04 18:31:19 +00:00
// Video height
2017-10-06 07:55:54 +00:00
VideoHeight int `json:"video_height,omitempty"`
2017-09-04 18:31:19 +00:00
// Video duration in seconds
2017-10-06 07:55:54 +00:00
VideoDuration int `json:"video_duration,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Content of the message to be sent instead of the video. This field is
// required if InlineQueryResultVideo is used to send an HTML-page as a
// result (e.g., a YouTube video).
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultAudio represents a link to an mp3 audio file. By default,
// this audio file will be sent by the user. Alternatively, you can use
// input_message_content to send a message with the specified content
// instead of the audio.
2017-09-04 18:31:19 +00:00
InlineQueryResultAudio struct {
// Type of the result, must be audio
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the audio file
AudioURL string `json:"audio_url"`
// Title
Title string `json:"title"`
// Caption, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Performer
2017-10-06 07:55:54 +00:00
Performer string `json:"performer,omitempty"`
2017-09-04 18:31:19 +00:00
// Audio duration in seconds
2017-10-06 07:55:54 +00:00
AudioDuration int `json:"audio_duration,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the audio
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultVoice represents a link to a voice recording in an .ogg
// container encoded with OPUS. By default, this voice recording will be
// sent by the user. Alternatively, you can use input_message_content to
// send a message with the specified content instead of the the voice message.
2017-09-04 18:31:19 +00:00
InlineQueryResultVoice struct {
// Type of the result, must be voice
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the voice recording
VoiceURL string `json:"voice_url"`
// Recording title
Title string `json:"title"`
// Caption, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Recording duration in seconds
2017-10-06 07:55:54 +00:00
VoiceDuration int `json:"voice_duration,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the voice recording
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultDocument represents a link to a file. By default, this
// file will be sent by the user with an optional caption. Alternatively,
// you can use input_message_content to send a message with the specified
// content instead of the file. Currently, only .PDF and .ZIP files can be
// sent using this method.
2017-09-04 18:31:19 +00:00
InlineQueryResultDocument struct {
// Type of the result, must be document
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// Title for the result
Title string `json:"title"`
// Caption of the document to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// A valid URL for the file
DocumentURL string `json:"document_url"`
2017-10-06 07:55:54 +00:00
// Mime type of the content of the file, either "application/pdf" or
// "application/zip"
2017-09-04 18:31:19 +00:00
MimeType string `json:"mime_type"`
// Short description of the result
2017-10-06 07:55:54 +00:00
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// URL of the thumbnail (jpeg only) for the file
ThumbURL string `json:"thumb_url,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the file
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail width
2017-10-06 07:55:54 +00:00
ThumbWidth int `json:"thumb_width,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail height
2017-10-06 07:55:54 +00:00
ThumbHeight int `json:"thumb_height,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultLocation represents a location on a map. By default, the
// location will be sent by the user. Alternatively, you can use
// input_message_content to send a message with the specified content
// instead of the location.
2017-09-04 18:31:19 +00:00
InlineQueryResultLocation struct {
// Type of the result, must be location
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
// Location title
Title string `json:"title"`
//Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
2017-09-04 18:31:19 +00:00
// Location latitude in degrees
Latitude float32 `json:"latitude"`
// Location longitude in degrees
Longitude float32 `json:"longitude"`
//Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
//Content of the message to be sent instead of the location
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
//Thumbnail width
2017-10-06 07:55:54 +00:00
ThumbWidth int `json:"thumb_width,omitempty"`
2017-09-04 18:31:19 +00:00
//Thumbnail height
2017-10-06 07:55:54 +00:00
ThumbHeight int `json:"thumb_height,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultVenue represents a venue. By default, the venue will be
// sent by the user. Alternatively, you can use input_message_content to
// send a message with the specified content instead of the venue.
2017-09-04 18:31:19 +00:00
InlineQueryResultVenue struct {
// Type of the result, must be venue
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
// Title of the venue
Title string `json:"title"`
// Address of the venue
Address string `json:"address"`
// Foursquare identifier of the venue if known
2017-10-06 07:55:54 +00:00
FoursquareID string `json:"foursquare_id,omitempty"`
2017-09-04 18:31:19 +00:00
// Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
// Latitude of the venue location in degrees
Latitude float32 `json:"latitude"`
// Longitude of the venue location in degrees
Longitude float32 `json:"longitude"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the venue
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail width
2017-10-06 07:55:54 +00:00
ThumbWidth int `json:"thumb_width,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail height
2017-10-06 07:55:54 +00:00
ThumbHeight int `json:"thumb_height,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultContact represents a contact with a phone number. By
// default, this contact will be sent by the user. Alternatively, you can
// use input_message_content to send a message with the specified content
// instead of the contact.
2017-09-04 18:31:19 +00:00
InlineQueryResultContact struct {
// Type of the result, must be contact
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
// Contact's phone number
PhoneNumber string `json:"phone_number"`
// Contact's first name
FirstName string `json:"first_name"`
// Contact's last name
2017-10-06 07:55:54 +00:00
LastName string `json:"last_name,omitempty"`
2017-09-04 18:31:19 +00:00
// Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the contact
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail width
2017-10-06 07:55:54 +00:00
ThumbWidth int `json:"thumb_width,omitempty"`
2017-09-04 18:31:19 +00:00
// Thumbnail height
2017-10-06 07:55:54 +00:00
ThumbHeight int `json:"thumb_height,omitempty"`
2017-09-04 18:31:19 +00:00
}
// InlineQueryResultGame represents a Game.
InlineQueryResultGame struct {
// Type of the result, must be game
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// Short name of the game
GameShortName string `json:"game_short_name"`
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedPhoto represents a link to a photo stored on the
// Telegram servers. By default, this photo will be sent by the user with an
// optional caption. Alternatively, you can use input_message_content to
// send a message with the specified content instead of the photo.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedPhoto struct {
// Type of the result, must be photo
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier of the photo
PhotoFileID string `json:"photo_file_id"`
// Title for the result
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Short description of the result
2017-10-06 07:55:54 +00:00
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the photo to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the photo
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedGif represents a link to an animated GIF file
// stored on the Telegram servers. By default, this animated GIF file will
// be sent by the user with an optional caption. Alternatively, you can use
// input_message_content to send a message with specified content instead of
// the animation.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedGif struct {
// Type of the result, must be gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the GIF file
GifFileID string `json:"gif_file_id"`
// Title for the result
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the GIF file to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the GIF animation
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedMpeg4Gif represents a link to a video animation
// (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By
// default, this animated MPEG-4 file will be sent by the user with an
// optional caption. Alternatively, you can use input_message_content to
// send a message with the specified content instead of the animation.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedMpeg4Gif struct {
// Type of the result, must be mpeg4_gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the MP4 file
Mpeg4FileID string `json:"mpeg4_file_id"`
// Title for the result
2017-10-06 07:55:54 +00:00
Title string `json:"title,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the MPEG-4 file to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the video animation
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedSticker represents a link to a sticker stored on
// the Telegram servers. By default, this sticker will be sent by the user.
// Alternatively, you can use input_message_content to send a message with
// the specified content instead of the sticker.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedSticker struct {
// Type of the result, must be sticker
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier of the sticker
StickerFileID string `json:"sticker_file_id"`
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the sticker
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedDocument represents a link to a file stored on the
// Telegram servers. By default, this file will be sent by the user with an
// optional caption. Alternatively, you can use input_message_content to
// send a message with the specified content instead of the file.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedDocument struct {
// Type of the result, must be document
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// Title for the result
Title string `json:"title"`
// A valid file identifier for the file
DocumentFileID string `json:"document_file_id"`
// Short description of the result
2017-10-06 07:55:54 +00:00
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the document to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the file
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedVideo represents a link to a video file stored on
// the Telegram servers. By default, this video file will be sent by the
// user with an optional caption. Alternatively, you can use
// input_message_content to send a message with the specified content
// instead of the video.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedVideo struct {
// Type of the result, must be video
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the video file
VideoFileID string `json:"video_file_id"`
// Title for the result
Title string `json:"title"`
// Short description of the result
2017-10-06 07:55:54 +00:00
Description string `json:"description,omitempty"`
2017-09-04 18:31:19 +00:00
// Caption of the video to be sent, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the video
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedVoice represents a link to a voice message stored
// on the Telegram servers. By default, this voice message will be sent by
// the user. Alternatively, you can use input_message_content to send a
// message with the specified content instead of the voice message.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedVoice struct {
// Type of the result, must be voice
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the voice message
VoiceFileID string `json:"voice_file_id"`
// Voice message title
Title string `json:"title"`
// Caption, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the voice message
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InlineQueryResultCachedAudio represents a link to an mp3 audio file
// stored on the Telegram servers. By default, this audio file will be sent
// by the user. Alternatively, you can use input_message_content to send a
// message with the specified content instead of the audio.
2017-09-04 18:31:19 +00:00
InlineQueryResultCachedAudio struct {
// Type of the result, must be audio
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the audio file
AudioFileID string `json:"audio_file_id"`
// Caption, 0-200 characters
2017-10-06 07:55:54 +00:00
Caption string `json:"caption,omitempty"`
2017-09-04 18:31:19 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in the media caption.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Inline keyboard attached to the message
2017-10-06 07:55:54 +00:00
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2017-09-04 18:31:19 +00:00
// Content of the message to be sent instead of the audio
2017-10-26 00:24:25 +00:00
InputMessageContent interface{} `json:"input_message_content,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-25 08:21:36 +00:00
// InputMessageContent represents the content of a message to be sent as a
// result of an inline query.
2017-10-17 11:11:43 +00:00
InputMessageContent interface {
NewInputTextMessageContent(messageText string) *InputTextMessageContent
NewInputLocationMessageContent(latitude, longitude float32) *InputLocationMessageContent
NewInputVenueMessageContent(latitude, longitude float32, title, address string) *InputVenueMessageContent
NewInputContactMessageContent(phoneNumber, firstName string) *InputContactMessageContent
}
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// InputTextMessageContent represents the content of a text message to be
// sent as the result of an inline query.
2017-09-04 18:31:19 +00:00
InputTextMessageContent struct {
// Text of the message to be sent, 1-4096 characters
MessageText string `json:"message_text"`
2017-10-06 07:55:54 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic,
// fixed-width text or inline URLs in your bot's message.
ParseMode string `json:"parse_mode,omitempty"`
2017-09-04 18:31:19 +00:00
// Disables link previews for links in the sent message
2017-10-06 07:55:54 +00:00
DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InputLocationMessageContent represents the content of a location message
// to be sent as the result of an inline query.
2017-09-04 18:31:19 +00:00
InputLocationMessageContent struct {
// Latitude of the location in degrees
Latitude float32 `json:"latitude"`
// Longitude of the location in degrees
Longitude float32 `json:"longitude"`
}
2017-10-06 07:55:54 +00:00
// InputVenueMessageContent represents the content of a venue message to be
// sent as the result of an inline query.
2017-09-04 18:31:19 +00:00
InputVenueMessageContent struct {
// Latitude of the venue in degrees
Latitude float32 `json:"latitude"`
// Longitude of the venue in degrees
Longitude float32 `json:"longitude"`
// Name of the venue
Title string `json:"title"`
// Address of the venue
Address string `json:"address"`
// Foursquare identifier of the venue, if known
2017-10-06 07:55:54 +00:00
FoursquareID string `json:"foursquare_id,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// InputContactMessageContent represents the content of a contact message to
// be sent as the result of an inline query.
2017-09-04 18:31:19 +00:00
InputContactMessageContent struct {
// Contact's phone number
PhoneNumber string `json:"phone_number"`
// Contact's first name
FirstName string `json:"first_name"`
// Contact's last name
2017-10-06 07:55:54 +00:00
LastName string `json:"last_name,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// ChosenInlineResult represents a result of an inline query that was chosen
// by the user and sent to their chat partner.
2017-09-04 18:31:19 +00:00
ChosenInlineResult struct {
// The unique identifier for the result that was chosen
ResultID string `json:"result_id"`
2017-10-06 07:55:54 +00:00
// Identifier of the sent inline message. Available only if there is an
// inline keyboard attached to the message. Will be also received in
// callback queries and can be used to edit the message.
InlineMessageID string `json:"inline_message_id,omitempty"`
2017-09-04 18:31:19 +00:00
// The query that was used to obtain the result
Query string `json:"query"`
// The user that chose the result
From *User `json:"from"`
// Sender location, only for bots that require user location
Location *Location `json:"location,omitempty"`
2017-09-04 18:31:19 +00:00
}
// LabeledPrice represents a portion of the price for goods or services.
LabeledPrice struct {
// Portion label
Label string `json:"label"`
2017-10-06 07:55:54 +00:00
// Price of the product in the smallest units of the currency (integer,
// not float/double). For example, for a price of US$ 1.45 pass amount =
// 145. See the exp parameter in currencies.json, it shows the number of
// digits past the decimal point for each currency (2 for the majority
// of currencies).
2017-09-04 18:31:19 +00:00
Amount int `json:"amount"`
}
// Invoice contains basic information about an invoice.
Invoice struct {
// Product name
Title string `json:"title"`
// Product description
Description string `json:"description"`
2017-10-06 07:55:54 +00:00
// Unique bot deep-linking parameter that can be used to generate this
// invoice
2017-09-04 18:31:19 +00:00
StartParameter string `json:"start_parameter"`
// Three-letter ISO 4217 currency code
Currency string `json:"currency"`
2017-10-06 07:55:54 +00:00
// Total price in the smallest units of the currency (integer, not
// float/double). For example, for a price of US$ 1.45 pass amount = 145.
// See the exp parameter in currencies.json, it shows the number of
// digits past the decimal point for each currency (2 for the majority
// of currencies).
2017-09-04 18:31:19 +00:00
TotalAmount int `json:"total_amount"`
}
// ShippingAddress represents a shipping address.
ShippingAddress struct {
// ISO 3166-1 alpha-2 country code
CountryCode string `json:"country_code"`
// State, if applicable
State string `json:"state"`
// City
City string `json:"city"`
// First line for the address
StreetLine1 string `json:"street_line1"`
// Second line for the address
StreetLine2 string `json:"street_line2"`
// Address post code
PostCode string `json:"post_code"`
}
// OrderInfo represents information about an order.
OrderInfo struct {
// User name
2017-10-06 07:55:54 +00:00
Name string `json:"name,omitempty"`
2017-09-04 18:31:19 +00:00
// User's phone number
2017-10-06 07:55:54 +00:00
PhoneNumber string `json:"phone_number,omitempty"`
2017-09-04 18:31:19 +00:00
// User email
2017-10-06 07:55:54 +00:00
Email string `json:"email,omitempty"`
2017-09-04 18:31:19 +00:00
// User shipping address
2017-10-06 07:55:54 +00:00
ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"`
2017-09-04 18:31:19 +00:00
}
// ShippingOption represents one shipping option.
ShippingOption struct {
// Shipping option identifier
ID string `json:"id"`
// Option title
Title string `json:"title"`
// List of price portions
2017-10-06 08:51:37 +00:00
Prices []LabeledPrice `json:"prices"`
2017-09-04 18:31:19 +00:00
}
// SuccessfulPayment contains basic information about a successful payment.
SuccessfulPayment struct {
// Three-letter ISO 4217 currency code
Currency string `json:"currency"`
// Bot specified invoice payload
InvoicePayload string `json:"invoice_payload"`
// Identifier of the shipping option chosen by the user
2017-10-06 07:55:54 +00:00
ShippingOptionID string `json:"shipping_option_id,omitempty"`
2017-09-04 18:31:19 +00:00
// Telegram payment identifier
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
// Provider payment identifier
ProviderPaymentChargeID string `json:"provider_payment_charge_id"`
// Total price in the smallest units of the currency (integer, not
// float/double). For example, for a price of US$ 1.45 pass amount = 145.
// See the exp parameter in currencies.json, it shows the number of
// digits past the decimal point for each currency (2 for the majority
// of currencies).
TotalAmount int `json:"total_amount"`
// Order info provided by the user
OrderInfo *OrderInfo `json:"order_info,omitempty"`
2017-09-04 18:31:19 +00:00
}
// ShippingQuery contains information about an incoming shipping query.
ShippingQuery struct {
// Unique query identifier
ID string `json:"id"`
// Bot specified invoice payload
InvoicePayload string `json:"invoice_payload"`
// User who sent the query
From *User `json:"from"`
2017-09-04 18:31:19 +00:00
// User specified shipping address
ShippingAddress *ShippingAddress `json:"shipping_address"`
}
// PreCheckoutQuery contains information about an incoming pre-checkout query.
PreCheckoutQuery struct {
// Unique query identifier
ID string `json:"id"`
// Three-letter ISO 4217 currency code
Currency string `json:"currency"`
// Bot specified invoice payload
InvoicePayload string `json:"invoice_payload"`
// Identifier of the shipping option chosen by the user
ShippingOptionID string `json:"shipping_option_id,omitempty"`
// User who sent the query
From *User `json:"from"`
2017-10-06 07:55:54 +00:00
// Total price in the smallest units of the currency (integer, not
// float/double). For example, for a price of US$ 1.45 pass amount = 145.
// See the exp parameter in currencies.json, it shows the number of
// digits past the decimal point for each currency (2 for the majority of
// currencies).
2017-09-04 18:31:19 +00:00
TotalAmount int `json:"total_amount"`
// Order info provided by the user
2017-10-06 07:55:54 +00:00
OrderInfo *OrderInfo `json:"order_info,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// Game represents a game. Use BotFather to create and edit games, their
// short names will act as unique identifiers.
2017-09-04 18:31:19 +00:00
Game struct {
// Title of the game
Title string `json:"title"`
// Description of the game
Description string `json:"description"`
2017-10-06 07:55:54 +00:00
// Brief description of the game or high scores included in the game
// message. Can be automatically edited to include current high scores
// for the game when the bot calls setGameScore, or manually edited
// using editMessageText. 0-4096 characters.
Text string `json:"text,omitempty"`
2017-09-04 18:31:19 +00:00
// Photo that will be displayed in the game message in chats.
Photo []PhotoSize `json:"photo"`
2017-10-06 07:55:54 +00:00
// Special entities that appear in text, such as usernames, URLs, bot
// commands, etc.
2017-10-06 08:51:37 +00:00
TextEntities []MessageEntity `json:"text_entities,omitempty"`
2017-09-04 18:31:19 +00:00
2017-10-06 07:55:54 +00:00
// Animation that will be displayed in the game message in chats. Upload
// via BotFather
Animation *Animation `json:"animation,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// Animation provide an animation for your game so that it looks stylish in
// chats (check out Lumberjack for an example). This object represents an
// animation file to be displayed in the message containing a game.
2017-09-04 18:31:19 +00:00
Animation struct {
// Unique file identifier
FileID string `json:"file_id"`
// Original animation filename as defined by sender
2017-10-06 07:55:54 +00:00
FileName string `json:"file_name,omitempty"`
2017-09-04 18:31:19 +00:00
// MIME type of the file as defined by sender
2017-10-06 07:55:54 +00:00
MimeType string `json:"mime_type,omitempty"`
2017-09-04 18:31:19 +00:00
// Animation thumbnail as defined by sender
Thumb *PhotoSize `json:"thumb,omitempty"`
2017-09-04 18:31:19 +00:00
// File size
2017-10-06 07:55:54 +00:00
FileSize int `json:"file_size,omitempty"`
2017-09-04 18:31:19 +00:00
}
2017-10-06 07:55:54 +00:00
// CallbackGame a placeholder, currently holds no information. Use BotFather
// to set up your game.
2017-09-04 18:31:19 +00:00
CallbackGame struct{}
// GameHighScore represents one row of the high scores table for a game.
GameHighScore struct {
// Position in high score table for the game
Position int `json:"position"`
// Score
Score int `json:"score"`
// User
User *User `json:"user"`
2017-09-04 18:31:19 +00:00
}
2017-10-17 11:11:43 +00:00
// ReplyMarkup is a JSON-serialized object for an inline keyboard, custom
// reply keyboard, instructions to remove reply keyboard or to force a reply
// from the user.
ReplyMarkup interface {
NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) *InlineKeyboardMarkup
NewReplyKeyboardMarkup(rows ...[]KeyboardButton) *ReplyKeyboardMarkup
NewReplyKeyboardRemove(selective bool) *ReplyKeyboardRemove
NewForceReply(selective bool) *ForceReply
}
)