Documentation ¶
Index ¶
- Constants
- type Animation
- type Audio
- type BotCommand
- type BotCommandScope
- type BotCommandScopeAllChatAdministrators
- type BotCommandScopeAllGroupChats
- type BotCommandScopeAllPrivateChats
- type BotCommandScopeChat
- type BotCommandScopeChatAdministrators
- type BotCommandScopeChatMember
- type BotCommandScopeDefault
- type CallbackGame
- type CallbackQuery
- type Chat
- type ChatAdministratorRights
- type ChatInviteLink
- type ChatJoinRequest
- type ChatLocation
- type ChatMember
- type ChatMemberUpdated
- type ChatPermissions
- type ChatPhoto
- type ChosenInlineResult
- type Contact
- type Dice
- type Document
- type EncryptedCredentials
- type EncryptedPassportElement
- type File
- type ForceReply
- type Game
- type GameHighScore
- 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 InputFile
- type InputInvoiceMessageContent
- type InputLocationMessageContent
- type InputMedia
- type InputMediaAnimation
- type InputMediaAudio
- type InputMediaDocument
- type InputMediaPhoto
- type InputMediaVideo
- type InputMessageContent
- type InputPath
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type KeyboardButton
- type KeyboardButtonPollType
- type LabeledPrice
- type Location
- type LoginUrl
- type MaskPosition
- type MenuButton
- type MenuButtonCommands
- type MenuButtonDefault
- type MenuButtonWebApp
- type Message
- type MessageAutoDeleteTimerChanged
- type MessageEntity
- type MessageId
- 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 Poll
- type PollAnswer
- type PollOption
- type PreCheckoutQuery
- type ProximityAlertTriggered
- type ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type ResponseParameters
- type SentWebAppMessage
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type Sticker
- type StickerSet
- type SuccessfulPayment
- type Update
- type User
- type UserProfilePhotos
- type Venue
- type Video
- type VideoChatEnded
- type VideoChatParticipantsInvited
- type VideoChatScheduled
- type VideoChatStarted
- type VideoNote
- type Voice
- type WebAppData
- type WebAppInfo
- type WebhookInfo
Constants ¶
const ( TypeChatMemberOwner = iota TypeChatMemberAdministrator TypeChatMemberMember TypeChatMemberRestricted TypeChatMemberLeft TypeChatMemberBanned )
CHAT_MEMBER
const ( TypeArrayOfBotCommand = iota TypeArrayOfChatMember TypeArrayOfGameHighScore TypeArrayOfMessage TypeArrayOfUpdate TypeBoolean TypeChat TypeChatAdministratorRights TypeChatInviteLink TypeChatMember TypeFile TypeInteger TypeMenuButton TypeMessage TypeMessageId TypePoll TypeSentWebAppMessage TypeStickerSet TypeString TypeUser TypeUserProfilePhotos TypeWebhookInfo )
RETURN_TYPES
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct { Duration int `json:"duration"` FileID string `json:"file_id"` FileName string `json:"file_name,omitempty"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` Height int `json:"height"` MimeType string `json:"mime_type,omitempty"` Thumb *PhotoSize `json:"thumb,omitempty"` Width int64 `json:"width"` }
Animation Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
type Audio ¶
type Audio struct { Duration int `json:"duration"` FileID string `json:"file_id"` FileName string `json:"file_name,omitempty"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` MimeType string `json:"mime_type,omitempty"` Performer string `json:"performer,omitempty"` Thumb *PhotoSize `json:"thumb,omitempty"` Title string `json:"title,omitempty"` }
Audio Represents an audio file to be treated as music by the Telegram clients.
type BotCommand ¶
BotCommand Represents a bot command.
type BotCommandScope ¶
type BotCommandScope interface{}
BotCommandScope Represents the scope to which bot commands are applied Currently, the following 7 scopes are supported:
- BotCommandScopeDefault
- BotCommandScopeAllPrivateChats
- BotCommandScopeAllGroupChats
- BotCommandScopeAllChatAdministrators
- BotCommandScopeChat
- BotCommandScopeChatAdministrators
- BotCommandScopeChatMember
type BotCommandScopeAllChatAdministrators ¶
type BotCommandScopeAllChatAdministrators struct {
Type string `json:"type"`
}
BotCommandScopeAllChatAdministrators Represents the scope of bot commands, covering all group and supergroup chat administrators.
type BotCommandScopeAllGroupChats ¶
type BotCommandScopeAllGroupChats struct {
Type string `json:"type"`
}
BotCommandScopeAllGroupChats Represents the scope of bot commands, covering all group and supergroup chats.
type BotCommandScopeAllPrivateChats ¶
type BotCommandScopeAllPrivateChats struct {
Type string `json:"type"`
}
BotCommandScopeAllPrivateChats Represents the scope of bot commands, covering all private chats.
type BotCommandScopeChat ¶
BotCommandScopeChat Represents the scope of bot commands, covering a specific chat.
type BotCommandScopeChatAdministrators ¶
type BotCommandScopeChatAdministrators struct { ChatID int64 `json:"chat_id"` Type string `json:"type"` }
BotCommandScopeChatAdministrators Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
type BotCommandScopeChatMember ¶
type BotCommandScopeChatMember struct { ChatID int64 `json:"chat_id"` Type string `json:"type"` UserID int64 `json:"user_id"` }
BotCommandScopeChatMember Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
type BotCommandScopeDefault ¶
type BotCommandScopeDefault struct {
Type string `json:"type"`
}
BotCommandScopeDefault Represents the default scope of bot commands Default commands are used if no commands with a narrower scope are specified for the user.
type CallbackGame ¶
type CallbackGame interface{}
CallbackGame A placeholder, currently holds no information Use BotFather to set up your game.
type CallbackQuery ¶
type CallbackQuery struct { ChatInstance string `json:"chat_instance"` Data string `json:"data,omitempty"` From User `json:"from"` GameShortName string `json:"game_short_name,omitempty"` ID string `json:"id"` InlineMessageID string `json:"inline_message_id,omitempty"` Message *Message `json:"message,omitempty"` }
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 ¶
type Chat struct { Bio string `json:"bio,omitempty"` CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` Description string `json:"description,omitempty"` FirstName string `json:"first_name,omitempty"` HasPrivateForwards bool `json:"has_private_forwards,omitempty"` HasProtectedContent bool `json:"has_protected_content,omitempty"` ID int64 `json:"id"` InviteLink string `json:"invite_link,omitempty"` LastName string `json:"last_name,omitempty"` LinkedChatID int64 `json:"linked_chat_id,omitempty"` Location *ChatLocation `json:"location,omitempty"` MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"` Permissions *ChatPermissions `json:"permissions,omitempty"` Photo *ChatPhoto `json:"photo,omitempty"` PinnedMessage *Message `json:"pinned_message,omitempty"` SlowModeDelay int `json:"slow_mode_delay,omitempty"` StickerSetName string `json:"sticker_set_name,omitempty"` Title string `json:"title,omitempty"` Type string `json:"type"` Username string `json:"username,omitempty"` }
Chat Represents a chat.
type ChatAdministratorRights ¶
type ChatAdministratorRights struct { CanChangeInfo bool `json:"can_change_info"` CanDeleteMessages bool `json:"can_delete_messages"` CanEditMessages bool `json:"can_edit_messages,omitempty"` CanInviteUsers bool `json:"can_invite_users"` CanManageChat bool `json:"can_manage_chat"` CanManageVideoChats bool `json:"can_manage_video_chats"` CanPinMessages bool `json:"can_pin_messages,omitempty"` CanPostMessages bool `json:"can_post_messages,omitempty"` CanPromoteMembers bool `json:"can_promote_members"` CanRestrictMembers bool `json:"can_restrict_members"` IsAnonymous bool `json:"is_anonymous"` }
ChatAdministratorRights Represents the rights of an administrator in a chat.
type ChatInviteLink ¶
type ChatInviteLink struct { CreatesJoinRequest bool `json:"creates_join_request"` Creator User `json:"creator"` ExpireDate int64 `json:"expire_date,omitempty"` InviteLink string `json:"invite_link"` IsPrimary bool `json:"is_primary"` IsRevoked bool `json:"is_revoked"` MemberLimit int `json:"member_limit,omitempty"` Name string `json:"name,omitempty"` PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"` }
ChatInviteLink Represents an invite link for a chat.
type ChatJoinRequest ¶
type ChatJoinRequest struct { Bio string `json:"bio,omitempty"` Chat Chat `json:"chat"` Date int64 `json:"date"` From User `json:"from"` InviteLink *ChatInviteLink `json:"invite_link,omitempty"` }
ChatJoinRequest Represents a join request sent to a chat.
type ChatLocation ¶
ChatLocation Represents a location to which a chat is connected.
type ChatMember ¶
type ChatMember struct { CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` CanBeEdited bool `json:"can_be_edited"` CanChangeInfo bool `json:"can_change_info"` CanDeleteMessages bool `json:"can_delete_messages"` CanEditMessages bool `json:"can_edit_messages"` CanInviteUsers bool `json:"can_invite_users"` CanManageChat bool `json:"can_manage_chat"` CanManageVideoChats bool `json:"can_manage_video_chats"` CanPinMessages bool `json:"can_pin_messages"` CanPostMessages bool `json:"can_post_messages"` CanPromoteMembers bool `json:"can_promote_members"` CanRestrictMembers bool `json:"can_restrict_members"` CanSendMediaMessages bool `json:"can_send_media_messages"` CanSendMessages bool `json:"can_send_messages"` CanSendOtherMessages bool `json:"can_send_other_messages"` CanSendPolls bool `json:"can_send_polls"` CustomTitle string `json:"custom_title"` IsAnonymous bool `json:"is_anonymous"` IsMember bool `json:"is_member"` Status string `json:"status"` UntilDate int64 `json:"until_date"` User User `json:"user"` }
ChatMember This object contains information about one member of a chat Currently, the following 6 types of chat members are supported:
- ChatMemberOwner
- ChatMemberAdministrator
- ChatMemberMember
- ChatMemberRestricted
- ChatMemberLeft
- ChatMemberBanned
func (ChatMember) Kind ¶
func (x ChatMember) Kind() int
type ChatMemberUpdated ¶
type ChatMemberUpdated struct { Chat Chat `json:"chat"` Date int64 `json:"date"` From User `json:"from"` InviteLink *ChatInviteLink `json:"invite_link,omitempty"` NewChatMember ChatMember `json:"new_chat_member"` OldChatMember ChatMember `json:"old_chat_member"` }
ChatMemberUpdated Represents changes in the status of a chat member.
type ChatPermissions ¶
type ChatPermissions struct { CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` CanChangeInfo bool `json:"can_change_info,omitempty"` CanInviteUsers bool `json:"can_invite_users,omitempty"` CanPinMessages bool `json:"can_pin_messages,omitempty"` CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` CanSendMessages bool `json:"can_send_messages,omitempty"` CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` CanSendPolls bool `json:"can_send_polls,omitempty"` }
ChatPermissions Describes actions that a non-administrator user is allowed to take in a chat.
type ChatPhoto ¶
type ChatPhoto struct { BigFileID string `json:"big_file_id"` BigFileUniqueID string `json:"big_file_unique_id"` SmallFileID string `json:"small_file_id"` SmallFileUniqueID string `json:"small_file_unique_id"` }
ChatPhoto Represents a chat photo.
type ChosenInlineResult ¶
type ChosenInlineResult struct { From User `json:"from"` InlineMessageID string `json:"inline_message_id,omitempty"` Location *Location `json:"location,omitempty"` Query string `json:"query"` ResultID string `json:"result_id"` }
ChosenInlineResult Represents a result of an inline query that was chosen by the user and sent to their chat partner. Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.
type Contact ¶
type Contact struct { FirstName string `json:"first_name"` LastName string `json:"last_name,omitempty"` PhoneNumber string `json:"phone_number"` UserID int64 `json:"user_id,omitempty"` Vcard string `json:"vcard,omitempty"` }
Contact Represents a phone contact.
type Document ¶
type Document struct { FileID string `json:"file_id"` FileName string `json:"file_name,omitempty"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` MimeType string `json:"mime_type,omitempty"` Thumb *PhotoSize `json:"thumb,omitempty"` }
Document Represents a general file (as opposed to photos, voice messages and audio files).
type EncryptedCredentials ¶
type EncryptedCredentials struct { Data string `json:"data"` Hash string `json:"hash"` Secret string `json:"secret"` }
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 ¶
type EncryptedPassportElement struct { Data string `json:"data,omitempty"` Email string `json:"email,omitempty"` Files []PassportFile `json:"files,omitempty"` FrontSide *PassportFile `json:"front_side,omitempty"` Hash string `json:"hash"` PhoneNumber string `json:"phone_number,omitempty"` ReverseSide *PassportFile `json:"reverse_side,omitempty"` Selfie *PassportFile `json:"selfie,omitempty"` Translation []PassportFile `json:"translation,omitempty"` Type string `json:"type"` }
EncryptedPassportElement Contains information about documents or other Telegram Passport elements shared with the bot by the user.
type File ¶
type File struct { FileID string `json:"file_id"` FilePath string `json:"file_path,omitempty"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` }
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 ¶
type ForceReply struct { ForceReply bool `json:"force_reply"` InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` Selective bool `json:"selective,omitempty"` }
ForceReply 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 Game ¶
type Game struct { Animation *Animation `json:"animation,omitempty"` Description string `json:"description"` Photo []PhotoSize `json:"photo,omitempty"` Text string `json:"text,omitempty"` TextEntities []MessageEntity `json:"text_entities,omitempty"` Title string `json:"title"` }
Game Represents a game Use BotFather to create and edit games, their short names will act as unique identifiers.
type GameHighScore ¶
type GameHighScore struct { Position int `json:"position"` Score int `json:"score"` User User `json:"user"` }
GameHighScore Represents one row of the high scores table for a game.
type InlineKeyboardButton ¶
type InlineKeyboardButton struct { CallbackData string `json:"callback_data,omitempty"` CallbackGame *CallbackGame `json:"callback_game,omitempty"` LoginURL *LoginUrl `json:"login_url,omitempty"` Pay bool `json:"pay,omitempty"` SwitchInlineQuery string `json:"switch_inline_query,omitempty"` SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"` Text string `json:"text"` URL string `json:"url,omitempty"` WebApp *WebAppInfo `json:"web_app,omitempty"` }
InlineKeyboardButton Represents one button of an inline keyboard You must use exactly one of the optional fields.
type InlineKeyboardMarkup ¶
type InlineKeyboardMarkup struct {
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard,omitempty"`
}
InlineKeyboardMarkup Represents an inline keyboard that appears right next to the message it belongs to. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will display unsupported message.
type InlineQuery ¶
type InlineQuery struct { ChatType string `json:"chat_type,omitempty"` From User `json:"from"` ID string `json:"id"` Location *Location `json:"location,omitempty"` Offset string `json:"offset"` Query string `json:"query"` }
InlineQuery Represents an incoming inline query When the user sends an empty query, your bot could return some default or trending results.
type InlineQueryResult ¶
type InlineQueryResult interface{}
InlineQueryResult Represents one result of an inline query Telegram clients currently support results of the following 20 types:
- InlineQueryResultCachedAudio
- InlineQueryResultCachedDocument
- InlineQueryResultCachedGif
- InlineQueryResultCachedMpeg4Gif
- InlineQueryResultCachedPhoto
- InlineQueryResultCachedSticker
- InlineQueryResultCachedVideo
- InlineQueryResultCachedVoice
- InlineQueryResultArticle
- InlineQueryResultAudio
- InlineQueryResultContact
- InlineQueryResultGame
- InlineQueryResultDocument
- InlineQueryResultGif
- InlineQueryResultLocation
- InlineQueryResultMpeg4Gif
- InlineQueryResultPhoto
- InlineQueryResultVenue
- InlineQueryResultVideo
- InlineQueryResultVoice
Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.
type InlineQueryResultArticle ¶
type InlineQueryResultArticle struct { Description string `json:"description,omitempty"` HideURL bool `json:"hide_url,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbHeight int `json:"thumb_height,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` ThumbWidth int64 `json:"thumb_width,omitempty"` Title string `json:"title"` URL string `json:"url,omitempty"` }
InlineQueryResultArticle Represents a link to an article or web page.
func (InlineQueryResultArticle) MarshalJSON ¶
func (entity InlineQueryResultArticle) MarshalJSON() ([]byte, error)
type InlineQueryResultAudio ¶
type InlineQueryResultAudio struct { AudioDuration int `json:"audio_duration,omitempty"` AudioURL string `json:"audio_url"` Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` Performer string `json:"performer,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultAudio) MarshalJSON ¶
func (entity InlineQueryResultAudio) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedAudio ¶
type InlineQueryResultCachedAudio struct { AudioFileID string `json:"audio_file_id"` Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultCachedAudio) MarshalJSON ¶
func (entity InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedDocument ¶
type InlineQueryResultCachedDocument struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Description string `json:"description,omitempty"` DocumentFileID string `json:"document_file_id"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultCachedDocument) MarshalJSON ¶
func (entity InlineQueryResultCachedDocument) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedGif ¶
type InlineQueryResultCachedGif struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` GifFileID string `json:"gif_file_id"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title,omitempty"` }
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.
func (InlineQueryResultCachedGif) MarshalJSON ¶
func (entity InlineQueryResultCachedGif) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedMpeg4Gif ¶
type InlineQueryResultCachedMpeg4Gif struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` Mpeg4FileID string `json:"mpeg4_file_id"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title,omitempty"` }
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.
func (InlineQueryResultCachedMpeg4Gif) MarshalJSON ¶
func (entity InlineQueryResultCachedMpeg4Gif) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedPhoto ¶
type InlineQueryResultCachedPhoto struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Description string `json:"description,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` PhotoFileID string `json:"photo_file_id"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title,omitempty"` }
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.
func (InlineQueryResultCachedPhoto) MarshalJSON ¶
func (entity InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedSticker ¶
type InlineQueryResultCachedSticker struct { ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` StickerFileID string `json:"sticker_file_id"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers Older clients will ignore them.
func (InlineQueryResultCachedSticker) MarshalJSON ¶
func (entity InlineQueryResultCachedSticker) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedVideo ¶
type InlineQueryResultCachedVideo struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Description string `json:"description,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title"` VideoFileID string `json:"video_file_id"` }
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.
func (InlineQueryResultCachedVideo) MarshalJSON ¶
func (entity InlineQueryResultCachedVideo) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedVoice ¶
type InlineQueryResultCachedVoice struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title"` VoiceFileID string `json:"voice_file_id"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultCachedVoice) MarshalJSON ¶
func (entity InlineQueryResultCachedVoice) MarshalJSON() ([]byte, error)
type InlineQueryResultContact ¶
type InlineQueryResultContact struct { FirstName string `json:"first_name"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` LastName string `json:"last_name,omitempty"` PhoneNumber string `json:"phone_number"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbHeight int `json:"thumb_height,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` ThumbWidth int64 `json:"thumb_width,omitempty"` Vcard string `json:"vcard,omitempty"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultContact) MarshalJSON ¶
func (entity InlineQueryResultContact) MarshalJSON() ([]byte, error)
type InlineQueryResultDocument ¶
type InlineQueryResultDocument struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Description string `json:"description,omitempty"` DocumentURL string `json:"document_url"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` MimeType string `json:"mime_type"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbHeight int `json:"thumb_height,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` ThumbWidth int64 `json:"thumb_width,omitempty"` Title string `json:"title"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultDocument) MarshalJSON ¶
func (entity InlineQueryResultDocument) MarshalJSON() ([]byte, error)
type InlineQueryResultGame ¶
type InlineQueryResultGame struct { GameShortName string `json:"game_short_name"` ID string `json:"id"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
InlineQueryResultGame Represents a Game. Note: This will only work in Telegram versions released after October 1, 2016 Older clients will not display any inline results if a game result is among them.
func (InlineQueryResultGame) MarshalJSON ¶
func (entity InlineQueryResultGame) MarshalJSON() ([]byte, error)
type InlineQueryResultGif ¶
type InlineQueryResultGif struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` GifDuration int `json:"gif_duration,omitempty"` GifHeight int `json:"gif_height,omitempty"` GifURL string `json:"gif_url"` GifWidth int64 `json:"gif_width,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbMimeType string `json:"thumb_mime_type,omitempty"` ThumbURL string `json:"thumb_url"` Title string `json:"title,omitempty"` }
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.
func (InlineQueryResultGif) MarshalJSON ¶
func (entity InlineQueryResultGif) MarshalJSON() ([]byte, error)
type InlineQueryResultLocation ¶
type InlineQueryResultLocation struct { Heading int `json:"heading,omitempty"` HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` Latitude float64 `json:"latitude"` LivePeriod int `json:"live_period,omitempty"` Longitude float64 `json:"longitude"` ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbHeight int `json:"thumb_height,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` ThumbWidth int64 `json:"thumb_width,omitempty"` Title string `json:"title"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultLocation) MarshalJSON ¶
func (entity InlineQueryResultLocation) MarshalJSON() ([]byte, error)
type InlineQueryResultMpeg4Gif ¶
type InlineQueryResultMpeg4Gif struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` Mpeg4Duration int `json:"mpeg4_duration,omitempty"` Mpeg4Height int `json:"mpeg4_height,omitempty"` Mpeg4URL string `json:"mpeg4_url"` Mpeg4Width int64 `json:"mpeg4_width,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbMimeType string `json:"thumb_mime_type,omitempty"` ThumbURL string `json:"thumb_url"` Title string `json:"title,omitempty"` }
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.
func (InlineQueryResultMpeg4Gif) MarshalJSON ¶
func (entity InlineQueryResultMpeg4Gif) MarshalJSON() ([]byte, error)
type InlineQueryResultPhoto ¶
type InlineQueryResultPhoto struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Description string `json:"description,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` PhotoHeight int `json:"photo_height,omitempty"` PhotoURL string `json:"photo_url"` PhotoWidth int64 `json:"photo_width,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbURL string `json:"thumb_url"` Title string `json:"title,omitempty"` }
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.
func (InlineQueryResultPhoto) MarshalJSON ¶
func (entity InlineQueryResultPhoto) MarshalJSON() ([]byte, error)
type InlineQueryResultVenue ¶
type InlineQueryResultVenue struct { Address string `json:"address"` FoursquareID string `json:"foursquare_id,omitempty"` FoursquareType string `json:"foursquare_type,omitempty"` GooglePlaceID string `json:"google_place_id,omitempty"` GooglePlaceType string `json:"google_place_type,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbHeight int `json:"thumb_height,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` ThumbWidth int64 `json:"thumb_width,omitempty"` Title string `json:"title"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultVenue) MarshalJSON ¶
func (entity InlineQueryResultVenue) MarshalJSON() ([]byte, error)
type InlineQueryResultVideo ¶
type InlineQueryResultVideo struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Description string `json:"description,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` MimeType string `json:"mime_type"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ThumbURL string `json:"thumb_url"` Title string `json:"title"` VideoDuration int64 `json:"video_duration,omitempty"` VideoHeight int64 `json:"video_height,omitempty"` VideoURL string `json:"video_url"` VideoWidth int64 `json:"video_width,omitempty"` }
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.
func (InlineQueryResultVideo) MarshalJSON ¶
func (entity InlineQueryResultVideo) MarshalJSON() ([]byte, error)
type InlineQueryResultVoice ¶
type InlineQueryResultVoice struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ID string `json:"id"` InputMessageContent interface{} `json:"input_message_content,omitempty"` ParseMode string `json:"parse_mode,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` Title string `json:"title"` VoiceDuration int `json:"voice_duration,omitempty"` VoiceURL string `json:"voice_url"` }
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. Note: This will only work in Telegram versions released after 9 April, 2016 Older clients will ignore them.
func (InlineQueryResultVoice) MarshalJSON ¶
func (entity InlineQueryResultVoice) MarshalJSON() ([]byte, error)
type InputContactMessageContent ¶
type InputContactMessageContent struct { FirstName string `json:"first_name"` LastName string `json:"last_name,omitempty"` PhoneNumber string `json:"phone_number"` Vcard string `json:"vcard,omitempty"` }
InputContactMessageContent Represents the content of a contact message to be sent as the result of an inline query.
type InputInvoiceMessageContent ¶
type InputInvoiceMessageContent struct { Currency string `json:"currency"` Description string `json:"description"` IsFlexible bool `json:"is_flexible,omitempty"` MaxTipAmount int `json:"max_tip_amount,omitempty"` NeedEmail bool `json:"need_email,omitempty"` NeedName bool `json:"need_name,omitempty"` NeedPhoneNumber bool `json:"need_phone_number,omitempty"` NeedShippingAddress bool `json:"need_shipping_address,omitempty"` Payload string `json:"payload"` PhotoHeight int `json:"photo_height,omitempty"` PhotoSize int `json:"photo_size,omitempty"` PhotoURL string `json:"photo_url,omitempty"` PhotoWidth int64 `json:"photo_width,omitempty"` Prices []LabeledPrice `json:"prices,omitempty"` ProviderData string `json:"provider_data,omitempty"` ProviderToken string `json:"provider_token"` SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"` Title string `json:"title"` }
InputInvoiceMessageContent Represents the content of an invoice message to be sent as the result of an inline query.
type InputLocationMessageContent ¶
type InputLocationMessageContent struct { Heading int `json:"heading,omitempty"` HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` Latitude float64 `json:"latitude"` LivePeriod int `json:"live_period,omitempty"` Longitude float64 `json:"longitude"` ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` }
InputLocationMessageContent Represents the content of a location message to be sent as the result of an inline query.
type InputMedia ¶
type InputMediaAnimation ¶
type InputMediaAnimation struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Duration int `json:"duration,omitempty"` Height int `json:"height,omitempty"` Media rawTypes.InputFile `json:"media,omitempty"` ParseMode string `json:"parse_mode,omitempty"` Thumb rawTypes.InputFile `json:"thumb,omitempty"` Width int64 `json:"width,omitempty"` }
InputMediaAnimation Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
func (*InputMediaAnimation) Files ¶
func (entity *InputMediaAnimation) Files() map[string]rawTypes.InputFile
func (InputMediaAnimation) MarshalJSON ¶
func (entity InputMediaAnimation) MarshalJSON() ([]byte, error)
func (*InputMediaAnimation) SetAttachment ¶
func (entity *InputMediaAnimation) SetAttachment(attach string)
func (*InputMediaAnimation) SetAttachmentThumb ¶
func (entity *InputMediaAnimation) SetAttachmentThumb(attach string)
type InputMediaAudio ¶
type InputMediaAudio struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Duration int `json:"duration,omitempty"` Media rawTypes.InputFile `json:"media,omitempty"` ParseMode string `json:"parse_mode,omitempty"` Performer string `json:"performer,omitempty"` Thumb rawTypes.InputFile `json:"thumb,omitempty"` Title string `json:"title,omitempty"` }
InputMediaAudio Represents an audio file to be treated as music to be sent.
func (*InputMediaAudio) Files ¶
func (entity *InputMediaAudio) Files() map[string]rawTypes.InputFile
func (InputMediaAudio) MarshalJSON ¶
func (entity InputMediaAudio) MarshalJSON() ([]byte, error)
func (*InputMediaAudio) SetAttachment ¶
func (entity *InputMediaAudio) SetAttachment(attach string)
func (*InputMediaAudio) SetAttachmentThumb ¶
func (entity *InputMediaAudio) SetAttachmentThumb(attach string)
type InputMediaDocument ¶
type InputMediaDocument struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"` Media rawTypes.InputFile `json:"media,omitempty"` ParseMode string `json:"parse_mode,omitempty"` Thumb rawTypes.InputFile `json:"thumb,omitempty"` }
InputMediaDocument Represents a general file to be sent.
func (*InputMediaDocument) Files ¶
func (entity *InputMediaDocument) Files() map[string]rawTypes.InputFile
func (InputMediaDocument) MarshalJSON ¶
func (entity InputMediaDocument) MarshalJSON() ([]byte, error)
func (*InputMediaDocument) SetAttachment ¶
func (entity *InputMediaDocument) SetAttachment(attach string)
func (*InputMediaDocument) SetAttachmentThumb ¶
func (entity *InputMediaDocument) SetAttachmentThumb(attach string)
type InputMediaPhoto ¶
type InputMediaPhoto struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Media rawTypes.InputFile `json:"media,omitempty"` ParseMode string `json:"parse_mode,omitempty"` }
InputMediaPhoto Represents a photo to be sent.
func (*InputMediaPhoto) Files ¶
func (entity *InputMediaPhoto) Files() map[string]rawTypes.InputFile
func (InputMediaPhoto) MarshalJSON ¶
func (entity InputMediaPhoto) MarshalJSON() ([]byte, error)
func (*InputMediaPhoto) SetAttachment ¶
func (entity *InputMediaPhoto) SetAttachment(attach string)
func (*InputMediaPhoto) SetAttachmentThumb ¶
func (entity *InputMediaPhoto) SetAttachmentThumb(_ string)
type InputMediaVideo ¶
type InputMediaVideo struct { Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` Duration int `json:"duration,omitempty"` Height int `json:"height,omitempty"` Media rawTypes.InputFile `json:"media,omitempty"` ParseMode string `json:"parse_mode,omitempty"` SupportsStreaming bool `json:"supports_streaming,omitempty"` Thumb rawTypes.InputFile `json:"thumb,omitempty"` Width int64 `json:"width,omitempty"` }
InputMediaVideo Represents a video to be sent.
func (*InputMediaVideo) Files ¶
func (entity *InputMediaVideo) Files() map[string]rawTypes.InputFile
func (InputMediaVideo) MarshalJSON ¶
func (entity InputMediaVideo) MarshalJSON() ([]byte, error)
func (*InputMediaVideo) SetAttachment ¶
func (entity *InputMediaVideo) SetAttachment(attach string)
func (*InputMediaVideo) SetAttachmentThumb ¶
func (entity *InputMediaVideo) SetAttachmentThumb(attach string)
type InputMessageContent ¶
type InputMessageContent interface{}
InputMessageContent Represents the content of a message to be sent as a result of an inline query Telegram clients currently support the following 5 types:
- InputTextMessageContent
- InputLocationMessageContent
- InputVenueMessageContent
- InputContactMessageContent
- InputInvoiceMessageContent
type InputTextMessageContent ¶
type InputTextMessageContent struct { DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` Entities []MessageEntity `json:"entities,omitempty"` MessageText string `json:"message_text"` ParseMode string `json:"parse_mode,omitempty"` }
InputTextMessageContent Represents the content of a text message to be sent as the result of an inline query.
type InputVenueMessageContent ¶
type InputVenueMessageContent struct { Address string `json:"address"` FoursquareID string `json:"foursquare_id,omitempty"` FoursquareType string `json:"foursquare_type,omitempty"` GooglePlaceID string `json:"google_place_id,omitempty"` GooglePlaceType string `json:"google_place_type,omitempty"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Title string `json:"title"` }
InputVenueMessageContent Represents the content of a venue message to be sent as the result of an inline query.
type Invoice ¶
type Invoice struct { Currency string `json:"currency"` Description string `json:"description"` StartParameter string `json:"start_parameter"` Title string `json:"title"` TotalAmount int `json:"total_amount"` }
Invoice This object contains basic information about an invoice.
type KeyboardButton ¶
type KeyboardButton struct { RequestContact bool `json:"request_contact,omitempty"` RequestLocation bool `json:"request_location,omitempty"` RequestPoll *KeyboardButtonPollType `json:"request_poll,omitempty"` Text string `json:"text"` WebApp *WebAppInfo `json:"web_app,omitempty"` }
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 web_app, request_contact, request_location, and request_poll are mutually exclusive. Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016 Older clients will display unsupported message.Note: request_poll option will only work in Telegram versions released after 23 January, 2020 Older clients will display unsupported message.Note: web_app option will only work in Telegram versions released after 16 April, 2022 Older clients will display unsupported message.
type KeyboardButtonPollType ¶
type KeyboardButtonPollType struct {
Type string `json:"type,omitempty"`
}
KeyboardButtonPollType Represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
type LabeledPrice ¶
LabeledPrice Represents a portion of the price for goods or services.
type Location ¶
type Location struct { Heading int `json:"heading,omitempty"` HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` Latitude float64 `json:"latitude"` LivePeriod int `json:"live_period,omitempty"` Longitude float64 `json:"longitude"` ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` }
Location Represents a point on the map.
type LoginUrl ¶
type LoginUrl struct { BotUsername string `json:"bot_username,omitempty"` ForwardText string `json:"forward_text,omitempty"` RequestWriteAccess bool `json:"request_write_access,omitempty"` URL string `json:"url"` }
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: Telegram apps support these buttons as of version 5.7.
type MaskPosition ¶
type MaskPosition struct { Point string `json:"point"` Scale float64 `json:"scale"` XShift float64 `json:"x_shift"` YShift float64 `json:"y_shift"` }
MaskPosition This object describes the position on faces where a mask should be placed by default.
type MenuButton ¶
type MenuButton interface{}
MenuButton This object describes the bot's menu button in a private chat It should be one of
- MenuButtonCommands
- MenuButtonWebApp
- MenuButtonDefault
If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat Otherwise the default menu button is applied By default, the menu button opens the list of bot commands.
type MenuButtonCommands ¶
type MenuButtonCommands struct {
Type string `json:"type"`
}
MenuButtonCommands Represents a menu button, which opens the bot's list of commands.
type MenuButtonDefault ¶
type MenuButtonDefault struct {
Type string `json:"type"`
}
MenuButtonDefault Describes that no specific value for the menu button was set.
type MenuButtonWebApp ¶
type MenuButtonWebApp struct { Text string `json:"text"` Type string `json:"type"` WebApp WebAppInfo `json:"web_app"` }
MenuButtonWebApp Represents a menu button, which launches a Web App.
type Message ¶
type Message struct { Animation *Animation `json:"animation,omitempty"` Audio *Audio `json:"audio,omitempty"` AuthorSignature string `json:"author_signature,omitempty"` Caption string `json:"caption,omitempty"` CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` ChannelChatCreated bool `json:"channel_chat_created,omitempty"` Chat Chat `json:"chat"` ConnectedWebsite string `json:"connected_website,omitempty"` Contact *Contact `json:"contact,omitempty"` Date int64 `json:"date"` DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"` Dice *Dice `json:"dice,omitempty"` Document *Document `json:"document,omitempty"` EditDate int64 `json:"edit_date,omitempty"` Entities []MessageEntity `json:"entities,omitempty"` ForwardDate int64 `json:"forward_date,omitempty"` ForwardFrom *User `json:"forward_from,omitempty"` ForwardFromChat *Chat `json:"forward_from_chat,omitempty"` ForwardFromMessageID int64 `json:"forward_from_message_id,omitempty"` ForwardSenderName string `json:"forward_sender_name,omitempty"` ForwardSignature string `json:"forward_signature,omitempty"` From *User `json:"from,omitempty"` Game *Game `json:"game,omitempty"` GroupChatCreated bool `json:"group_chat_created,omitempty"` HasProtectedContent bool `json:"has_protected_content,omitempty"` Invoice *Invoice `json:"invoice,omitempty"` IsAutomaticForward bool `json:"is_automatic_forward,omitempty"` LeftChatMember *User `json:"left_chat_member,omitempty"` Location *Location `json:"location,omitempty"` MediaGroupID string `json:"media_group_id,omitempty"` MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` MessageID int64 `json:"message_id"` MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"` MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"` NewChatMembers []User `json:"new_chat_members,omitempty"` NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"` NewChatTitle string `json:"new_chat_title,omitempty"` PassportData *PassportData `json:"passport_data,omitempty"` Photo []PhotoSize `json:"photo,omitempty"` PinnedMessage *Message `json:"pinned_message,omitempty"` Poll *Poll `json:"poll,omitempty"` ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"` ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ReplyToMessage *Message `json:"reply_to_message,omitempty"` SenderChat *Chat `json:"sender_chat,omitempty"` Sticker *Sticker `json:"sticker,omitempty"` SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"` Text string `json:"text,omitempty"` Venue *Venue `json:"venue,omitempty"` ViaBot *User `json:"via_bot,omitempty"` Video *Video `json:"video,omitempty"` VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"` VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"` VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` VideoChatStarted *VideoChatStarted `json:"video_chat_started,omitempty"` VideoNote *VideoNote `json:"video_note,omitempty"` Voice *Voice `json:"voice,omitempty"` WebAppData *WebAppData `json:"web_app_data,omitempty"` }
Message Represents a message.
type MessageAutoDeleteTimerChanged ¶
type MessageAutoDeleteTimerChanged struct {
MessageAutoDeleteTime int `json:"message_auto_delete_time"`
}
MessageAutoDeleteTimerChanged Represents a service message about a change in auto-delete timer settings.
type MessageEntity ¶
type MessageEntity struct { Language string `json:"language,omitempty"` Length int `json:"length"` Offset int `json:"offset"` Type string `json:"type"` URL string `json:"url,omitempty"` User *User `json:"user,omitempty"` }
MessageEntity Represents one special entity in a text message For example, hashtags, usernames, URLs, etc.
type MessageId ¶
type MessageId struct {
MessageID int64 `json:"message_id"`
}
MessageId Represents a unique message identifier.
type OrderInfo ¶
type OrderInfo struct { Email string `json:"email,omitempty"` Name string `json:"name,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` }
OrderInfo Represents information about an order.
type PassportData ¶
type PassportData struct { Credentials EncryptedCredentials `json:"credentials"` Data []EncryptedPassportElement `json:"data,omitempty"` }
PassportData Contains information about Telegram Passport data shared with the bot by the user.
type PassportElementError ¶
type PassportElementError interface{}
PassportElementError Represents an error in the Telegram Passport element which was submitted that should be resolved by the user It should be one of:
- PassportElementErrorDataField
- PassportElementErrorFrontSide
- PassportElementErrorReverseSide
- PassportElementErrorSelfie
- PassportElementErrorFile
- PassportElementErrorFiles
- PassportElementErrorTranslationFile
- PassportElementErrorTranslationFiles
- PassportElementErrorUnspecified
type PassportElementErrorDataField ¶
type PassportElementErrorDataField struct { DataHash string `json:"data_hash"` FieldName string `json:"field_name"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
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 ¶
type PassportElementErrorFile struct { FileHash string `json:"file_hash"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
PassportElementErrorFile Represents an issue with a document scan The error is considered resolved when the file with the document scan changes.
type PassportElementErrorFiles ¶
type PassportElementErrorFiles struct { FileHashes []string `json:"file_hashes,omitempty"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
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 ¶
type PassportElementErrorFrontSide struct { FileHash string `json:"file_hash"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
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 ¶
type PassportElementErrorReverseSide struct { FileHash string `json:"file_hash"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
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 ¶
type PassportElementErrorSelfie struct { FileHash string `json:"file_hash"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
PassportElementErrorSelfie Represents an issue with the selfie with a document The error is considered resolved when the file with the selfie changes.
type PassportElementErrorTranslationFile ¶
type PassportElementErrorTranslationFile struct { FileHash string `json:"file_hash"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
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 ¶
type PassportElementErrorTranslationFiles struct { FileHashes []string `json:"file_hashes,omitempty"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
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 ¶
type PassportElementErrorUnspecified struct { ElementHash string `json:"element_hash"` Message string `json:"message"` Source string `json:"source"` Type string `json:"type"` }
PassportElementErrorUnspecified Represents an issue in an unspecified place The error is considered resolved when new data is added.
type PassportFile ¶
type PassportFile struct { FileDate int64 `json:"file_date"` FileID string `json:"file_id"` FileSize int `json:"file_size"` FileUniqueID string `json:"file_unique_id"` }
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 ¶
type PhotoSize struct { FileID string `json:"file_id"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` Height int `json:"height"` Width int64 `json:"width"` }
PhotoSize Represents one size of a photo or a file / sticker thumbnail.
type Poll ¶
type Poll struct { AllowsMultipleAnswers bool `json:"allows_multiple_answers"` CloseDate int64 `json:"close_date,omitempty"` CorrectOptionID int64 `json:"correct_option_id,omitempty"` Explanation string `json:"explanation,omitempty"` ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` ID string `json:"id"` IsAnonymous bool `json:"is_anonymous"` IsClosed bool `json:"is_closed"` OpenPeriod int `json:"open_period,omitempty"` Options []PollOption `json:"options,omitempty"` Question string `json:"question"` TotalVoterCount int `json:"total_voter_count"` Type string `json:"type"` }
Poll This object contains information about a poll.
type PollAnswer ¶
type PollAnswer struct { OptionIDs []int64 `json:"option_ids,omitempty"` PollID string `json:"poll_id"` User User `json:"user"` }
PollAnswer Represents an answer of a user in a non-anonymous poll.
type PollOption ¶
PollOption This object contains information about one answer option in a poll.
type PreCheckoutQuery ¶
type PreCheckoutQuery struct { Currency string `json:"currency"` From User `json:"from"` ID string `json:"id"` InvoicePayload string `json:"invoice_payload"` OrderInfo *OrderInfo `json:"order_info,omitempty"` ShippingOptionID string `json:"shipping_option_id,omitempty"` TotalAmount int `json:"total_amount"` }
PreCheckoutQuery This object contains information about an incoming pre-checkout query.
type ProximityAlertTriggered ¶
type ProximityAlertTriggered struct { Distance int `json:"distance"` Traveler User `json:"traveler"` Watcher User `json:"watcher"` }
ProximityAlertTriggered Represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct { InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` Keyboard [][]KeyboardButton `json:"keyboard,omitempty"` OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"` ResizeKeyboard bool `json:"resize_keyboard,omitempty"` Selective bool `json:"selective,omitempty"` }
ReplyKeyboardMarkup Represents a custom keyboard with reply options (see Introduction to bots for details and examples).
type ReplyKeyboardRemove ¶
type ReplyKeyboardRemove struct { RemoveKeyboard bool `json:"remove_keyboard"` Selective bool `json:"selective,omitempty"` }
ReplyKeyboardRemove 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 ResponseParameters ¶
type ResponseParameters struct { MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"` RetryAfter int `json:"retry_after,omitempty"` }
ResponseParameters Contains information about why a request was unsuccessful.
type SentWebAppMessage ¶
type SentWebAppMessage struct {
InlineMessageID string `json:"inline_message_id,omitempty"`
}
SentWebAppMessage Contains information about an inline message sent by a Web App on behalf of a user.
type ShippingAddress ¶
type ShippingAddress struct { City string `json:"city"` CountryCode string `json:"country_code"` PostCode string `json:"post_code"` State string `json:"state"` StreetLine1 string `json:"street_line1"` StreetLine2 string `json:"street_line2"` }
ShippingAddress Represents a shipping address.
type ShippingOption ¶
type ShippingOption struct { ID string `json:"id"` Prices []LabeledPrice `json:"prices,omitempty"` Title string `json:"title"` }
ShippingOption Represents one shipping option.
type ShippingQuery ¶
type ShippingQuery struct { From User `json:"from"` ID string `json:"id"` InvoicePayload string `json:"invoice_payload"` ShippingAddress ShippingAddress `json:"shipping_address"` }
ShippingQuery This object contains information about an incoming shipping query.
type Sticker ¶
type Sticker struct { Emoji string `json:"emoji,omitempty"` FileID string `json:"file_id"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` Height int `json:"height"` IsAnimated bool `json:"is_animated"` IsVideo bool `json:"is_video"` MaskPosition *MaskPosition `json:"mask_position,omitempty"` SetName string `json:"set_name,omitempty"` Thumb *PhotoSize `json:"thumb,omitempty"` Width int64 `json:"width"` }
Sticker Represents a sticker.
type StickerSet ¶
type StickerSet struct { ContainsMasks bool `json:"contains_masks"` IsAnimated bool `json:"is_animated"` IsVideo bool `json:"is_video"` Name string `json:"name"` Stickers []Sticker `json:"stickers,omitempty"` Thumb *PhotoSize `json:"thumb,omitempty"` Title string `json:"title"` }
StickerSet Represents a sticker set.
type SuccessfulPayment ¶
type SuccessfulPayment struct { Currency string `json:"currency"` InvoicePayload string `json:"invoice_payload"` OrderInfo *OrderInfo `json:"order_info,omitempty"` ProviderPaymentChargeID string `json:"provider_payment_charge_id"` ShippingOptionID string `json:"shipping_option_id,omitempty"` TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` TotalAmount int `json:"total_amount"` }
SuccessfulPayment This object contains basic information about a successful payment.
type Update ¶
type Update struct { CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` ChannelPost *Message `json:"channel_post,omitempty"` ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"` ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"` ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` EditedChannelPost *Message `json:"edited_channel_post,omitempty"` EditedMessage *Message `json:"edited_message,omitempty"` InlineQuery *InlineQuery `json:"inline_query,omitempty"` Message *Message `json:"message,omitempty"` MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"` Poll *Poll `json:"poll,omitempty"` PollAnswer *PollAnswer `json:"poll_answer,omitempty"` PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` UpdateID int64 `json:"update_id"` }
Update Represents an incoming update.At most one of the optional parameters can be present in any given update.
type User ¶
type User struct { CanJoinGroups bool `json:"can_join_groups,omitempty"` CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"` FirstName string `json:"first_name"` ID int64 `json:"id"` IsBot bool `json:"is_bot"` LanguageCode string `json:"language_code,omitempty"` LastName string `json:"last_name,omitempty"` SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"` Username string `json:"username,omitempty"` }
User Represents a Telegram user or bot.
type UserProfilePhotos ¶
type UserProfilePhotos struct { Photos [][]PhotoSize `json:"photos,omitempty"` TotalCount int `json:"total_count"` }
UserProfilePhotos This object represent a user's profile pictures.
type Venue ¶
type Venue struct { Address string `json:"address"` FoursquareID string `json:"foursquare_id,omitempty"` FoursquareType string `json:"foursquare_type,omitempty"` GooglePlaceID string `json:"google_place_id,omitempty"` GooglePlaceType string `json:"google_place_type,omitempty"` Location Location `json:"location"` Title string `json:"title"` }
Venue Represents a venue.
type Video ¶
type Video struct { Duration int `json:"duration"` FileID string `json:"file_id"` FileName string `json:"file_name,omitempty"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` Height int `json:"height"` MimeType string `json:"mime_type,omitempty"` Thumb *PhotoSize `json:"thumb,omitempty"` Width int64 `json:"width"` }
Video Represents a video file.
type VideoChatEnded ¶
type VideoChatEnded struct {
Duration int `json:"duration"`
}
VideoChatEnded Represents a service message about a video chat ended in the chat.
type VideoChatParticipantsInvited ¶
type VideoChatParticipantsInvited struct {
Users []User `json:"users,omitempty"`
}
VideoChatParticipantsInvited Represents a service message about new members invited to a video chat.
type VideoChatScheduled ¶
type VideoChatScheduled struct {
StartDate int64 `json:"start_date"`
}
VideoChatScheduled Represents a service message about a video chat scheduled in the chat.
type VideoChatStarted ¶
type VideoChatStarted interface{}
VideoChatStarted Represents a service message about a video chat started in the chat Currently holds no information.
type VideoNote ¶
type VideoNote struct { Duration int `json:"duration"` FileID string `json:"file_id"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` Length int `json:"length"` Thumb *PhotoSize `json:"thumb,omitempty"` }
VideoNote Represents a video message (available in Telegram apps as of v.4.0).
type Voice ¶
type Voice struct { Duration int `json:"duration"` FileID string `json:"file_id"` FileSize int `json:"file_size,omitempty"` FileUniqueID string `json:"file_unique_id"` MimeType string `json:"mime_type,omitempty"` }
Voice Represents a voice note.
type WebAppData ¶
WebAppData Contains data sent from a Web App to the bot.
type WebAppInfo ¶
type WebAppInfo struct {
URL string `json:"url"`
}
WebAppInfo Contains information about a Web App.
type WebhookInfo ¶
type WebhookInfo struct { AllowedUpdates []string `json:"allowed_updates,omitempty"` HasCustomCertificate bool `json:"has_custom_certificate"` IPAddress string `json:"ip_address,omitempty"` LastErrorDate int64 `json:"last_error_date,omitempty"` LastErrorMessage string `json:"last_error_message,omitempty"` LastSynchronizationErrorDate int64 `json:"last_synchronization_error_date,omitempty"` MaxConnections int `json:"max_connections,omitempty"` PendingUpdateCount int64 `json:"pending_update_count"` URL string `json:"url"` }
WebhookInfo Contains information about the current status of a webhook.
Source Files ¶
- animation.go
- audio.go
- bot_command.go
- bot_command_scope.go
- bot_command_scope_all_chat_administrators.go
- bot_command_scope_all_group_chats.go
- bot_command_scope_all_private_chats.go
- bot_command_scope_chat.go
- bot_command_scope_chat_administrators.go
- bot_command_scope_chat_member.go
- bot_command_scope_default.go
- callback_game.go
- callback_query.go
- chat.go
- chat_administrator_rights.go
- chat_invite_link.go
- chat_join_request.go
- chat_location.go
- chat_member.go
- chat_member_updated.go
- chat_permissions.go
- chat_photo.go
- chosen_inline_result.go
- contact.go
- dice.go
- document.go
- encrypted_credentials.go
- encrypted_passport_element.go
- file.go
- force_reply.go
- game.go
- game_high_score.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_file.go
- input_invoice_message_content.go
- input_location_message_content.go
- input_media.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_path.go
- input_text_message_content.go
- input_venue_message_content.go
- invoice.go
- keyboard_button.go
- keyboard_button_poll_type.go
- kinds.go
- labeled_price.go
- location.go
- login_url.go
- mask_position.go
- menu_button.go
- menu_button_commands.go
- menu_button_default.go
- menu_button_web_app.go
- message.go
- message_auto_delete_timer_changed.go
- message_entity.go
- message_id.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
- poll.go
- poll_answer.go
- poll_option.go
- pre_checkout_query.go
- proximity_alert_triggered.go
- reply_keyboard_markup.go
- reply_keyboard_remove.go
- response_parameters.go
- sent_web_app_message.go
- shipping_address.go
- shipping_option.go
- shipping_query.go
- sticker.go
- sticker_set.go
- successful_payment.go
- update.go
- user.go
- user_profile_photos.go
- venue.go
- video.go
- video_chat_ended.go
- video_chat_participants_invited.go
- video_chat_scheduled.go
- video_chat_started.go
- video_note.go
- voice.go
- web_app_data.go
- web_app_info.go
- webhook_info.go