// 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.
Responsestruct{
Okbool`json:"ok"`
ErrorCodestring`json:"error_code"`
Descriptionstring`json:"description"`
Result*json.RawMessage`json:"result"`
Parameters*ResponseParameters`json:"parameters"`
}
// Update represents an incoming update.
//
// At most one of the optional parameters can be present in any given update.
Updatestruct{
// The update‘s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order.
IDint`json:"update_id"`
// New incoming message of any kind — text, photo, sticker, etc.
// 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.
// Service message: the supergroup has been created. This field can‘t be received in a message coming through updates, because bot can’t 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.
// Service message: the channel has been created. This field can‘t be received in a message coming through updates, because bot can’t 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.
// 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.
// MessageEntity represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
MessageEntitystruct{
// 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)
Typestring`json:"type"`
// Offset in UTF-16 code units to the start of the entity
Offsetint`json:"offset"`
// Length of the entity in UTF-16 code units
Lengthint`json:"length"`
// For “text_link” only, url that will be opened after user taps on the text
// UserProfilePhotos represent a user's profile pictures.
UserProfilePhotosstruct{
// Total number of profile pictures the target user has
TotalCountint`json:"total_count"`
// Requested profile pictures (in up to 4 sizes each)
Photos[]*[]PhotoSize`json:"photos"`
}
// 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.
// 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.
// 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.
// 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.
//
// Example: A user requests to change the bot‘s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.
// 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.
KeyboardButtonstruct{
// 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
Textstring`json:"text"`
// If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
// 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).
ReplyKeyboardRemovestruct{
// 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)
SemoveKeyboardbool`json:"remove_keyboard"`
// 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.
//
// 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.
// If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.
//
// 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.
// If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.
//
// 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.
// 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.
//
// 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).
CallbackQuerystruct{
// Unique identifier for this query
IDstring`json:"id"`
// 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
// ForceReply display a reply interface to the user (act as if the user has selected the bot‘s 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.
ForceReplystruct{
// Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'
ForceReplybool`json:"force_reply"`
// 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.
// 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)
// 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.
// MaskPosition describes the position on faces where a mask should be placed by default.
MaskPositionstruct{
// The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
Pointstring`json:"point"`
// 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.
XShiftfloat32`json:"x_shift"`
// 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.
YShiftfloat32`json:"y_shift"`
// Mask scaling coefficient. For example, 2.0 means double size.
Scalefloat32`json:"scale"`
}
// InlineQuery represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
InlineQuerystruct{
// Unique identifier for this query
IDstring`json:"id"`
// Sender
From*User`json:"from"`
// Sender location, only for bots that request user location
// 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.
InlineQueryResultPhotostruct{
// Type of the result, must be photo
Typestring`json:"type"`
// Unique identifier for this result, 1-64 bytes
IDstring`json:"id"`
// A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
// 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.
InlineQueryResultGifstruct{
// Type of the result, must be gif
Typestring`json:"type"`
// Unique identifier for this result, 1-64 bytes
IDstring`json:"id"`
// A valid URL for the GIF file. File size must not exceed 1MB
// 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.
InlineQueryResultMpeg4Gifstruct{
// Type of the result, must be mpeg4_gif
Typestring`json:"type"`
// Unique identifier for this result, 1-64 bytes
IDstring`json:"id"`
// A valid URL for the MP4 file. File size must not exceed 1MB
// 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.
//
// If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.
InlineQueryResultVideostruct{
// Type of the result, must be video
Typestring`json:"type"`
// Unique identifier for this result, 1-64 bytes
IDstring`json:"id"`
// A valid URL for the embedded video player or video file
VideoURLstring`json:"video_url"`
// Mime type of the content of video url, “text/html” or “video/mp4”
MimeTypestring`json:"mime_type"`
// URL of the thumbnail (jpeg only) for the video
ThumbURLstring`json:"thumb_url"`
// Title for the result
Titlestring`json:"title"`
// Caption of the video to be sent, 0-200 characters
// 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).
// 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.
// 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.
// 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.
InlineQueryResultDocumentstruct{
// Type of the result, must be document
Typestring`json:"type"`
// Unique identifier for this result, 1-64 bytes
IDstring`json:"id"`
// Title for the result
Titlestring`json:"title"`
// Caption of the document to be sent, 0-200 characters
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// 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.
// LabeledPrice represents a portion of the price for goods or services.
LabeledPricestruct{
// Portion label
Labelstring`json:"label"`
// 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).
Amountint`json:"amount"`
}
// Invoice contains basic information about an invoice.
Invoicestruct{
// Product name
Titlestring`json:"title"`
// Product description
Descriptionstring`json:"description"`
// Unique bot deep-linking parameter that can be used to generate this invoice
StartParameterstring`json:"start_parameter"`
// Three-letter ISO 4217 currency code
Currencystring`json:"currency"`
// 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).
TotalAmountint`json:"total_amount"`
}
// ShippingAddress represents a shipping address.
ShippingAddressstruct{
// ISO 3166-1 alpha-2 country code
CountryCodestring`json:"country_code"`
// State, if applicable
Statestring`json:"state"`
// City
Citystring`json:"city"`
// First line for the address
StreetLine1string`json:"street_line1"`
// Second line for the address
StreetLine2string`json:"street_line2"`
// Address post code
PostCodestring`json:"post_code"`
}
// OrderInfo represents information about an order.
// SuccessfulPayment contains basic information about a successful payment.
SuccessfulPaymentstruct{
// Three-letter ISO 4217 currency code
Currencystring`json:"currency"`
// 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).
TotalAmountint`json:"total_amount"`
// Bot specified invoice payload
InvoicePayloadstring`json:"invoice_payload"`
// Identifier of the shipping option chosen by the user
// PreCheckoutQuery contains information about an incoming pre-checkout query.
PreCheckoutQuerystruct{
// Unique query identifier
IDstring`json:"id"`
// User who sent the query
From*User`json:"from"`
// Three-letter ISO 4217 currency code
Currencystring`json:"currency"`
// 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).
TotalAmountint`json:"total_amount"`
// Bot specified invoice payload
InvoicePayloadstring`json:"invoice_payload"`
// Identifier of the shipping option chosen by the user
// Game represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
Gamestruct{
// Title of the game
Titlestring`json:"title"`
// Description of the game
Descriptionstring`json:"description"`
// Photo that will be displayed in the game message in chats.
Photo*[]PhotoSize`json:"photo"`
// 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.
// 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.