Documentation ¶
Index ¶
- type AddStickerToSetParams
- type Animation
- type AnswerCallbackQueryParams
- type AnswerInlineQueryParams
- type AnswerPreCheckoutQueryParams
- type AnswerShippingQueryParams
- type Audio
- type CallbackGame
- type CallbackQuery
- type Chat
- type ChatMember
- type ChatPermissions
- type ChatPhoto
- type ChosenInlineResult
- type Client
- func (c *Client) AddStickerToSet(params *AddStickerToSetParams) (bool, error)
- func (c *Client) AnswerCallbackQuery(params *AnswerCallbackQueryParams) (bool, error)
- func (c *Client) AnswerInlineQuery(params *AnswerInlineQueryParams) (bool, error)
- func (c *Client) AnswerPreCheckoutQuery(params *AnswerPreCheckoutQueryParams) (bool, error)
- func (c *Client) AnswerShippingQuery(params *AnswerShippingQueryParams) (bool, error)
- func (c *Client) CreateNewStickerSet(params *CreateNewStickerSetParams) (bool, error)
- func (c *Client) DeleteChatPhoto(params *DeleteChatPhotoParams) (bool, error)
- func (c *Client) DeleteChatStickerSet(params *DeleteChatStickerSetParams) (bool, error)
- func (c *Client) DeleteMessage(params *DeleteMessageParams) (bool, error)
- func (c *Client) DeleteStickerFromSet(params *DeleteStickerFromSetParams) (bool, error)
- func (c *Client) DeleteWebhook() (bool, error)
- func (c *Client) EditMessageCaption(params *EditMessageCaptionParams) (Message, error)
- func (c *Client) EditMessageLiveLocation(params *EditMessageLiveLocationParams) (Message, error)
- func (c *Client) EditMessageMedia(params *EditMessageMediaParams) (Message, error)
- func (c *Client) EditMessageReplyMarkup(params *EditMessageReplyMarkupParams) (Message, error)
- func (c *Client) EditMessageText(params *EditMessageTextParams) (Message, error)
- func (c *Client) ExportChatInviteLink(params *ExportChatInviteLinkParams) (string, error)
- func (c *Client) ForwardMessage(params *ForwardMessageParams) (Message, error)
- func (c *Client) GetChat(params *GetChatParams) (Chat, error)
- func (c *Client) GetChatAdministrators(params *GetChatAdministratorsParams) ([]ChatMember, error)
- func (c *Client) GetChatMember(params *GetChatMemberParams) (ChatMember, error)
- func (c *Client) GetChatMembersCount(params *GetChatMembersCountParams) (int, error)
- func (c *Client) GetFile(params *GetFileParams) (File, error)
- func (c *Client) GetGameHighScores(params *GetGameHighScoresParams) ([]GameHighScore, error)
- func (c *Client) GetMe() (User, error)
- func (c *Client) GetStickerSet(params *GetStickerSetParams) (StickerSet, error)
- func (c *Client) GetUpdates(params *GetUpdatesParams) ([]Update, error)
- func (c *Client) GetUserProfilePhotos(params *GetUserProfilePhotosParams) (UserProfilePhotos, error)
- func (c *Client) GetWebhookInfo() (WebhookInfo, error)
- func (c *Client) KickChatMember(params *KickChatMemberParams) (bool, error)
- func (c *Client) LeaveChat(params *LeaveChatParams) (bool, error)
- func (c *Client) PinChatMessage(params *PinChatMessageParams) (bool, error)
- func (c *Client) PromoteChatMember(params *PromoteChatMemberParams) (bool, error)
- func (c *Client) RestrictChatMember(params *RestrictChatMemberParams) (bool, error)
- func (c *Client) SendAnimation(params *SendAnimationParams) (Message, error)
- func (c *Client) SendAudio(params *SendAudioParams) (Message, error)
- func (c *Client) SendChatAction(params *SendChatActionParams) (bool, error)
- func (c *Client) SendContact(params *SendContactParams) (Message, error)
- func (c *Client) SendDocument(params *SendDocumentParams) (Message, error)
- func (c *Client) SendGame(params *SendGameParams) (Message, error)
- func (c *Client) SendInvoice(params *SendInvoiceParams) (Message, error)
- func (c *Client) SendLocation(params *SendLocationParams) (Message, error)
- func (c *Client) SendMediaGroup(params *SendMediaGroupParams) ([]Message, error)
- func (c *Client) SendMessage(params *SendMessageParams) (Message, error)
- func (c *Client) SendPhoto(params *SendPhotoParams) (Message, error)
- func (c *Client) SendPoll(params *SendPollParams) (Message, error)
- func (c *Client) SendSticker(params *SendStickerParams) (Message, error)
- func (c *Client) SendVenue(params *SendVenueParams) (Message, error)
- func (c *Client) SendVideo(params *SendVideoParams) (Message, error)
- func (c *Client) SendVideoNote(params *SendVideoNoteParams) (Message, error)
- func (c *Client) SendVoice(params *SendVoiceParams) (Message, error)
- func (c *Client) SetChatDescription(params *SetChatDescriptionParams) (bool, error)
- func (c *Client) SetChatPermissions(params *SetChatPermissionsParams) (bool, error)
- func (c *Client) SetChatPhoto(params *SetChatPhotoParams) (bool, error)
- func (c *Client) SetChatStickerSet(params *SetChatStickerSetParams) (bool, error)
- func (c *Client) SetChatTitle(params *SetChatTitleParams) (bool, error)
- func (c *Client) SetGameScore(params *SetGameScoreParams) (interface{}, error)
- func (c *Client) SetPassportDataErrors(params *SetPassportDataErrorsParams) (bool, error)
- func (c *Client) SetStickerPositionInSet(params *SetStickerPositionInSetParams) (bool, error)
- func (c *Client) SetWebhook(params *SetWebhookParams) (bool, error)
- func (c *Client) StopMessageLiveLocation(params *StopMessageLiveLocationParams) (Message, error)
- func (c *Client) StopPoll(params *StopPollParams) (Poll, error)
- func (c *Client) UnbanChatMember(params *UnbanChatMemberParams) (bool, error)
- func (c *Client) UnpinChatMessage(params *UnpinChatMessageParams) (bool, error)
- func (c *Client) UploadStickerFile(params *UploadStickerFileParams) (File, error)
- type Contact
- type CreateNewStickerSetParams
- type DeleteChatPhotoParams
- type DeleteChatStickerSetParams
- type DeleteMessageParams
- type DeleteStickerFromSetParams
- type Document
- type EditMessageCaptionParams
- type EditMessageLiveLocationParams
- type EditMessageMediaParams
- type EditMessageReplyMarkupParams
- type EditMessageTextParams
- type EncryptedCredentials
- type EncryptedPassportElement
- type ExportChatInviteLinkParams
- type File
- type ForceReply
- type ForwardMessageParams
- type Game
- type GameHighScore
- type GetChatAdministratorsParams
- type GetChatMemberParams
- type GetChatMembersCountParams
- type GetChatParams
- type GetFileParams
- type GetGameHighScoresParams
- type GetStickerSetParams
- type GetUpdatesParams
- type GetUserProfilePhotosParams
- type InlineKeyboardButton
- type InlineKeyboardMarkup
- type InlineQuery
- type InlineQueryResult
- type InlineQueryResultArticle
- type InlineQueryResultAudio
- type InlineQueryResultCachedAudio
- type InlineQueryResultCachedDocument
- type InlineQueryResultCachedGif
- type InlineQueryResultCachedMpeg4Gif
- type InlineQueryResultCachedPhoto
- type InlineQueryResultCachedSticker
- type InlineQueryResultCachedVideo
- type InlineQueryResultCachedVoice
- type InlineQueryResultContact
- type InlineQueryResultDocument
- type InlineQueryResultGame
- type InlineQueryResultGif
- type InlineQueryResultLocation
- type InlineQueryResultMpeg4Gif
- type InlineQueryResultPhoto
- type InlineQueryResultVenue
- type InlineQueryResultVideo
- type InlineQueryResultVoice
- type InputContactMessageContent
- type InputLocationMessageContent
- type InputMediaAnimation
- type InputMediaAudio
- type InputMediaDocument
- type InputMediaPhoto
- type InputMediaVideo
- type InputMessageContent
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type KeyboardButton
- type KickChatMemberParams
- type LabeledPrice
- type LeaveChatParams
- type Location
- type LoginURL
- type MaskPosition
- type Message
- type MessageEntity
- type OrderInfo
- type PassportData
- type PassportElementError
- type PassportElementErrorDataField
- type PassportElementErrorFile
- type PassportElementErrorFiles
- type PassportElementErrorFrontSide
- type PassportElementErrorReverseSide
- type PassportElementErrorSelfie
- type PassportElementErrorTranslationFile
- type PassportElementErrorTranslationFiles
- type PassportElementErrorUnspecified
- type PassportFile
- type PhotoSize
- type PinChatMessageParams
- type Poll
- type PollOption
- type PreCheckoutQuery
- type PromoteChatMemberParams
- type ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type RestrictChatMemberParams
- type SendAnimationParams
- type SendAudioParams
- type SendChatActionParams
- type SendContactParams
- type SendDocumentParams
- type SendGameParams
- type SendInvoiceParams
- type SendLocationParams
- type SendMediaGroupParams
- type SendMessageParams
- type SendPhotoParams
- type SendPollParams
- type SendStickerParams
- type SendVenueParams
- type SendVideoNoteParams
- type SendVideoParams
- type SendVoiceParams
- type SetChatDescriptionParams
- type SetChatPermissionsParams
- type SetChatPhotoParams
- type SetChatStickerSetParams
- type SetChatTitleParams
- type SetGameScoreParams
- type SetPassportDataErrorsParams
- type SetStickerPositionInSetParams
- type SetWebhookParams
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type Sticker
- type StickerSet
- type StopMessageLiveLocationParams
- type StopPollParams
- type SuccessfulPayment
- type UnbanChatMemberParams
- type UnpinChatMessageParams
- type Update
- type UploadStickerFileParams
- type User
- type UserProfilePhotos
- type Venue
- type Video
- type VideoNote
- type Voice
- type WebhookInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddStickerToSetParams ¶ added in v0.3.0
type AddStickerToSetParams struct { UserID int `json:"user_id"` // User identifier of sticker set owner Name string `json:"name"` // Sticker set name PngSticker interface{} `json:"png_sticker"` // Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » Emojis string `json:"emojis"` // One or more emoji corresponding to the sticker MaskPosition *MaskPosition `json:"mask_position,omitempty"` // A JSON-serialized object for position where the mask should be placed on faces }
type Animation ¶ added in v0.1.0
type Animation struct { FileID string `json:"file_id"` // Unique file identifier Width int `json:"width"` // Video width as defined by sender Height int `json:"height"` // Video height as defined by sender Duration int `json:"duration"` // Duration of the video in seconds as defined by sender Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Animation thumbnail as defined by sender FileName string `json:"file_name,omitempty"` // Optional. Original animation filename as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by sender FileSize int `json:"file_size,omitempty"` // Optional. File size }
Animation represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
type AnswerCallbackQueryParams ¶ added in v0.3.0
type AnswerCallbackQueryParams struct { CallbackQueryID string `json:"callback_query_id"` // Unique identifier for the query to be answered Text string `json:"text,omitempty"` // Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters ShowAlert bool `json:"show_alert,omitempty"` // If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. URL string `json:"url,omitempty"` // URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game button.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. CacheTime int `json:"cache_time,omitempty"` // The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. }
type AnswerInlineQueryParams ¶ added in v0.3.0
type AnswerInlineQueryParams struct { InlineQueryID string `json:"inline_query_id"` // Unique identifier for the answered query Results *[]InlineQueryResult `json:"results"` // A JSON-serialized array of results for the inline query CacheTime int `json:"cache_time,omitempty"` // The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. IsPersonal bool `json:"is_personal,omitempty"` // Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query NextOffset string `json:"next_offset,omitempty"` // Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. SwitchPmText string `json:"switch_pm_text,omitempty"` // If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter SwitchPmParameter string `json:"switch_pm_parameter,omitempty"` // Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities. }
type AnswerPreCheckoutQueryParams ¶ added in v0.3.0
type AnswerPreCheckoutQueryParams struct { PreCheckoutQueryID string `json:"pre_checkout_query_id"` // Unique identifier for the query to be answered Ok bool `json:"ok"` // Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. ErrorMessage string `json:"error_message,omitempty"` // Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. }
type AnswerShippingQueryParams ¶ added in v0.3.0
type AnswerShippingQueryParams struct { ShippingQueryID string `json:"shipping_query_id"` // Unique identifier for the query to be answered Ok bool `json:"ok"` // Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) ShippingOptions *[]ShippingOption `json:"shipping_options,omitempty"` // Required if ok is True. A JSON-serialized array of available shipping options. ErrorMessage string `json:"error_message,omitempty"` // Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. }
type Audio ¶ added in v0.1.0
type Audio struct { FileID string `json:"file_id"` // Unique identifier for this file Duration int `json:"duration"` // Duration of the audio in seconds as defined by sender Performer string `json:"performer,omitempty"` // Optional. Performer of the audio as defined by sender or by audio tags Title string `json:"title,omitempty"` // Optional. Title of the audio as defined by sender or by audio tags MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by sender FileSize int `json:"file_size,omitempty"` // Optional. File size Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs }
Audio represents an audio file to be treated as music by the Telegram clients.
type CallbackGame ¶ added in v0.1.0
type CallbackGame struct { UserID int `json:"user_id"` // User identifier Score int `json:"score"` // New score, must be non-negative Force bool `json:"force"` // Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters DisableEditMessage bool `json:"disable_edit_message"` // Pass True, if the game message should not be automatically edited to include the current scoreboard ChatID int64 `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the sent message InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message }
CallbackGame is a placeholder, currently holds no information. Use BotFather to set up your game.
type CallbackQuery ¶ added in v0.1.0
type CallbackQuery struct { ID string `json:"id"` // Unique identifier for this query From *User `json:"from"` // Sender Message *Message `json:"message,omitempty"` // Optional. 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 InlineMessageID string `json:"inline_message_id,omitempty"` // Optional. IDentifier of the message sent via the bot in inline mode, that originated the query. ChatInstance string `json:"chat_instance"` // Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. Data string `json:"data,omitempty"` // Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. GameShortName string `json:"game_short_name,omitempty"` // Optional. Short name of a Game to be returned, serves as the unique identifier for the game }
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.
type Chat ¶ added in v0.1.0
type Chat struct { ID int64 `json:"id"` // Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Type string `json:"type"` // Type of chat, can be either “private”, “group”, “supergroup” or “channel” Title string `json:"title,omitempty"` // Optional. Title, for supergroups, channels and group chats Username string `json:"username,omitempty"` // Optional. Username, for private chats, supergroups and channels if available FirstName string `json:"first_name,omitempty"` // Optional. First name of the other party in a private chat LastName string `json:"last_name,omitempty"` // Optional. Last name of the other party in a private chat Photo *ChatPhoto `json:"photo,omitempty"` // Optional. Chat photo. Returned only in getChat. Description string `json:"description,omitempty"` // Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. InviteLink string `json:"invite_link,omitempty"` // Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat. PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat. Permissions *ChatPermissions `json:"permissions,omitempty"` // Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. StickerSetName string `json:"sticker_set_name,omitempty"` // Optional. For supergroups, name of group sticker set. Returned only in getChat. CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` // Optional. True, if the bot can change the group sticker set. Returned only in getChat. }
Chat represents a chat.
type ChatMember ¶ added in v0.1.0
type ChatMember struct { User *User `json:"user"` // Information about the user Status string `json:"status"` // The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked” UntilDate int `json:"until_date,omitempty"` // Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time CanBeEdited bool `json:"can_be_edited,omitempty"` // Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user CanPostMessages bool `json:"can_post_messages,omitempty"` // Optional. Administrators only. True, if the administrator can post in the channel; channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only CanDeleteMessages bool `json:"can_delete_messages,omitempty"` // Optional. Administrators only. True, if the administrator can delete messages of other users CanRestrictMembers bool `json:"can_restrict_members,omitempty"` // Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members CanPromoteMembers bool `json:"can_promote_members,omitempty"` // Optional. 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) CanChangeInfo bool `json:"can_change_info,omitempty"` // Optional. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings CanInviteUsers bool `json:"can_invite_users,omitempty"` // Optional. Administrators and restricted only. True, if the user is allowed to invite new users to the chat CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only IsMember bool `json:"is_member,omitempty"` // Optional. Restricted only. True, if the user is a member of the chat at the moment of the request CanSendMessages bool `json:"can_send_messages,omitempty"` // Optional. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` // Optional. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes CanSendPolls bool `json:"can_send_polls,omitempty"` // Optional. Restricted only. True, if the user is allowed to send polls CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // Optional. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` // Optional. Restricted only. True, if the user is allowed to add web page previews to their messages }
ChatMember contains information about one member of a chat.
type ChatPermissions ¶ added in v0.1.0
type ChatPermissions struct { CanSendMessages bool `json:"can_send_messages,omitempty"` // Optional. True, if the user is allowed to send text messages, contacts, locations and venues CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` // Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages CanSendPolls bool `json:"can_send_polls,omitempty"` // Optional. True, if the user is allowed to send polls, implies can_send_messages CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` // Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages CanChangeInfo bool `json:"can_change_info,omitempty"` // Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups CanInviteUsers bool `json:"can_invite_users,omitempty"` // Optional. True, if the user is allowed to invite new users to the chat CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. True, if the user is allowed to pin messages. Ignored in public supergroups }
ChatPermissions describes actions that a non-administrator user is allowed to take in a chat.
type ChatPhoto ¶ added in v0.1.0
type ChatPhoto struct { SmallFileID string `json:"small_file_id"` // Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. BigFileID string `json:"big_file_id"` // Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. }
ChatPhoto represents a chat photo.
type ChosenInlineResult ¶ added in v0.1.0
type ChosenInlineResult struct { ResultID string `json:"result_id"` // The unique identifier for the result that was chosen From *User `json:"from"` // The user that chose the result Location *Location `json:"location,omitempty"` // Optional. Sender location, only for bots that require user location InlineMessageID string `json:"inline_message_id,omitempty"` // Optional. 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. Query string `json:"query"` // The query that was used to obtain the result }
ChosenInlineResult represents a result of an inline query that was chosen by the user and sent to their chat partner.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client keeps data to perform Bot API methods
func (*Client) AddStickerToSet ¶ added in v0.3.0
func (c *Client) AddStickerToSet(params *AddStickerToSetParams) (bool, error)
Use this method to add a new sticker to a set created by the bot. Returns True on success.
func (*Client) AnswerCallbackQuery ¶ added in v0.3.0
func (c *Client) AnswerCallbackQuery(params *AnswerCallbackQueryParams) (bool, error)
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
func (*Client) AnswerInlineQuery ¶ added in v0.3.0
func (c *Client) AnswerInlineQuery(params *AnswerInlineQueryParams) (bool, error)
Use this method to send answers to an inline query. On success, True is returned.No more than 50 results per query are allowed.
func (*Client) AnswerPreCheckoutQuery ¶ added in v0.3.0
func (c *Client) AnswerPreCheckoutQuery(params *AnswerPreCheckoutQueryParams) (bool, error)
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
func (*Client) AnswerShippingQuery ¶ added in v0.3.0
func (c *Client) AnswerShippingQuery(params *AnswerShippingQueryParams) (bool, error)
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
func (*Client) CreateNewStickerSet ¶ added in v0.3.0
func (c *Client) CreateNewStickerSet(params *CreateNewStickerSetParams) (bool, error)
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.
func (*Client) DeleteChatPhoto ¶ added in v0.2.0
func (c *Client) DeleteChatPhoto(params *DeleteChatPhotoParams) (bool, error)
Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
func (*Client) DeleteChatStickerSet ¶ added in v0.2.0
func (c *Client) DeleteChatStickerSet(params *DeleteChatStickerSetParams) (bool, error)
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
func (*Client) DeleteMessage ¶ added in v0.3.0
func (c *Client) DeleteMessage(params *DeleteMessageParams) (bool, error)
Use this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.Returns True on success.
func (*Client) DeleteStickerFromSet ¶ added in v0.3.0
func (c *Client) DeleteStickerFromSet(params *DeleteStickerFromSetParams) (bool, error)
Use this method to delete a sticker from a set created by the bot. Returns True on success.
func (*Client) DeleteWebhook ¶ added in v0.2.0
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.
func (*Client) EditMessageCaption ¶ added in v0.3.0
func (c *Client) EditMessageCaption(params *EditMessageCaptionParams) (Message, error)
Use this method to edit captions of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
func (*Client) EditMessageLiveLocation ¶ added in v0.3.0
func (c *Client) EditMessageLiveLocation(params *EditMessageLiveLocationParams) (Message, error)
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
func (*Client) EditMessageMedia ¶ added in v0.3.0
func (c *Client) EditMessageMedia(params *EditMessageMediaParams) (Message, error)
Use this method to edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
func (*Client) EditMessageReplyMarkup ¶ added in v0.3.0
func (c *Client) EditMessageReplyMarkup(params *EditMessageReplyMarkupParams) (Message, error)
Use this method to edit only the reply markup of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
func (*Client) EditMessageText ¶ added in v0.3.0
func (c *Client) EditMessageText(params *EditMessageTextParams) (Message, error)
Use this method to edit text and game messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
func (*Client) ExportChatInviteLink ¶ added in v0.2.0
func (c *Client) ExportChatInviteLink(params *ExportChatInviteLinkParams) (string, error)
Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as String on success.
func (*Client) ForwardMessage ¶ added in v0.2.0
func (c *Client) ForwardMessage(params *ForwardMessageParams) (Message, error)
Use this method to forward messages of any kind. On success, the sent Message is returned.
func (*Client) GetChat ¶ added in v0.2.0
func (c *Client) GetChat(params *GetChatParams) (Chat, error)
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
func (*Client) GetChatAdministrators ¶ added in v0.2.0
func (c *Client) GetChatAdministrators(params *GetChatAdministratorsParams) ([]ChatMember, error)
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
func (*Client) GetChatMember ¶ added in v0.2.0
func (c *Client) GetChatMember(params *GetChatMemberParams) (ChatMember, error)
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
func (*Client) GetChatMembersCount ¶ added in v0.2.0
func (c *Client) GetChatMembersCount(params *GetChatMembersCountParams) (int, error)
Use this method to get the number of members in a chat. Returns Int on success.
func (*Client) GetFile ¶ added in v0.3.0
func (c *Client) GetFile(params *GetFileParams) (File, error)
Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. 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 again.
func (*Client) GetGameHighScores ¶ added in v0.3.0
func (c *Client) GetGameHighScores(params *GetGameHighScoresParams) ([]GameHighScore, error)
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
func (*Client) GetMe ¶ added in v0.1.0
A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
func (*Client) GetStickerSet ¶ added in v0.3.0
func (c *Client) GetStickerSet(params *GetStickerSetParams) (StickerSet, error)
Use this method to get a sticker set. On success, a StickerSet object is returned.
func (*Client) GetUpdates ¶ added in v0.2.0
func (c *Client) GetUpdates(params *GetUpdatesParams) ([]Update, error)
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
func (*Client) GetUserProfilePhotos ¶ added in v0.3.0
func (c *Client) GetUserProfilePhotos(params *GetUserProfilePhotosParams) (UserProfilePhotos, error)
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
func (*Client) GetWebhookInfo ¶ added in v0.2.0
func (c *Client) GetWebhookInfo() (WebhookInfo, error)
Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
func (*Client) KickChatMember ¶ added in v0.2.0
func (c *Client) KickChatMember(params *KickChatMemberParams) (bool, error)
Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
func (*Client) LeaveChat ¶ added in v0.2.0
func (c *Client) LeaveChat(params *LeaveChatParams) (bool, error)
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
func (*Client) PinChatMessage ¶ added in v0.2.0
func (c *Client) PinChatMessage(params *PinChatMessageParams) (bool, error)
Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
func (*Client) PromoteChatMember ¶ added in v0.2.0
func (c *Client) PromoteChatMember(params *PromoteChatMemberParams) (bool, error)
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. Returns True on success.
func (*Client) RestrictChatMember ¶ added in v0.2.0
func (c *Client) RestrictChatMember(params *RestrictChatMemberParams) (bool, error)
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
func (*Client) SendAnimation ¶ added in v0.3.0
func (c *Client) SendAnimation(params *SendAnimationParams) (Message, error)
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func (*Client) SendAudio ¶ added in v0.3.0
func (c *Client) SendAudio(params *SendAudioParams) (Message, error)
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
func (*Client) SendChatAction ¶ added in v0.2.0
func (c *Client) SendChatAction(params *SendChatActionParams) (bool, error)
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
func (*Client) SendContact ¶ added in v0.3.0
func (c *Client) SendContact(params *SendContactParams) (Message, error)
Use this method to send phone contacts. On success, the sent Message is returned.
func (*Client) SendDocument ¶ added in v0.3.0
func (c *Client) SendDocument(params *SendDocumentParams) (Message, error)
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func (*Client) SendGame ¶ added in v0.3.0
func (c *Client) SendGame(params *SendGameParams) (Message, error)
Use this method to send a game. On success, the sent Message is returned.
func (*Client) SendInvoice ¶ added in v0.3.0
func (c *Client) SendInvoice(params *SendInvoiceParams) (Message, error)
Use this method to send invoices. On success, the sent Message is returned.
func (*Client) SendLocation ¶ added in v0.3.0
func (c *Client) SendLocation(params *SendLocationParams) (Message, error)
Use this method to send point on the map. On success, the sent Message is returned.
func (*Client) SendMediaGroup ¶ added in v0.2.0
func (c *Client) SendMediaGroup(params *SendMediaGroupParams) ([]Message, error)
Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
func (*Client) SendMessage ¶ added in v0.2.0
func (c *Client) SendMessage(params *SendMessageParams) (Message, error)
Use this method to send text messages. On success, the sent Message is returned.
func (*Client) SendPhoto ¶ added in v0.2.0
func (c *Client) SendPhoto(params *SendPhotoParams) (Message, error)
Use this method to send photos. On success, the sent Message is returned.
func (*Client) SendPoll ¶ added in v0.3.0
func (c *Client) SendPoll(params *SendPollParams) (Message, error)
Use this method to send a native poll. A native poll can't be sent to a private chat. On success, the sent Message is returned.
func (*Client) SendSticker ¶ added in v0.3.0
func (c *Client) SendSticker(params *SendStickerParams) (Message, error)
Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned.
func (*Client) SendVenue ¶ added in v0.3.0
func (c *Client) SendVenue(params *SendVenueParams) (Message, error)
Use this method to send information about a venue. On success, the sent Message is returned.
func (*Client) SendVideo ¶ added in v0.3.0
func (c *Client) SendVideo(params *SendVideoParams) (Message, error)
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
func (*Client) SendVideoNote ¶ added in v0.3.0
func (c *Client) SendVideoNote(params *SendVideoNoteParams) (Message, error)
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
func (*Client) SendVoice ¶ added in v0.3.0
func (c *Client) SendVoice(params *SendVoiceParams) (Message, error)
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func (*Client) SetChatDescription ¶ added in v0.2.0
func (c *Client) SetChatDescription(params *SetChatDescriptionParams) (bool, error)
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
func (*Client) SetChatPermissions ¶ added in v0.2.0
func (c *Client) SetChatPermissions(params *SetChatPermissionsParams) (bool, error)
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.
func (*Client) SetChatPhoto ¶ added in v0.2.0
func (c *Client) SetChatPhoto(params *SetChatPhotoParams) (bool, error)
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
func (*Client) SetChatStickerSet ¶ added in v0.2.0
func (c *Client) SetChatStickerSet(params *SetChatStickerSetParams) (bool, error)
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
func (*Client) SetChatTitle ¶ added in v0.2.0
func (c *Client) SetChatTitle(params *SetChatTitleParams) (bool, error)
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
func (*Client) SetGameScore ¶ added in v0.3.0
func (c *Client) SetGameScore(params *SetGameScoreParams) (interface{}, error)
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
func (*Client) SetPassportDataErrors ¶ added in v0.3.0
func (c *Client) SetPassportDataErrors(params *SetPassportDataErrorsParams) (bool, error)
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
func (*Client) SetStickerPositionInSet ¶ added in v0.3.0
func (c *Client) SetStickerPositionInSet(params *SetStickerPositionInSetParams) (bool, error)
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
func (*Client) SetWebhook ¶ added in v0.2.0
func (c *Client) SetWebhook(params *SetWebhookParams) (bool, error)
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.
func (*Client) StopMessageLiveLocation ¶ added in v0.3.0
func (c *Client) StopMessageLiveLocation(params *StopMessageLiveLocationParams) (Message, error)
Use this method to stop updating a live location message before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
func (*Client) StopPoll ¶ added in v0.3.0
func (c *Client) StopPoll(params *StopPollParams) (Poll, error)
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.
func (*Client) UnbanChatMember ¶ added in v0.2.0
func (c *Client) UnbanChatMember(params *UnbanChatMemberParams) (bool, error)
Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. Returns True on success.
func (*Client) UnpinChatMessage ¶ added in v0.2.0
func (c *Client) UnpinChatMessage(params *UnpinChatMessageParams) (bool, error)
Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
func (*Client) UploadStickerFile ¶ added in v0.3.0
func (c *Client) UploadStickerFile(params *UploadStickerFileParams) (File, error)
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
type Contact ¶ added in v0.1.0
type Contact struct { PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Optional. Contact's last name UserID int `json:"user_id,omitempty"` // Optional. Contact's user identifier in Telegram Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard }
Contact represents a phone contact.
type CreateNewStickerSetParams ¶ added in v0.3.0
type CreateNewStickerSetParams struct { UserID int `json:"user_id"` // User identifier of created sticker set owner Name string `json:"name"` // Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters. Title string `json:"title"` // Sticker set title, 1-64 characters PngSticker interface{} `json:"png_sticker"` // Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » Emojis string `json:"emojis"` // One or more emoji corresponding to the sticker ContainsMasks bool `json:"contains_masks,omitempty"` // Pass True, if a set of mask stickers should be created MaskPosition *MaskPosition `json:"mask_position,omitempty"` // A JSON-serialized object for position where the mask should be placed on faces }
type DeleteChatPhotoParams ¶ added in v0.2.0
type DeleteChatPhotoParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
type DeleteChatStickerSetParams ¶ added in v0.2.0
type DeleteChatStickerSetParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
type DeleteMessageParams ¶ added in v0.3.0
type DeleteMessageParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // IDentifier of the message to delete }
type DeleteStickerFromSetParams ¶ added in v0.3.0
type DeleteStickerFromSetParams struct {
Sticker string `json:"sticker"` // File identifier of the sticker
}
type Document ¶ added in v0.1.0
type Document struct { FileID string `json:"file_id"` // Unique file identifier Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Document thumbnail as defined by sender FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by sender FileSize int `json:"file_size,omitempty"` // Optional. File size }
Document represents a general file (as opposed to photos, voice messages and audio files).
type EditMessageCaptionParams ¶ added in v0.3.0
type EditMessageCaptionParams struct { ChatID interface{} `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message Caption string `json:"caption,omitempty"` // New caption of the message ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. }
type EditMessageLiveLocationParams ¶ added in v0.3.0
type EditMessageLiveLocationParams struct { ChatID interface{} `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message Latitude float64 `json:"latitude"` // Latitude of new location Longitude float64 `json:"longitude"` // Longitude of new location ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new inline keyboard. }
type EditMessageMediaParams ¶ added in v0.3.0
type EditMessageMediaParams struct { ChatID interface{} `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message Media interface{} `json:"media"` // A JSON-serialized object for a new media content of the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new inline keyboard. }
type EditMessageReplyMarkupParams ¶ added in v0.3.0
type EditMessageReplyMarkupParams struct { ChatID interface{} `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. }
type EditMessageTextParams ¶ added in v0.3.0
type EditMessageTextParams struct { ChatID interface{} `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message Text string `json:"text"` // New text of the message ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` // Disables link previews for links in this message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. }
type EncryptedCredentials ¶ added in v0.1.0
type EncryptedCredentials struct { Data string `json:"data"` // Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication Hash string `json:"hash"` // Base64-encoded data hash for data authentication Secret string `json:"secret"` // Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption }
EncryptedCredentials contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
type EncryptedPassportElement ¶ added in v0.1.0
type EncryptedPassportElement struct { Type string `json:"type"` // Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”. Data string `json:"data,omitempty"` // Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. PhoneNumber string `json:"phone_number,omitempty"` // Optional. User's verified phone number, available only for “phone_number” type Email string `json:"email,omitempty"` // Optional. User's verified email address, available only for “email” type Files []*PassportFile `json:"files,omitempty"` // Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. FrontSide *PassportFile `json:"front_side,omitempty"` // Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. ReverseSide *PassportFile `json:"reverse_side,omitempty"` // Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. Selfie *PassportFile `json:"selfie,omitempty"` // Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. Translation []*PassportFile `json:"translation,omitempty"` // Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. Hash string `json:"hash"` // Base64-encoded element hash for using in PassportElementErrorUnspecified }
EncryptedPassportElement contains information about documents or other Telegram Passport elements shared with the bot by the user.
type ExportChatInviteLinkParams ¶ added in v0.2.0
type ExportChatInviteLinkParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
type File ¶ added in v0.1.0
type File struct { FileID string `json:"file_id"` // Unique identifier for this file FileSize int `json:"file_size,omitempty"` // Optional. File size, if known FilePath string `json:"file_path,omitempty"` // Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. URL string `json:"-"` }
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.
type ForceReply ¶ added in v0.1.0
type ForceReply struct { ForceReply bool `json:"force_reply"` // Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply' Selective bool `json:"selective,omitempty"` // Optional. 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. }
Upon receiving a message with this object, Telegram clients will 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.
type ForwardMessageParams ¶ added in v0.2.0
type ForwardMessageParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) FromChatID interface{} `json:"from_chat_id"` // Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. MessageID int `json:"message_id"` // Message identifier in the chat specified in from_chat_id }
type Game ¶ added in v0.1.0
type Game struct { Title string `json:"title"` // Title of the game Description string `json:"description"` // Description of the game Photo []*PhotoSize `json:"photo"` // Photo that will be displayed in the game message in chats. Text string `json:"text,omitempty"` // Optional. 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. TextEntities []*MessageEntity `json:"text_entities,omitempty"` // Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. Animation *Animation `json:"animation,omitempty"` // Optional. Animation that will be displayed in the game message in chats. Upload via BotFather }
Game represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
type GameHighScore ¶ added in v0.1.0
type GameHighScore struct { Position int `json:"position"` // Position in high score table for the game User *User `json:"user"` // User Score int `json:"score"` // Score }
GameHighScore represents one row of the high scores table for a game.
type GetChatAdministratorsParams ¶ added in v0.2.0
type GetChatAdministratorsParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
type GetChatMemberParams ¶ added in v0.2.0
type GetChatMemberParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) UserID int `json:"user_id"` // Unique identifier of the target user }
type GetChatMembersCountParams ¶ added in v0.2.0
type GetChatMembersCountParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
type GetChatParams ¶ added in v0.2.0
type GetChatParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
type GetFileParams ¶ added in v0.3.0
type GetFileParams struct {
FileID string `json:"file_id"` // File identifier to get info about
}
type GetGameHighScoresParams ¶ added in v0.3.0
type GetGameHighScoresParams struct { UserID int `json:"user_id"` // Target user id ChatID int64 `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the sent message InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message }
type GetStickerSetParams ¶ added in v0.3.0
type GetStickerSetParams struct {
Name string `json:"name"` // Name of the sticker set
}
type GetUpdatesParams ¶ added in v0.2.0
type GetUpdatesParams struct { Offset int `json:"offset,omitempty"` // IDentifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten. Limit int `json:"limit,omitempty"` // Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100. Timeout int `json:"timeout,omitempty"` // Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. AllowedUpdates []string `json:"allowed_updates,omitempty"` // List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time. }
type GetUserProfilePhotosParams ¶ added in v0.3.0
type GetUserProfilePhotosParams struct { UserID int `json:"user_id"` // Unique identifier of the target user Offset int `json:"offset,omitempty"` // Sequential number of the first photo to be returned. By default, all photos are returned. Limit int `json:"limit,omitempty"` // Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100. }
type InlineKeyboardButton ¶ added in v0.1.0
type InlineKeyboardButton struct { Text string `json:"text"` // Label text on the button URL string `json:"url,omitempty"` // Optional. HTTP or tg:// url to be opened when button is pressed LoginURL *LoginURL `json:"login_url,omitempty"` // Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. CallbackData string `json:"callback_data,omitempty"` // Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes SwitchInlineQuery string `json:"switch_inline_query,omitempty"` // Optional. 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. SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"` // Optional. 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. CallbackGame *CallbackGame `json:"callback_game,omitempty"` // Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row. Pay bool `json:"pay,omitempty"` // Optional. Specify True, to send a Pay button.NOTE: This type of button must always be the first button in the first row. }
InlineKeyboardButton represents one button of an inline keyboard. You must use exactly one of the optional fields.
type InlineKeyboardMarkup ¶ added in v0.1.0
type InlineKeyboardMarkup struct {
InlineKeyboard [][]*InlineKeyboardButton `json:"inline_keyboard"` // Array of button rows, each represented by an Array of InlineKeyboardButton objects
}
InlineKeyboardMarkup represents an inline keyboard that appears right next to the message it belongs to.
type InlineQuery ¶ added in v0.1.0
type InlineQuery struct { ID string `json:"id"` // Unique identifier for this query From *User `json:"from"` // Sender Location *Location `json:"location,omitempty"` // Optional. Sender location, only for bots that request user location Query string `json:"query"` // Text of the query (up to 512 characters) Offset string `json:"offset"` // Offset of the results to be returned, can be controlled by the bot }
InlineQuery represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
type InlineQueryResult ¶ added in v0.1.0
type InlineQueryResult struct { Type string `json:"type"` // Type of the result, must be article ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Title string `json:"title"` // Title of the result InputMessageContent *InputMessageContent `json:"input_message_content"` // Content of the message to be sent ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message URL string `json:"url,omitempty"` // Optional. URL of the result HideURL bool `json:"hide_url,omitempty"` // Optional. Pass True, if you don't want the URL to be shown in the message Description string `json:"description,omitempty"` // Optional. Short description of the result ThumbURL string `json:"thumb_url,omitempty"` // Optional. URL of the thumbnail for the result ThumbWidth int `json:"thumb_width,omitempty"` // Optional. Thumbnail width ThumbHeight int `json:"thumb_height,omitempty"` // Optional. Thumbnail height }
InlineQueryResult represents one result of an inline query. Telegram clients currently support results of the following 20 types:
type InlineQueryResultArticle ¶ added in v0.1.0
type InlineQueryResultArticle struct { Type string `json:"type"` // Type of the result, must be article ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Title string `json:"title"` // Title of the result InputMessageContent *InputMessageContent `json:"input_message_content"` // Content of the message to be sent ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message URL string `json:"url,omitempty"` // Optional. URL of the result HideURL bool `json:"hide_url,omitempty"` // Optional. Pass True, if you don't want the URL to be shown in the message Description string `json:"description,omitempty"` // Optional. Short description of the result ThumbURL string `json:"thumb_url,omitempty"` // Optional. URL of the thumbnail for the result ThumbWidth int `json:"thumb_width,omitempty"` // Optional. Thumbnail width ThumbHeight int `json:"thumb_height,omitempty"` // Optional. Thumbnail height }
InlineQueryResultArticle represents a link to an article or web page.
type InlineQueryResultAudio ¶ added in v0.1.0
type InlineQueryResultAudio struct { Type string `json:"type"` // Type of the result, must be audio ID string `json:"id"` // Unique identifier for this result, 1-64 bytes AudioURL string `json:"audio_url"` // A valid URL for the audio file Title string `json:"title"` // Title Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. Performer string `json:"performer,omitempty"` // Optional. Performer AudioDuration int `json:"audio_duration,omitempty"` // Optional. Audio duration in seconds ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the audio }
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.
type InlineQueryResultCachedAudio ¶ added in v0.1.0
type InlineQueryResultCachedAudio struct { Type string `json:"type"` // Type of the result, must be audio ID string `json:"id"` // Unique identifier for this result, 1-64 bytes AudioFileID string `json:"audio_file_id"` // A valid file identifier for the audio file Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the audio }
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.
type InlineQueryResultCachedDocument ¶ added in v0.1.0
type InlineQueryResultCachedDocument struct { Type string `json:"type"` // Type of the result, must be document ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Title string `json:"title"` // Title for the result DocumentFileID string `json:"document_file_id"` // A valid file identifier for the file Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the file }
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.
type InlineQueryResultCachedGif ¶ added in v0.1.0
type InlineQueryResultCachedGif struct { Type string `json:"type"` // Type of the result, must be gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes GifFileID string `json:"gif_file_id"` // A valid file identifier for the GIF file Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the GIF file to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the GIF animation }
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.
type InlineQueryResultCachedMpeg4Gif ¶ added in v0.1.0
type InlineQueryResultCachedMpeg4Gif struct { Type string `json:"type"` // Type of the result, must be mpeg4_gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Mpeg4FileID string `json:"mpeg4_file_id"` // A valid file identifier for the MP4 file Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video 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.
type InlineQueryResultCachedPhoto ¶ added in v0.1.0
type InlineQueryResultCachedPhoto struct { Type string `json:"type"` // Type of the result, must be photo ID string `json:"id"` // Unique identifier for this result, 1-64 bytes PhotoFileID string `json:"photo_file_id"` // A valid file identifier of the photo Title string `json:"title,omitempty"` // Optional. Title for the result Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the photo }
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.
type InlineQueryResultCachedSticker ¶ added in v0.1.0
type InlineQueryResultCachedSticker struct { Type string `json:"type"` // Type of the result, must be sticker ID string `json:"id"` // Unique identifier for this result, 1-64 bytes StickerFileID string `json:"sticker_file_id"` // A valid file identifier of the sticker ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the sticker }
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.
type InlineQueryResultCachedVideo ¶ added in v0.1.0
type InlineQueryResultCachedVideo struct { Type string `json:"type"` // Type of the result, must be video ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VideoFileID string `json:"video_file_id"` // A valid file identifier for the video file Title string `json:"title"` // Title for the result Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video }
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.
type InlineQueryResultCachedVoice ¶ added in v0.1.0
type InlineQueryResultCachedVoice struct { Type string `json:"type"` // Type of the result, must be voice ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VoiceFileID string `json:"voice_file_id"` // A valid file identifier for the voice message Title string `json:"title"` // Voice message title Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the voice message }
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.
type InlineQueryResultContact ¶ added in v0.1.0
type InlineQueryResultContact struct { Type string `json:"type"` // Type of the result, must be contact ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Optional. Contact's last name Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the contact ThumbURL string `json:"thumb_url,omitempty"` // Optional. URL of the thumbnail for the result ThumbWidth int `json:"thumb_width,omitempty"` // Optional. Thumbnail width ThumbHeight int `json:"thumb_height,omitempty"` // Optional. Thumbnail height }
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.
type InlineQueryResultDocument ¶ added in v0.1.0
type InlineQueryResultDocument struct { Type string `json:"type"` // Type of the result, must be document ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Title string `json:"title"` // Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. DocumentURL string `json:"document_url"` // A valid URL for the file MimeType string `json:"mime_type"` // Mime type of the content of the file, either “application/pdf” or “application/zip” Description string `json:"description,omitempty"` // Optional. Short description of the result ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the file ThumbURL string `json:"thumb_url,omitempty"` // Optional. URL of the thumbnail (jpeg only) for the file ThumbWidth int `json:"thumb_width,omitempty"` // Optional. Thumbnail width ThumbHeight int `json:"thumb_height,omitempty"` // Optional. Thumbnail height }
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.
type InlineQueryResultGame ¶ added in v0.1.0
type InlineQueryResultGame struct { Type string `json:"type"` // Type of the result, must be game ID string `json:"id"` // Unique identifier for this result, 1-64 bytes GameShortName string `json:"game_short_name"` // Short name of the game ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message }
InlineQueryResultGame represents a Game.
type InlineQueryResultGif ¶ added in v0.1.0
type InlineQueryResultGif struct { Type string `json:"type"` // Type of the result, must be gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes GifURL string `json:"gif_url"` // A valid URL for the GIF file. File size must not exceed 1MB GifWidth int `json:"gif_width,omitempty"` // Optional. Width of the GIF GifHeight int `json:"gif_height,omitempty"` // Optional. Height of the GIF GifDuration int `json:"gif_duration,omitempty"` // Optional. Duration of the GIF ThumbURL string `json:"thumb_url"` // URL of the static thumbnail for the result (jpeg or gif) Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the GIF file to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the GIF animation }
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.
type InlineQueryResultLocation ¶ added in v0.1.0
type InlineQueryResultLocation struct { Type string `json:"type"` // Type of the result, must be location ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Latitude float64 `json:"latitude"` // Location latitude in degrees Longitude float64 `json:"longitude"` // Location longitude in degrees Title string `json:"title"` // Location title LivePeriod int `json:"live_period,omitempty"` // Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the location ThumbURL string `json:"thumb_url,omitempty"` // Optional. URL of the thumbnail for the result ThumbWidth int `json:"thumb_width,omitempty"` // Optional. Thumbnail width ThumbHeight int `json:"thumb_height,omitempty"` // Optional. Thumbnail height }
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.
type InlineQueryResultMpeg4Gif ¶ added in v0.1.0
type InlineQueryResultMpeg4Gif struct { Type string `json:"type"` // Type of the result, must be mpeg4_gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Mpeg4URL string `json:"mpeg4_url"` // A valid URL for the MP4 file. File size must not exceed 1MB Mpeg4Width int `json:"mpeg4_width,omitempty"` // Optional. Video width Mpeg4Height int `json:"mpeg4_height,omitempty"` // Optional. Video height Mpeg4Duration int `json:"mpeg4_duration,omitempty"` // Optional. Video duration ThumbURL string `json:"thumb_url"` // URL of the static thumbnail (jpeg or gif) for the result Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video animation }
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.
type InlineQueryResultPhoto ¶ added in v0.1.0
type InlineQueryResultPhoto struct { Type string `json:"type"` // Type of the result, must be photo ID string `json:"id"` // Unique identifier for this result, 1-64 bytes PhotoURL string `json:"photo_url"` // A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB ThumbURL string `json:"thumb_url"` // URL of the thumbnail for the photo PhotoWidth int `json:"photo_width,omitempty"` // Optional. Width of the photo PhotoHeight int `json:"photo_height,omitempty"` // Optional. Height of the photo Title string `json:"title,omitempty"` // Optional. Title for the result Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the photo }
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.
type InlineQueryResultVenue ¶ added in v0.1.0
type InlineQueryResultVenue struct { Type string `json:"type"` // Type of the result, must be venue ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Latitude float64 `json:"latitude"` // Latitude of the venue location in degrees Longitude float64 `json:"longitude"` // Longitude of the venue location in degrees Title string `json:"title"` // Title of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue if known FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the venue ThumbURL string `json:"thumb_url,omitempty"` // Optional. URL of the thumbnail for the result ThumbWidth int `json:"thumb_width,omitempty"` // Optional. Thumbnail width ThumbHeight int `json:"thumb_height,omitempty"` // Optional. Thumbnail height }
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.
type InlineQueryResultVideo ¶ added in v0.1.0
type InlineQueryResultVideo struct { Type string `json:"type"` // Type of the result, must be video ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VideoURL string `json:"video_url"` // A valid URL for the embedded video player or video file MimeType string `json:"mime_type"` // Mime type of the content of video url, “text/html” or “video/mp4” ThumbURL string `json:"thumb_url"` // URL of the thumbnail (jpeg only) for the video Title string `json:"title"` // Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. VideoWidth int `json:"video_width,omitempty"` // Optional. Video width VideoHeight int `json:"video_height,omitempty"` // Optional. Video height VideoDuration int `json:"video_duration,omitempty"` // Optional. Video duration in seconds Description string `json:"description,omitempty"` // Optional. Short description of the result ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. 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). }
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.
type InlineQueryResultVoice ¶ added in v0.1.0
type InlineQueryResultVoice struct { Type string `json:"type"` // Type of the result, must be voice ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VoiceURL string `json:"voice_url"` // A valid URL for the voice recording Title string `json:"title"` // Recording title Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. VoiceDuration int `json:"voice_duration,omitempty"` // Optional. Recording duration in seconds ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the voice recording }
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.
type InputContactMessageContent ¶ added in v0.1.0
type InputContactMessageContent struct { PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Optional. Contact's last name Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes }
InputContactMessageContent represents the content of a contact message to be sent as the result of an inline query.
type InputLocationMessageContent ¶ added in v0.1.0
type InputLocationMessageContent struct { Latitude float64 `json:"latitude"` // Latitude of the location in degrees Longitude float64 `json:"longitude"` // Longitude of the location in degrees LivePeriod int `json:"live_period,omitempty"` // Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. }
InputLocationMessageContent represents the content of a location message to be sent as the result of an inline query.
type InputMediaAnimation ¶ added in v0.1.0
type InputMediaAnimation struct { Type string `json:"type"` // Type of the result, must be animation Media interface{} `json:"media"` // 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. More info on Sending Files » Thumb interface{} `json:"thumb,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Optional. Caption of the animation to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. Width int `json:"width,omitempty"` // Optional. Animation width Height int `json:"height,omitempty"` // Optional. Animation height Duration int `json:"duration,omitempty"` // Optional. Animation duration }
InputMediaAnimation represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
type InputMediaAudio ¶ added in v0.1.0
type InputMediaAudio struct { Type string `json:"type"` // Type of the result, must be audio Media interface{} `json:"media"` // 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. More info on Sending Files » Thumb interface{} `json:"thumb,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Optional. Caption of the audio to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. Duration int `json:"duration,omitempty"` // Optional. Duration of the audio in seconds Performer string `json:"performer,omitempty"` // Optional. Performer of the audio Title string `json:"title,omitempty"` // Optional. Title of the audio }
InputMediaAudio represents an audio file to be treated as music to be sent.
type InputMediaDocument ¶ added in v0.1.0
type InputMediaDocument struct { Type string `json:"type"` // Type of the result, must be document Media interface{} `json:"media"` // 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. More info on Sending Files » Thumb interface{} `json:"thumb,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. }
InputMediaDocument represents a general file to be sent.
type InputMediaPhoto ¶ added in v0.1.0
type InputMediaPhoto struct { Type string `json:"type"` // Type of the result, must be photo Media interface{} `json:"media"` // 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. More info on Sending Files » Caption string `json:"caption,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. }
InputMediaPhoto represents a photo to be sent.
type InputMediaVideo ¶ added in v0.1.0
type InputMediaVideo struct { Type string `json:"type"` // Type of the result, must be video Media interface{} `json:"media"` // 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. More info on Sending Files » Thumb interface{} `json:"thumb,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. Width int `json:"width,omitempty"` // Optional. Video width Height int `json:"height,omitempty"` // Optional. Video height Duration int `json:"duration,omitempty"` // Optional. Video duration SupportsStreaming bool `json:"supports_streaming,omitempty"` // Optional. Pass True, if the uploaded video is suitable for streaming }
InputMediaVideo represents a video to be sent.
type InputMessageContent ¶ added in v0.1.0
type InputMessageContent struct { MessageText string `json:"message_text"` // Text of the message to be sent, 1-4096 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` // Optional. Disables link previews for links in the sent message }
InputMessageContent represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 4 types:
type InputTextMessageContent ¶ added in v0.1.0
type InputTextMessageContent struct { MessageText string `json:"message_text"` // Text of the message to be sent, 1-4096 characters ParseMode string `json:"parse_mode,omitempty"` // Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` // Optional. Disables link previews for links in the sent message }
InputTextMessageContent represents the content of a text message to be sent as the result of an inline query.
type InputVenueMessageContent ¶ added in v0.1.0
type InputVenueMessageContent struct { Latitude float64 `json:"latitude"` // Latitude of the venue in degrees Longitude float64 `json:"longitude"` // Longitude of the venue in degrees Title string `json:"title"` // Name of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue, if known FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) }
InputVenueMessageContent represents the content of a venue message to be sent as the result of an inline query.
type Invoice ¶ added in v0.1.0
type Invoice struct { Title string `json:"title"` // Product name Description string `json:"description"` // Product description StartParameter string `json:"start_parameter"` // Unique bot deep-linking parameter that can be used to generate this invoice Currency string `json:"currency"` // Three-letter ISO 4217 currency code TotalAmount int `json:"total_amount"` // 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). }
Invoice contains basic information about an invoice.
type KeyboardButton ¶ added in v0.1.0
type KeyboardButton struct { Text string `json:"text"` // Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed RequestContact bool `json:"request_contact,omitempty"` // Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only RequestLocation bool `json:"request_location,omitempty"` // Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only }
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.
type KickChatMemberParams ¶ added in v0.2.0
type KickChatMemberParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) UserID int `json:"user_id"` // Unique identifier of the target user UntilDate int `json:"until_date,omitempty"` // Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever }
type LabeledPrice ¶ added in v0.1.0
type LabeledPrice struct { Label string `json:"label"` // Portion label Amount int `json:"amount"` // 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). }
LabeledPrice represents a portion of the price for goods or services.
type LeaveChatParams ¶ added in v0.2.0
type LeaveChatParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
type Location ¶ added in v0.1.0
type Location struct { Longitude float64 `json:"longitude"` // Longitude as defined by sender Latitude float64 `json:"latitude"` // Latitude as defined by sender }
Location represents a point on the map.
type LoginURL ¶ added in v0.1.0
type LoginURL struct { URL string `json:"url"` // An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. ForwardText string `json:"forward_text,omitempty"` // Optional. New text of the button in forwarded messages. BotUsername string `json:"bot_username,omitempty"` // Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. RequestWriteAccess bool `json:"request_write_access,omitempty"` // Optional. Pass True to request the permission for your bot to send messages to the user. }
LoginURL represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
type MaskPosition ¶ added in v0.1.0
type MaskPosition struct { Point string `json:"point"` // The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. XShift float64 `json:"x_shift"` // 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. YShift float64 `json:"y_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. Scale float64 `json:"scale"` // Mask scaling coefficient. For example, 2.0 means double size. }
MaskPosition describes the position on faces where a mask should be placed by default.
type Message ¶ added in v0.1.0
type Message struct { MessageID int `json:"message_id"` // Unique message identifier inside this chat From *User `json:"from"` // Optional. Sender, empty for messages sent to channels Date int `json:"date"` // Date the message was sent in Unix time Chat *Chat `json:"chat"` // Conversation the message belongs to ForwardFrom *User `json:"forward_from,omitempty"` // Optional. For forwarded messages, sender of the original message ForwardFromChat *Chat `json:"forward_from_chat,omitempty"` // Optional. For messages forwarded from channels, information about the original channel ForwardFromMessageID int `json:"forward_from_message_id,omitempty"` // Optional. For messages forwarded from channels, identifier of the original message in the channel ForwardSignature string `json:"forward_signature,omitempty"` // Optional. For messages forwarded from channels, signature of the post author if present ForwardSenderName string `json:"forward_sender_name,omitempty"` // Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages ForwardDate int `json:"forward_date,omitempty"` // Optional. For forwarded messages, date the original message was sent in Unix time ReplyToMessage *Message `json:"reply_to_message,omitempty"` // Optional. 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. EditDate int `json:"edit_date,omitempty"` // Optional. Date the message was last edited in Unix time MediaGroupID string `json:"media_group_id,omitempty"` // Optional. The unique identifier of a media message group this message belongs to AuthorSignature string `json:"author_signature,omitempty"` // Optional. Signature of the post author for messages in channels Text string `json:"text,omitempty"` // Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters. Entities []*MessageEntity `json:"entities,omitempty"` // Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"` // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption Audio *Audio `json:"audio,omitempty"` // Optional. Message is an audio file, information about the file Document *Document `json:"document,omitempty"` // Optional. Message is a general file, information about the file Animation *Animation `json:"animation,omitempty"` // Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set Game *Game `json:"game,omitempty"` // Optional. Message is a game, information about the game. More about games » Photo []*PhotoSize `json:"photo,omitempty"` // Optional. Message is a photo, available sizes of the photo Sticker *Sticker `json:"sticker,omitempty"` // Optional. Message is a sticker, information about the sticker Video *Video `json:"video,omitempty"` // Optional. Message is a video, information about the video Voice *Voice `json:"voice,omitempty"` // Optional. Message is a voice message, information about the file VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a video note, information about the video message Caption string `json:"caption,omitempty"` // Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters Contact *Contact `json:"contact,omitempty"` // Optional. Message is a shared contact, information about the contact Location *Location `json:"location,omitempty"` // Optional. Message is a shared location, information about the location Venue *Venue `json:"venue,omitempty"` // Optional. Message is a venue, information about the venue Poll *Poll `json:"poll,omitempty"` // Optional. Message is a native poll, information about the poll NewChatMembers []*User `json:"new_chat_members,omitempty"` // Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) LeftChatMember *User `json:"left_chat_member,omitempty"` // Optional. A member was removed from the group, information about them (this member may be the bot itself) NewChatTitle string `json:"new_chat_title,omitempty"` // Optional. A chat title was changed to this value NewChatPhoto []*PhotoSize `json:"new_chat_photo,omitempty"` // Optional. A chat photo was change to this value DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"` // Optional. Service message: the chat photo was deleted GroupChatCreated bool `json:"group_chat_created,omitempty"` // Optional. Service message: the group has been created SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"` // Optional. 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. ChannelChatCreated bool `json:"channel_chat_created,omitempty"` // Optional. 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. MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"` // Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"` // Optional. The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. 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. Invoice *Invoice `json:"invoice,omitempty"` // Optional. Message is an invoice for a payment, information about the invoice. More about payments » SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` // Optional. Message is a service message about a successful payment, information about the payment. More about payments » ConnectedWebsite string `json:"connected_website,omitempty"` // Optional. The domain name of the website on which the user has logged in. More about Telegram Login » PassportData *PassportData `json:"passport_data,omitempty"` // Optional. Telegram Passport data ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. }
Message represents a message.
type MessageEntity ¶ added in v0.1.0
type MessageEntity struct { Type string `json:"type"` // Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames) Offset int `json:"offset"` // Offset in UTF-16 code units to the start of the entity Length int `json:"length"` // Length of the entity in UTF-16 code units URL string `json:"url,omitempty"` // Optional. For “text_link” only, url that will be opened after user taps on the text User *User `json:"user,omitempty"` // Optional. For “text_mention” only, the mentioned user }
MessageEntity represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
type OrderInfo ¶ added in v0.1.0
type OrderInfo struct { Name string `json:"name,omitempty"` // Optional. User name PhoneNumber string `json:"phone_number,omitempty"` // Optional. User's phone number Email string `json:"email,omitempty"` // Optional. User email ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` // Optional. User shipping address }
OrderInfo represents information about an order.
type PassportData ¶ added in v0.1.0
type PassportData struct { Data []*EncryptedPassportElement `json:"data"` // Array with information about documents and other Telegram Passport elements that was shared with the bot Credentials *EncryptedCredentials `json:"credentials"` // Encrypted credentials required to decrypt the data }
PassportData contains information about Telegram Passport data shared with the bot by the user.
type PassportElementError ¶ added in v0.1.0
type PassportElementError struct { Source string `json:"source"` // Error source, must be data Type string `json:"type"` // The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address” FieldName string `json:"field_name"` // Name of the data field which has the error DataHash string `json:"data_hash"` // Base64-encoded data hash Message string `json:"message"` // Error message }
PassportElementError this object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:
type PassportElementErrorDataField ¶ added in v0.1.0
type PassportElementErrorDataField struct { Source string `json:"source"` // Error source, must be data Type string `json:"type"` // The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address” FieldName string `json:"field_name"` // Name of the data field which has the error DataHash string `json:"data_hash"` // Base64-encoded data hash Message string `json:"message"` // Error message }
PassportElementErrorDataField represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
type PassportElementErrorFile ¶ added in v0.1.0
type PassportElementErrorFile struct { Source string `json:"source"` // Error source, must be file Type string `json:"type"` // The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” FileHash string `json:"file_hash"` // Base64-encoded file hash Message string `json:"message"` // Error message }
PassportElementErrorFile represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
type PassportElementErrorFiles ¶ added in v0.1.0
type PassportElementErrorFiles struct { Source string `json:"source"` // Error source, must be files Type string `json:"type"` // The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” FileHashes []string `json:"file_hashes"` // List of base64-encoded file hashes Message string `json:"message"` // Error message }
PassportElementErrorFiles represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
type PassportElementErrorFrontSide ¶ added in v0.1.0
type PassportElementErrorFrontSide struct { Source string `json:"source"` // Error source, must be front_side Type string `json:"type"` // The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” FileHash string `json:"file_hash"` // Base64-encoded hash of the file with the front side of the document Message string `json:"message"` // Error message }
PassportElementErrorFrontSide represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
type PassportElementErrorReverseSide ¶ added in v0.1.0
type PassportElementErrorReverseSide struct { Source string `json:"source"` // Error source, must be reverse_side Type string `json:"type"` // The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” FileHash string `json:"file_hash"` // Base64-encoded hash of the file with the reverse side of the document Message string `json:"message"` // Error message }
PassportElementErrorReverseSide represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
type PassportElementErrorSelfie ¶ added in v0.1.0
type PassportElementErrorSelfie struct { Source string `json:"source"` // Error source, must be selfie Type string `json:"type"` // The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” FileHash string `json:"file_hash"` // Base64-encoded hash of the file with the selfie Message string `json:"message"` // Error message }
PassportElementErrorSelfie represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
type PassportElementErrorTranslationFile ¶ added in v0.1.0
type PassportElementErrorTranslationFile struct { Source string `json:"source"` // Error source, must be translation_file Type string `json:"type"` // Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” FileHash string `json:"file_hash"` // Base64-encoded file hash Message string `json:"message"` // Error message }
PassportElementErrorTranslationFile represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
type PassportElementErrorTranslationFiles ¶ added in v0.1.0
type PassportElementErrorTranslationFiles struct { Source string `json:"source"` // Error source, must be translation_files Type string `json:"type"` // Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration” FileHashes []string `json:"file_hashes"` // List of base64-encoded file hashes Message string `json:"message"` // Error message }
PassportElementErrorTranslationFiles represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
type PassportElementErrorUnspecified ¶ added in v0.1.0
type PassportElementErrorUnspecified struct { Source string `json:"source"` // Error source, must be unspecified Type string `json:"type"` // Type of element of the user's Telegram Passport which has the issue ElementHash string `json:"element_hash"` // Base64-encoded element hash Message string `json:"message"` // Error message }
PassportElementErrorUnspecified represents an issue in an unspecified place. The error is considered resolved when new data is added.
type PassportFile ¶ added in v0.1.0
type PassportFile struct { FileID string `json:"file_id"` // Unique identifier for this file FileSize int `json:"file_size"` // File size FileDate int `json:"file_date"` // Unix time when the file was uploaded }
PassportFile represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
type PhotoSize ¶ added in v0.1.0
type PhotoSize struct { FileID string `json:"file_id"` // Unique identifier for this file Width int `json:"width"` // Photo width Height int `json:"height"` // Photo height FileSize int `json:"file_size,omitempty"` // Optional. File size }
PhotoSize represents one size of a photo or a file / sticker thumbnail.
type PinChatMessageParams ¶ added in v0.2.0
type PinChatMessageParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // IDentifier of a message to pin DisableNotification bool `json:"disable_notification,omitempty"` // Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels. }
type Poll ¶ added in v0.1.0
type Poll struct { ID string `json:"id"` // Unique poll identifier Question string `json:"question"` // Poll question, 1-255 characters Options []*PollOption `json:"options"` // List of poll options IsClosed bool `json:"is_closed"` // True, if the poll is closed }
Poll contains information about a poll.
type PollOption ¶ added in v0.1.0
type PollOption struct { Text string `json:"text"` // Option text, 1-100 characters VoterCount int `json:"voter_count"` // Number of users that voted for this option }
PollOption contains information about one answer option in a poll.
type PreCheckoutQuery ¶ added in v0.1.0
type PreCheckoutQuery struct { ID string `json:"id"` // Unique query identifier From *User `json:"from"` // User who sent the query Currency string `json:"currency"` // Three-letter ISO 4217 currency code TotalAmount int `json:"total_amount"` // 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). InvoicePayload string `json:"invoice_payload"` // Bot specified invoice payload ShippingOptionID string `json:"shipping_option_id,omitempty"` // Optional. IDentifier of the shipping option chosen by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` // Optional. Order info provided by the user }
PreCheckoutQuery contains information about an incoming pre-checkout query.
type PromoteChatMemberParams ¶ added in v0.2.0
type PromoteChatMemberParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) UserID int `json:"user_id"` // Unique identifier of the target user CanChangeInfo bool `json:"can_change_info,omitempty"` // Pass True, if the administrator can change chat title, photo and other settings CanPostMessages bool `json:"can_post_messages,omitempty"` // Pass True, if the administrator can create channel posts, channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Pass True, if the administrator can edit messages of other users and can pin messages, channels only CanDeleteMessages bool `json:"can_delete_messages,omitempty"` // Pass True, if the administrator can delete messages of other users CanInviteUsers bool `json:"can_invite_users,omitempty"` // Pass True, if the administrator can invite new users to the chat CanRestrictMembers bool `json:"can_restrict_members,omitempty"` // Pass True, if the administrator can restrict, ban or unban chat members CanPinMessages bool `json:"can_pin_messages,omitempty"` // Pass True, if the administrator can pin messages, supergroups only CanPromoteMembers bool `json:"can_promote_members,omitempty"` // Pass 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 him) }
type ReplyKeyboardMarkup ¶ added in v0.1.0
type ReplyKeyboardMarkup struct { Keyboard [][]*KeyboardButton `json:"keyboard"` // Array of button rows, each represented by an Array of KeyboardButton objects ResizeKeyboard bool `json:"resize_keyboard"` // Optional. 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. OneTimeKeyboard bool `json:"one_time_keyboard"` // Optional. 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. Selective bool `json:"selective"` // Optional. 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. }
ReplyKeyboardMarkup represents a custom keyboard with reply options (see Introduction to bots for details and examples).
type ReplyKeyboardRemove ¶ added in v0.1.0
type ReplyKeyboardRemove struct { RemoveKeyboard bool `json:"remove_keyboard"` // 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) Selective bool `json:"selective"` // Optional. 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. }
Upon receiving a message with this object, Telegram clients 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).
type RestrictChatMemberParams ¶ added in v0.2.0
type RestrictChatMemberParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) UserID int `json:"user_id"` // Unique identifier of the target user Permissions *ChatPermissions `json:"permissions"` // New user permissions UntilDate int `json:"until_date,omitempty"` // Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever }
type SendAnimationParams ¶ added in v0.3.0
type SendAnimationParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Animation interface{} `json:"animation"` // Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files » Duration int `json:"duration,omitempty"` // Duration of sent animation in seconds Width int `json:"width,omitempty"` // Animation width Height int `json:"height,omitempty"` // Animation height Thumb interface{} `json:"thumb,omitempty"` // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Animation caption (may also be used when resending animation by file_id), 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendAudioParams ¶ added in v0.3.0
type SendAudioParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Audio interface{} `json:"audio"` // Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » Caption string `json:"caption,omitempty"` // Audio caption, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. Duration int `json:"duration,omitempty"` // Duration of the audio in seconds Performer string `json:"performer,omitempty"` // Performer Title string `json:"title,omitempty"` // Track name Thumb interface{} `json:"thumb,omitempty"` // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendChatActionParams ¶ added in v0.2.0
type SendChatActionParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Action string `json:"action"` // Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes. }
type SendContactParams ¶ added in v0.3.0
type SendContactParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Contact's last name Vcard string `json:"vcard,omitempty"` // Additional data about the contact in the form of a vCard, 0-2048 bytes DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. }
type SendDocumentParams ¶ added in v0.3.0
type SendDocumentParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Document interface{} `json:"document"` // File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » Thumb interface{} `json:"thumb,omitempty"` // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Document caption (may also be used when resending documents by file_id), 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendGameParams ¶ added in v0.3.0
type SendGameParams struct { ChatID int64 `json:"chat_id"` // Unique identifier for the target chat GameShortName string `json:"game_short_name"` // Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If not empty, the first button must launch the game. }
type SendInvoiceParams ¶ added in v0.3.0
type SendInvoiceParams struct { ChatID int64 `json:"chat_id"` // Unique identifier for the target private chat Title string `json:"title"` // Product name, 1-32 characters Description string `json:"description"` // Product description, 1-255 characters Payload string `json:"payload"` // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. ProviderToken string `json:"provider_token"` // Payments provider token, obtained via Botfather StartParameter string `json:"start_parameter"` // Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter Currency string `json:"currency"` // Three-letter ISO 4217 currency code, see more on currencies Prices *[]LabeledPrice `json:"prices"` // Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) ProviderData string `json:"provider_data,omitempty"` // JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. PhotoURL string `json:"photo_url,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. PhotoSize int `json:"photo_size,omitempty"` // Photo size PhotoWidth int `json:"photo_width,omitempty"` // Photo width PhotoHeight int `json:"photo_height,omitempty"` // Photo height NeedName bool `json:"need_name,omitempty"` // Pass True, if you require the user's full name to complete the order NeedPhoneNumber bool `json:"need_phone_number,omitempty"` // Pass True, if you require the user's phone number to complete the order NeedEmail bool `json:"need_email,omitempty"` // Pass True, if you require the user's email address to complete the order NeedShippingAddress bool `json:"need_shipping_address,omitempty"` // Pass True, if you require the user's shipping address to complete the order SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` // Pass True, if user's phone number should be sent to provider SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` // Pass True, if user's email address should be sent to provider IsFlexible bool `json:"is_flexible,omitempty"` // Pass True, if the final price depends on the shipping method DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. }
type SendLocationParams ¶ added in v0.3.0
type SendLocationParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Latitude float64 `json:"latitude"` // Latitude of the location Longitude float64 `json:"longitude"` // Longitude of the location LivePeriod int `json:"live_period,omitempty"` // Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendMediaGroupParams ¶ added in v0.2.0
type SendMediaGroupParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Media []interface{} `json:"media"` // A JSON-serialized array describing photos and videos to be sent, must include 2–10 items DisableNotification bool `json:"disable_notification,omitempty"` // Sends the messages silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the messages are a reply, ID of the original message }
SendMediaGroupParams is a representation of request parameters for SendMediaGroup
type SendMessageParams ¶ added in v0.2.0
type SendMessageParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Text string `json:"text"` // Text of the message to be sent ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` // Disables link previews for links in this message DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendPhotoParams ¶ added in v0.2.0
type SendPhotoParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Photo interface{} `json:"photo"` // Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. More info on Sending Files » Caption string `json:"caption,omitempty"` // Photo caption (may also be used when resending photos by file_id), 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
SendPhotoParams is a representation of request parameters for SendPhoto
type SendPollParams ¶ added in v0.3.0
type SendPollParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername). A native poll can't be sent to a private chat. Question string `json:"question"` // Poll question, 1-255 characters Options []string `json:"options"` // List of answer options, 2-10 strings 1-100 characters each DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendStickerParams ¶ added in v0.3.0
type SendStickerParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Sticker interface{} `json:"sticker"` // Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .webp file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendVenueParams ¶ added in v0.3.0
type SendVenueParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Latitude float64 `json:"latitude"` // Latitude of the venue Longitude float64 `json:"longitude"` // Longitude of the venue Title string `json:"title"` // Name of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Foursquare identifier of the venue FoursquareType string `json:"foursquare_type,omitempty"` // Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendVideoNoteParams ¶ added in v0.3.0
type SendVideoNoteParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) VideoNote interface{} `json:"video_note"` // Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is currently unsupported Duration int `json:"duration,omitempty"` // Duration of sent video in seconds Length int `json:"length,omitempty"` // Video width and height, i.e. diameter of the video message Thumb interface{} `json:"thumb,omitempty"` // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendVideoParams ¶ added in v0.3.0
type SendVideoParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Video interface{} `json:"video"` // Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More info on Sending Files » Duration int `json:"duration,omitempty"` // Duration of sent video in seconds Width int `json:"width,omitempty"` // Video width Height int `json:"height,omitempty"` // Video height Thumb interface{} `json:"thumb,omitempty"` // Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » Caption string `json:"caption,omitempty"` // Video caption (may also be used when resending videos by file_id), 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. SupportsStreaming bool `json:"supports_streaming,omitempty"` // Pass True, if the uploaded video is suitable for streaming DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SendVoiceParams ¶ added in v0.3.0
type SendVoiceParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Voice interface{} `json:"voice"` // Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » Caption string `json:"caption,omitempty"` // Voice message caption, 0-1024 characters ParseMode string `json:"parse_mode,omitempty"` // Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. Duration int `json:"duration,omitempty"` // Duration of the voice message in seconds DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ReplyToMessageID int `json:"reply_to_message_id,omitempty"` // If the message is a reply, ID of the original message ReplyMarkup interface{} `json:"reply_markup,omitempty"` // Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. }
type SetChatDescriptionParams ¶ added in v0.2.0
type SetChatDescriptionParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Description string `json:"description"` // New chat description, 0-255 characters }
type SetChatPermissionsParams ¶ added in v0.2.0
type SetChatPermissionsParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) Permissions *ChatPermissions `json:"permissions"` // New default chat permissions }
type SetChatPhotoParams ¶ added in v0.2.0
type SetChatStickerSetParams ¶ added in v0.2.0
type SetChatStickerSetParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) StickerSetName string `json:"sticker_set_name"` // Name of the sticker set to be set as the group sticker set }
type SetChatTitleParams ¶ added in v0.2.0
type SetChatTitleParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Title string `json:"title"` // New chat title, 1-255 characters }
type SetGameScoreParams ¶ added in v0.3.0
type SetGameScoreParams struct { UserID int `json:"user_id"` // User identifier Score int `json:"score"` // New score, must be non-negative Force bool `json:"force,omitempty"` // Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters DisableEditMessage bool `json:"disable_edit_message,omitempty"` // Pass True, if the game message should not be automatically edited to include the current scoreboard ChatID int64 `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the sent message InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message }
type SetPassportDataErrorsParams ¶ added in v0.3.0
type SetPassportDataErrorsParams struct { UserID int `json:"user_id"` // User identifier Errors *[]PassportElementError `json:"errors"` // A JSON-serialized array describing the errors }
type SetStickerPositionInSetParams ¶ added in v0.3.0
type SetWebhookParams ¶ added in v0.2.0
type SetWebhookParams struct { URL string `json:"url"` // HTTPS url to send updates to. Use an empty string to remove webhook integration Certificate *os.File `json:"-"` // Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details. MaxConnections int `json:"max_connections,omitempty"` // Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot‘s server, and higher values to increase your bot’s throughput. AllowedUpdates []string `json:"allowed_updates,omitempty"` // List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. }
type ShippingAddress ¶ added in v0.1.0
type ShippingAddress struct { CountryCode string `json:"country_code"` // ISO 3166-1 alpha-2 country code State string `json:"state"` // State, if applicable City string `json:"city"` // City StreetLine1 string `json:"street_line1"` // First line for the address StreetLine2 string `json:"street_line2"` // Second line for the address PostCode string `json:"post_code"` // Address post code }
ShippingAddress represents a shipping address.
type ShippingOption ¶ added in v0.1.0
type ShippingOption struct { ID string `json:"id"` // Shipping option identifier Title string `json:"title"` // Option title Prices []*LabeledPrice `json:"prices"` // List of price portions }
ShippingOption represents one shipping option.
type ShippingQuery ¶ added in v0.1.0
type ShippingQuery struct { ID string `json:"id"` // Unique query identifier From *User `json:"from"` // User who sent the query InvoicePayload string `json:"invoice_payload"` // Bot specified invoice payload ShippingAddress *ShippingAddress `json:"shipping_address"` // User specified shipping address }
ShippingQuery contains information about an incoming shipping query.
type Sticker ¶ added in v0.1.0
type Sticker struct { FileID string `json:"file_id"` // Unique identifier for this file Width int `json:"width"` // Sticker width Height int `json:"height"` // Sticker height IsAnimated bool `json:"is_animated"` // True, if the sticker is animated Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Sticker thumbnail in the .webp or .jpg format Emoji string `json:"emoji,omitempty"` // Optional. Emoji associated with the sticker SetName string `json:"set_name,omitempty"` // Optional. Name of the sticker set to which the sticker belongs MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Optional. For mask stickers, the position where the mask should be placed FileSize int `json:"file_size,omitempty"` // Optional. File size }
Sticker represents a sticker.
type StickerSet ¶ added in v0.1.0
type StickerSet struct { Name string `json:"name"` // Sticker set name Title string `json:"title"` // Sticker set title IsAnimated bool `json:"is_animated"` // True, if the sticker set contains animated stickers ContainsMasks bool `json:"contains_masks"` // True, if the sticker set contains masks Stickers []*Sticker `json:"stickers"` // List of all set stickers }
StickerSet represents a sticker set.
type StopMessageLiveLocationParams ¶ added in v0.3.0
type StopMessageLiveLocationParams struct { ChatID interface{} `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. IDentifier of the message with live location to stop InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. IDentifier of the inline message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new inline keyboard. }
type StopPollParams ¶ added in v0.3.0
type StopPollParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // IDentifier of the original message with the poll ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new message inline keyboard. }
type SuccessfulPayment ¶ added in v0.1.0
type SuccessfulPayment struct { Currency string `json:"currency"` // Three-letter ISO 4217 currency code TotalAmount int `json:"total_amount"` // 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). InvoicePayload string `json:"invoice_payload"` // Bot specified invoice payload ShippingOptionID string `json:"shipping_option_id,omitempty"` // Optional. IDentifier of the shipping option chosen by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` // Optional. Order info provided by the user TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Telegram payment identifier ProviderPaymentChargeID string `json:"provider_payment_charge_id"` // Provider payment identifier }
SuccessfulPayment contains basic information about a successful payment.
type UnbanChatMemberParams ¶ added in v0.2.0
type UnbanChatMemberParams struct { ChatID interface{} `json:"chat_id"` // Unique identifier for the target group or username of the target supergroup or channel (in the format @username) UserID int `json:"user_id"` // Unique identifier of the target user }
type UnpinChatMessageParams ¶ added in v0.2.0
type UnpinChatMessageParams struct {
ChatID interface{} `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
type Update ¶ added in v0.1.0
type Update struct { UpdateID int `json:"update_id"` // 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. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. Message *Message `json:"message,omitempty"` // Optional. New incoming message of any kind — text, photo, sticker, etc. EditedMessage *Message `json:"edited_message,omitempty"` // Optional. New version of a message that is known to the bot and was edited ChannelPost *Message `json:"channel_post,omitempty"` // Optional. New incoming channel post of any kind — text, photo, sticker, etc. EditedChannelPost *Message `json:"edited_channel_post,omitempty"` // Optional. New version of a channel post that is known to the bot and was edited InlineQuery *InlineQuery `json:"inline_query,omitempty"` // Optional. New incoming inline query ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` // Optional. New incoming callback query ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // Optional. New incoming shipping query. Only for invoices with flexible price PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Optional. New incoming pre-checkout query. Contains full information about checkout Poll *Poll `json:"poll,omitempty"` // Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot }
Update represents an incoming update.At most one of the optional parameters can be present in any given update.
type UploadStickerFileParams ¶ added in v0.3.0
type UploadStickerFileParams struct { UserID int `json:"user_id"` // User identifier of sticker file owner PngSticker *os.File `json:"-"` // Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More info on Sending Files » }
type User ¶ added in v0.1.0
type User struct { ID int `json:"id"` // Unique identifier for this user or bot IsBot bool `json:"is_bot"` // True, if this user is a bot FirstName string `json:"first_name"` // User‘s or bot’s first name LastName string `json:"last_name,omitempty"` // Optional. User‘s or bot’s last name Username string `json:"username,omitempty"` // Optional. User‘s or bot’s username LanguageCode string `json:"language_code,omitempty"` // Optional. IETF language tag of the user's language }
User represents a Telegram user or bot.
type UserProfilePhotos ¶ added in v0.1.0
type UserProfilePhotos struct { TotalCount int `json:"total_count"` // Total number of profile pictures the target user has Photos [][]*PhotoSize `json:"photos"` // Requested profile pictures (in up to 4 sizes each) }
UserProfilePhotos represent a user's profile pictures.
type Venue ¶ added in v0.1.0
type Venue struct { Location *Location `json:"location"` // Venue location Title string `json:"title"` // Name of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) }
Venue represents a venue.
type Video ¶ added in v0.1.0
type Video struct { FileID string `json:"file_id"` // Unique identifier for this file Width int `json:"width"` // Video width as defined by sender Height int `json:"height"` // Video height as defined by sender Duration int `json:"duration"` // Duration of the video in seconds as defined by sender Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Video thumbnail MimeType string `json:"mime_type,omitempty"` // Optional. Mime type of a file as defined by sender FileSize int `json:"file_size,omitempty"` // Optional. File size }
Video represents a video file.
type VideoNote ¶ added in v0.1.0
type VideoNote struct { FileID string `json:"file_id"` // Unique identifier for this file Length int `json:"length"` // Video width and height (diameter of the video message) as defined by sender Duration int `json:"duration"` // Duration of the video in seconds as defined by sender Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Video thumbnail FileSize int `json:"file_size,omitempty"` // Optional. File size }
VideoNote represents a video message (available in Telegram apps as of v.4.0).
type Voice ¶ added in v0.1.0
type Voice struct { FileID string `json:"file_id"` // Unique identifier for this file Duration int `json:"duration"` // Duration of the audio in seconds as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by sender FileSize int `json:"file_size,omitempty"` // Optional. File size }
Voice represents a voice note.
type WebhookInfo ¶ added in v0.1.0
type WebhookInfo struct { URL string `json:"url"` // Webhook URL, may be empty if webhook is not set up HasCustomCertificate bool `json:"has_custom_certificate"` // True, if a custom certificate was provided for webhook certificate checks PendingUpdateCount int `json:"pending_update_count"` // Number of updates awaiting delivery LastErrorDate int `json:"last_error_date,omitempty"` // Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook LastErrorMessage string `json:"last_error_message,omitempty"` // Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook MaxConnections int `json:"max_connections,omitempty"` // Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery AllowedUpdates []string `json:"allowed_updates,omitempty"` // Optional. A list of update types the bot is subscribed to. Defaults to all update types }
WebhookInfo contains information about the current status of a webhook.
Source Files ¶
- add_sticker_to_set.go
- animation.go
- answer_callback_query.go
- answer_inline_query.go
- answer_pre_checkout_query.go
- answer_shipping_query.go
- audio.go
- callback_game.go
- callback_query.go
- chat.go
- chat_member.go
- chat_permissions.go
- chat_photo.go
- chosen_inline_result.go
- client.go
- contact.go
- create_new_sticker_set.go
- delete_chat_photo.go
- delete_chat_sticker_set.go
- delete_message.go
- delete_sticker_from_set.go
- delete_webhook.go
- document.go
- edit_message_caption.go
- edit_message_live_location.go
- edit_message_media.go
- edit_message_reply_markup.go
- edit_message_text.go
- encrypted_credentials.go
- encrypted_passport_element.go
- export_chat_invite_link.go
- file.go
- force_reply.go
- forward_message.go
- game.go
- game_high_score.go
- get_chat.go
- get_chat_administrators.go
- get_chat_member.go
- get_chat_members_count.go
- get_file.go
- get_game_high_scores.go
- get_me.go
- get_sticker_set.go
- get_updates.go
- get_user_profile_photos.go
- get_webhook_info.go
- helpers.go
- inline_keyboard_button.go
- inline_keyboard_markup.go
- inline_query.go
- inline_query_result.go
- inline_query_result_article.go
- inline_query_result_audio.go
- inline_query_result_cached_audio.go
- inline_query_result_cached_document.go
- inline_query_result_cached_gif.go
- inline_query_result_cached_mpeg4_gif.go
- inline_query_result_cached_photo.go
- inline_query_result_cached_sticker.go
- inline_query_result_cached_video.go
- inline_query_result_cached_voice.go
- inline_query_result_contact.go
- inline_query_result_document.go
- inline_query_result_game.go
- inline_query_result_gif.go
- inline_query_result_location.go
- inline_query_result_mpeg4_gif.go
- inline_query_result_photo.go
- inline_query_result_venue.go
- inline_query_result_video.go
- inline_query_result_voice.go
- input_contact_message_content.go
- input_location_message_content.go
- input_media_animation.go
- input_media_audio.go
- input_media_document.go
- input_media_photo.go
- input_media_video.go
- input_message_content.go
- input_text_message_content.go
- input_venue_message_content.go
- invoice.go
- keyboard_button.go
- kick_chat_member.go
- labeled_price.go
- leave_chat.go
- location.go
- login_url.go
- mask_position.go
- message.go
- message_entity.go
- order_info.go
- passport_data.go
- passport_element_error.go
- passport_element_error_data_field.go
- passport_element_error_file.go
- passport_element_error_files.go
- passport_element_error_front_side.go
- passport_element_error_reverse_side.go
- passport_element_error_selfie.go
- passport_element_error_translation_file.go
- passport_element_error_translation_files.go
- passport_element_error_unspecified.go
- passport_file.go
- photo_size.go
- pin_chat_message.go
- poll.go
- poll_option.go
- pre_checkout_query.go
- promote_chat_member.go
- reply_keyboard_markup.go
- reply_keyboard_remove.go
- response.go
- restrict_chat_member.go
- send_animation.go
- send_audio.go
- send_chat_action.go
- send_contact.go
- send_document.go
- send_game.go
- send_invoice.go
- send_location.go
- send_media_group.go
- send_message.go
- send_photo.go
- send_poll.go
- send_sticker.go
- send_venue.go
- send_video.go
- send_video_note.go
- send_voice.go
- set_chat_description.go
- set_chat_permissions.go
- set_chat_photo.go
- set_chat_sticker_set.go
- set_chat_title.go
- set_game_score.go
- set_passport_data_errors.go
- set_sticker_position_in_set.go
- set_webhook.go
- shipping_address.go
- shipping_option.go
- shipping_query.go
- sticker.go
- sticker_set.go
- stop_message_live_location.go
- stop_poll.go
- successful_payment.go
- unban_chat_member.go
- unpin_chat_message.go
- update.go
- upload_sticker_file.go
- user.go
- user_profile_photos.go
- venue.go
- video.go
- video_note.go
- voice.go
- webhook_info.go