Documentation ¶
Index ¶
- Constants
- type AddStickerToSetOpts
- type Animation
- type AnswerCallbackQueryOpts
- type AnswerInlineQueryOpts
- type AnswerPreCheckoutQueryOpts
- type AnswerShippingQueryOpts
- type Audio
- type Bot
- func (bot *Bot) AddStickerToSet(userId int64, name string, emojis string, opts *AddStickerToSetOpts) (bool, error)
- func (bot *Bot) AnswerCallbackQuery(callbackQueryId string, opts *AnswerCallbackQueryOpts) (bool, error)
- func (bot *Bot) AnswerInlineQuery(inlineQueryId string, results []InlineQueryResult, opts *AnswerInlineQueryOpts) (bool, error)
- func (bot *Bot) AnswerPreCheckoutQuery(preCheckoutQueryId string, ok bool, opts *AnswerPreCheckoutQueryOpts) (bool, error)
- func (bot *Bot) AnswerShippingQuery(shippingQueryId string, ok bool, opts *AnswerShippingQueryOpts) (bool, error)
- func (bot *Bot) Close() (bool, error)
- func (bot *Bot) CopyMessage(chatId int64, fromChatId int64, messageId int64, opts *CopyMessageOpts) (*MessageId, error)
- func (bot *Bot) CreateNewStickerSet(userId int64, name string, title string, emojis string, ...) (bool, error)
- func (bot *Bot) DeleteChatPhoto(chatId int64) (bool, error)
- func (bot *Bot) DeleteChatStickerSet(chatId int64) (bool, error)
- func (bot *Bot) DeleteMessage(chatId int64, messageId int64) (bool, error)
- func (bot *Bot) DeleteStickerFromSet(sticker string) (bool, error)
- func (bot *Bot) DeleteWebhook(opts *DeleteWebhookOpts) (bool, error)
- func (bot *Bot) EditMessageCaption(opts *EditMessageCaptionOpts) (*Message, error)
- func (bot *Bot) EditMessageLiveLocation(latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, error)
- func (bot *Bot) EditMessageMedia(media InputMedia, opts *EditMessageMediaOpts) (*Message, error)
- func (bot *Bot) EditMessageReplyMarkup(opts *EditMessageReplyMarkupOpts) (*Message, error)
- func (bot *Bot) EditMessageText(text string, opts *EditMessageTextOpts) (*Message, error)
- func (bot *Bot) ExportChatInviteLink(chatId int64) (string, error)
- func (bot *Bot) ForwardMessage(chatId int64, fromChatId int64, messageId int64, opts *ForwardMessageOpts) (*Message, error)
- func (bot *Bot) Get(method string, params url.Values) (json.RawMessage, error)
- func (bot *Bot) GetChat(chatId int64) (*Chat, error)
- func (bot *Bot) GetChatAdministrators(chatId int64) ([]ChatMember, error)
- func (bot *Bot) GetChatMember(chatId int64, userId int64) (*ChatMember, error)
- func (bot *Bot) GetChatMembersCount(chatId int64) (int64, error)
- func (bot *Bot) GetFile(fileId string) (*File, error)
- func (bot *Bot) GetGameHighScores(userId int64, opts *GetGameHighScoresOpts) ([]GameHighScore, error)
- func (bot *Bot) GetMe() (*User, error)
- func (bot *Bot) GetMyCommands() ([]BotCommand, error)
- func (bot *Bot) GetStickerSet(name string) (*StickerSet, error)
- func (bot *Bot) GetUpdates(opts *GetUpdatesOpts) ([]Update, error)
- func (bot *Bot) GetUserProfilePhotos(userId int64, opts *GetUserProfilePhotosOpts) (*UserProfilePhotos, error)
- func (bot *Bot) GetWebhookInfo() (*WebhookInfo, error)
- func (bot *Bot) GetWithContext(ctx context.Context, method string, params url.Values) (json.RawMessage, error)
- func (bot *Bot) KickChatMember(chatId int64, userId int64, opts *KickChatMemberOpts) (bool, error)
- func (bot *Bot) LeaveChat(chatId int64) (bool, error)
- func (bot *Bot) LogOut() (bool, error)
- func (bot *Bot) PinChatMessage(chatId int64, messageId int64, opts *PinChatMessageOpts) (bool, error)
- func (bot *Bot) Post(method string, params url.Values, data map[string]NamedReader) (json.RawMessage, error)
- func (bot *Bot) PostWithContext(ctx context.Context, method string, params url.Values, ...) (json.RawMessage, error)
- func (bot *Bot) PromoteChatMember(chatId int64, userId int64, opts *PromoteChatMemberOpts) (bool, error)
- func (bot *Bot) RestrictChatMember(chatId int64, userId int64, permissions ChatPermissions, ...) (bool, error)
- func (bot *Bot) SendAnimation(chatId int64, animation InputFile, opts *SendAnimationOpts) (*Message, error)
- func (bot *Bot) SendAudio(chatId int64, audio InputFile, opts *SendAudioOpts) (*Message, error)
- func (bot *Bot) SendChatAction(chatId int64, action string) (bool, error)
- func (bot *Bot) SendContact(chatId int64, phoneNumber string, firstName string, opts *SendContactOpts) (*Message, error)
- func (bot *Bot) SendDice(chatId int64, opts *SendDiceOpts) (*Message, error)
- func (bot *Bot) SendDocument(chatId int64, document InputFile, opts *SendDocumentOpts) (*Message, error)
- func (bot *Bot) SendGame(chatId int64, gameShortName string, opts *SendGameOpts) (*Message, error)
- func (bot *Bot) SendInvoice(chatId int64, title string, description string, payload string, ...) (*Message, error)
- func (bot *Bot) SendLocation(chatId int64, latitude float64, longitude float64, opts *SendLocationOpts) (*Message, error)
- func (bot *Bot) SendMediaGroup(chatId int64, media []InputMedia, opts *SendMediaGroupOpts) ([]Message, error)
- func (bot *Bot) SendMessage(chatId int64, text string, opts *SendMessageOpts) (*Message, error)
- func (bot *Bot) SendPhoto(chatId int64, photo InputFile, opts *SendPhotoOpts) (*Message, error)
- func (bot *Bot) SendPoll(chatId int64, question string, options []string, opts *SendPollOpts) (*Message, error)
- func (bot *Bot) SendSticker(chatId int64, sticker InputFile, opts *SendStickerOpts) (*Message, error)
- func (bot *Bot) SendVenue(chatId int64, latitude float64, longitude float64, title string, ...) (*Message, error)
- func (bot *Bot) SendVideo(chatId int64, video InputFile, opts *SendVideoOpts) (*Message, error)
- func (bot *Bot) SendVideoNote(chatId int64, videoNote InputFile, opts *SendVideoNoteOpts) (*Message, error)
- func (bot *Bot) SendVoice(chatId int64, voice InputFile, opts *SendVoiceOpts) (*Message, error)
- func (bot *Bot) SetChatAdministratorCustomTitle(chatId int64, userId int64, customTitle string) (bool, error)
- func (bot *Bot) SetChatDescription(chatId int64, opts *SetChatDescriptionOpts) (bool, error)
- func (bot *Bot) SetChatPermissions(chatId int64, permissions ChatPermissions) (bool, error)
- func (bot *Bot) SetChatPhoto(chatId int64, photo InputFile) (bool, error)
- func (bot *Bot) SetChatStickerSet(chatId int64, stickerSetName string) (bool, error)
- func (bot *Bot) SetChatTitle(chatId int64, title string) (bool, error)
- func (bot *Bot) SetGameScore(userId int64, score int64, opts *SetGameScoreOpts) (*Message, error)
- func (bot *Bot) SetMyCommands(commands []BotCommand) (bool, error)
- func (bot *Bot) SetPassportDataErrors(userId int64, errors []PassportElementError) (bool, error)
- func (bot *Bot) SetStickerPositionInSet(sticker string, position int64) (bool, error)
- func (bot *Bot) SetStickerSetThumb(name string, userId int64, opts *SetStickerSetThumbOpts) (bool, error)
- func (bot *Bot) SetWebhook(url string, opts *SetWebhookOpts) (bool, error)
- func (bot *Bot) StopMessageLiveLocation(opts *StopMessageLiveLocationOpts) (*Message, error)
- func (bot *Bot) StopPoll(chatId int64, messageId int64, opts *StopPollOpts) (*Poll, error)
- func (bot *Bot) UnbanChatMember(chatId int64, userId int64, opts *UnbanChatMemberOpts) (bool, error)
- func (bot *Bot) UnpinAllChatMessages(chatId int64) (bool, error)
- func (bot *Bot) UnpinChatMessage(chatId int64, opts *UnpinChatMessageOpts) (bool, error)
- func (bot *Bot) UploadStickerFile(userId int64, pngSticker InputFile) (*File, error)
- type BotCommand
- type CallbackGame
- type CallbackQuery
- type Chat
- func (c Chat) DeletePhoto(b *Bot) (bool, error)
- func (c Chat) DeleteStickerSet(b *Bot) (bool, error)
- func (c Chat) ExportInviteLink(b *Bot) (string, error)
- func (c Chat) Get(b *Bot) (*Chat, error)
- func (c Chat) GetAdministrators(b *Bot) ([]ChatMember, error)
- func (c Chat) GetMember(b *Bot, userId int64) (*ChatMember, error)
- func (c Chat) GetMembersCount(b *Bot) (int64, error)
- func (c Chat) KickMember(b *Bot, userId int64, opts *KickChatMemberOpts) (bool, error)
- func (c Chat) Leave(b *Bot) (bool, error)
- func (c Chat) PinMessage(b *Bot, messageId int64, opts *PinChatMessageOpts) (bool, error)
- func (c Chat) Promote(b *Bot, userId int64, opts *PromoteChatMemberOpts) (bool, error)
- func (c Chat) PromoteMember(b *Bot, userId int64, opts *PromoteChatMemberOpts) (bool, error)
- func (c Chat) RestrictMember(b *Bot, userId int64, permissions ChatPermissions, ...) (bool, error)
- func (c Chat) SendAction(b *Bot, action string) (bool, error)
- func (c Chat) SendMessage(b *Bot, text string, opts *SendMessageOpts) (*Message, error)
- func (c Chat) SetAdministratorCustomTitle(b *Bot, userId int64, customTitle string) (bool, error)
- func (c Chat) SetDescription(b *Bot, opts *SetChatDescriptionOpts) (bool, error)
- func (c Chat) SetPermissions(b *Bot, permissions ChatPermissions) (bool, error)
- func (c Chat) SetPhoto(b *Bot, photo InputFile) (bool, error)
- func (c Chat) SetStickerSet(b *Bot, stickerSetName string) (bool, error)
- func (c Chat) SetTitle(b *Bot, title string) (bool, error)
- func (c Chat) Unban(b *Bot, userId int64, opts *UnbanChatMemberOpts) (bool, error)
- func (c Chat) UnbanMember(b *Bot, userId int64, opts *UnbanChatMemberOpts) (bool, error)
- func (c Chat) UnpinAllMessages(b *Bot) (bool, error)
- func (c Chat) UnpinMessage(b *Bot, opts *UnpinChatMessageOpts) (bool, error)
- type ChatLocation
- type ChatMember
- type ChatPermissions
- type ChatPhoto
- type ChosenInlineResult
- type Contact
- type CopyMessageOpts
- type CreateNewStickerSetOpts
- type DeleteWebhookOpts
- type Dice
- type Document
- type EditMessageCaptionOpts
- type EditMessageLiveLocationOpts
- type EditMessageMediaOpts
- type EditMessageReplyMarkupOpts
- type EditMessageTextOpts
- type EncryptedCredentials
- type EncryptedPassportElement
- type File
- type ForceReply
- type ForwardMessageOpts
- type Game
- type GameHighScore
- type GetGameHighScoresOpts
- type GetUpdatesOpts
- type GetUserProfilePhotosOpts
- 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 InputLocationMessageContent
- type InputMedia
- type InputMediaAnimation
- type InputMediaAudio
- type InputMediaDocument
- type InputMediaPhoto
- type InputMediaVideo
- type InputMessageContent
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type KeyboardButton
- type KeyboardButtonPollType
- type KickChatMemberOpts
- type LabeledPrice
- type Location
- type LoginUrl
- type MaskPosition
- type Message
- func (m Message) Copy(b *Bot, chatId int64, opts *CopyMessageOpts) (*MessageId, error)
- func (m Message) Delete(b *Bot) (bool, error)
- func (m Message) EditCaption(b *Bot, opts *EditMessageCaptionOpts) (*Message, error)
- func (m Message) EditLiveLocation(b *Bot, latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, error)
- func (m Message) EditMedia(b *Bot, media InputMedia, opts *EditMessageMediaOpts) (*Message, error)
- func (m Message) EditReplyMarkup(b *Bot, opts *EditMessageReplyMarkupOpts) (*Message, error)
- func (m Message) EditText(b *Bot, text string, opts *EditMessageTextOpts) (*Message, error)
- func (m Message) Forward(b *Bot, chatId int64, opts *ForwardMessageOpts) (*Message, error)
- func (m Message) OriginalCaptionHTML() string
- func (m Message) OriginalCaptionMD() string
- func (m Message) OriginalCaptionMDV2() string
- func (m Message) OriginalHTML() string
- func (m Message) OriginalMD() string
- func (m Message) OriginalMDV2() string
- func (m Message) ParseCaptionEntities() (out []ParsedMessageEntity)
- func (m Message) ParseCaptionEntity(entity MessageEntity) ParsedMessageEntity
- func (m Message) ParseCaptionEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)
- func (m Message) ParseEntities() (out []ParsedMessageEntity)
- func (m Message) ParseEntity(entity MessageEntity) ParsedMessageEntity
- func (m Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)
- func (m Message) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error)
- func (m Message) Reply(b *Bot, text string, opts *SendMessageOpts) (*Message, error)
- func (m Message) StopLiveLocation(b *Bot, opts *StopMessageLiveLocationOpts) (*Message, error)
- func (m Message) Unpin(b *Bot, opts *UnpinChatMessageOpts) (bool, error)
- type MessageEntity
- type MessageId
- type NamedFile
- type NamedReader
- type OrderInfo
- type ParsedMessageEntity
- 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 PinChatMessageOpts
- type Poll
- type PollAnswer
- type PollOption
- type PreCheckoutQuery
- type PromoteChatMemberOpts
- type ProximityAlertTriggered
- type ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type ReplyMarkup
- type Response
- type ResponseParameters
- type RestrictChatMemberOpts
- type SendAnimationOpts
- type SendAudioOpts
- type SendContactOpts
- type SendDiceOpts
- type SendDocumentOpts
- type SendGameOpts
- type SendInvoiceOpts
- type SendLocationOpts
- type SendMediaGroupOpts
- type SendMessageOpts
- type SendPhotoOpts
- type SendPollOpts
- type SendStickerOpts
- type SendVenueOpts
- type SendVideoNoteOpts
- type SendVideoOpts
- type SendVoiceOpts
- type SetChatDescriptionOpts
- type SetGameScoreOpts
- type SetStickerSetThumbOpts
- type SetWebhookOpts
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type Sticker
- type StickerSet
- type StopMessageLiveLocationOpts
- type StopPollOpts
- type SuccessfulPayment
- type TelegramError
- type UnbanChatMemberOpts
- type UnpinChatMessageOpts
- type Update
- type User
- type UserProfilePhotos
- type Venue
- type Video
- type VideoNote
- type Voice
- type WebhookInfo
Constants ¶
const ( // Default telegram API URL. DefaultAPIURL = "https://api.telegram.org/bot" // Default timeout to be set for a GET request. DefaultGetTimeout = time.Second * 3 // Default timeout to be set for a POST request. DefaultPostTimeout = time.Second * 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddStickerToSetOpts ¶
type AddStickerToSetOpts struct { // 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 » PngSticker InputFile // TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements TgsSticker InputFile // A JSON-serialized object for position where the mask should be placed on faces MaskPosition MaskPosition }
AddStickerToSetOpts is the set of optional fields for Bot.AddStickerToSet.
type Animation ¶
type Animation struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Video width as defined by sender Width int64 `json:"width,omitempty"` // Video height as defined by sender Height int64 `json:"height,omitempty"` // Duration of the video in seconds as defined by sender Duration int64 `json:"duration,omitempty"` // Optional. Animation thumbnail as defined by sender Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Original animation filename as defined by sender FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). https://core.telegram.org/bots/api#animation
type AnswerCallbackQueryOpts ¶
type AnswerCallbackQueryOpts struct { // Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters Text string // If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. ShowAlert bool // 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. Url string // 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. CacheTime int64 }
AnswerCallbackQueryOpts is the set of optional fields for Bot.AnswerCallbackQuery.
type AnswerInlineQueryOpts ¶
type AnswerInlineQueryOpts struct { // The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. CacheTime int64 // 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 IsPersonal bool // 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. NextOffset string // 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 SwitchPmText string // 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. SwitchPmParameter string }
AnswerInlineQueryOpts is the set of optional fields for Bot.AnswerInlineQuery.
type AnswerPreCheckoutQueryOpts ¶
type AnswerPreCheckoutQueryOpts struct { // 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. ErrorMessage string }
AnswerPreCheckoutQueryOpts is the set of optional fields for Bot.AnswerPreCheckoutQuery.
type AnswerShippingQueryOpts ¶
type AnswerShippingQueryOpts struct { // Required if ok is True. A JSON-serialized array of available shipping options. ShippingOptions []ShippingOption // 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. ErrorMessage string }
AnswerShippingQueryOpts is the set of optional fields for Bot.AnswerShippingQuery.
type Audio ¶
type Audio struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Duration of the audio in seconds as defined by sender Duration int64 `json:"duration,omitempty"` // Optional. Performer of the audio as defined by sender or by audio tags Performer string `json:"performer,omitempty"` // Optional. Title of the audio as defined by sender or by audio tags Title string `json:"title,omitempty"` // Optional. Original filename as defined by sender FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs Thumb *PhotoSize `json:"thumb,omitempty"` }
This object represents an audio file to be treated as music by the Telegram clients. https://core.telegram.org/bots/api#audio
type Bot ¶
type Bot struct { Token string User User APIURL string Client http.Client GetTimeout time.Duration PostTimeout time.Duration }
func (*Bot) AddStickerToSet ¶
func (bot *Bot) AddStickerToSet(userId int64, name string, emojis string, opts *AddStickerToSetOpts) (bool, error)
Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success. - user_id (type int64): User identifier of sticker set owner - name (type string): Sticker set name - emojis (type string): One or more emoji corresponding to the sticker - opts (type AddStickerToSetOpts): All optional parameters. https://core.telegram.org/bots/api#addstickertoset
func (*Bot) AnswerCallbackQuery ¶
func (bot *Bot) AnswerCallbackQuery(callbackQueryId string, opts *AnswerCallbackQueryOpts) (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. - callback_query_id (type string): Unique identifier for the query to be answered - opts (type AnswerCallbackQueryOpts): All optional parameters. https://core.telegram.org/bots/api#answercallbackquery
func (*Bot) AnswerInlineQuery ¶
func (bot *Bot) AnswerInlineQuery(inlineQueryId string, results []InlineQueryResult, opts *AnswerInlineQueryOpts) (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. - inline_query_id (type string): Unique identifier for the answered query - results (type []InlineQueryResult): A JSON-serialized array of results for the inline query - opts (type AnswerInlineQueryOpts): All optional parameters. https://core.telegram.org/bots/api#answerinlinequery
func (*Bot) AnswerPreCheckoutQuery ¶
func (bot *Bot) AnswerPreCheckoutQuery(preCheckoutQueryId string, ok bool, opts *AnswerPreCheckoutQueryOpts) (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. - pre_checkout_query_id (type string): Unique identifier for the query to be answered - ok (type bool): 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. - opts (type AnswerPreCheckoutQueryOpts): All optional parameters. https://core.telegram.org/bots/api#answerprecheckoutquery
func (*Bot) AnswerShippingQuery ¶
func (bot *Bot) AnswerShippingQuery(shippingQueryId string, ok bool, opts *AnswerShippingQueryOpts) (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. - shipping_query_id (type string): Unique identifier for the query to be answered - ok (type bool): 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) - opts (type AnswerShippingQueryOpts): All optional parameters. https://core.telegram.org/bots/api#answershippingquery
func (*Bot) Close ¶
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters. https://core.telegram.org/bots/api#close
func (*Bot) CopyMessage ¶
func (bot *Bot) CopyMessage(chatId int64, fromChatId int64, messageId int64, opts *CopyMessageOpts) (*MessageId, error)
Use this method to copy messages of any kind. The method is analogous to the method forwardMessages, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - from_chat_id (type int64): Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) - message_id (type int64): Message identifier in the chat specified in from_chat_id - opts (type CopyMessageOpts): All optional parameters. https://core.telegram.org/bots/api#copymessage
func (*Bot) CreateNewStickerSet ¶
func (bot *Bot) CreateNewStickerSet(userId int64, name string, title string, emojis string, opts *CreateNewStickerSetOpts) (bool, error)
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success. - user_id (type int64): User identifier of created sticker set owner - name (type string): 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 (type string): Sticker set title, 1-64 characters - emojis (type string): One or more emoji corresponding to the sticker - opts (type CreateNewStickerSetOpts): All optional parameters. https://core.telegram.org/bots/api#createnewstickerset
func (*Bot) DeleteChatPhoto ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) https://core.telegram.org/bots/api#deletechatphoto
func (*Bot) DeleteChatStickerSet ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) https://core.telegram.org/bots/api#deletechatstickerset
func (*Bot) DeleteMessage ¶
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.- A dice message in a private chat can only be deleted if it was sent more than 24 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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - message_id (type int64): Identifier of the message to delete https://core.telegram.org/bots/api#deletemessage
func (*Bot) DeleteStickerFromSet ¶
Use this method to delete a sticker from a set created by the bot. Returns True on success. - sticker (type string): File identifier of the sticker https://core.telegram.org/bots/api#deletestickerfromset
func (*Bot) DeleteWebhook ¶
func (bot *Bot) DeleteWebhook(opts *DeleteWebhookOpts) (bool, error)
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. - opts (type DeleteWebhookOpts): All optional parameters. https://core.telegram.org/bots/api#deletewebhook
func (*Bot) EditMessageCaption ¶
func (bot *Bot) EditMessageCaption(opts *EditMessageCaptionOpts) (*Message, error)
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. - opts (type EditMessageCaptionOpts): All optional parameters. https://core.telegram.org/bots/api#editmessagecaption
func (*Bot) EditMessageLiveLocation ¶
func (bot *Bot) EditMessageLiveLocation(latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*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 is not an inline message, the edited Message is returned, otherwise True is returned. - latitude (type float64): Latitude of new location - longitude (type float64): Longitude of new location - opts (type EditMessageLiveLocationOpts): All optional parameters. https://core.telegram.org/bots/api#editmessagelivelocation
func (*Bot) EditMessageMedia ¶
func (bot *Bot) EditMessageMedia(media InputMedia, opts *EditMessageMediaOpts) (*Message, error)
Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded. Use a 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. - media (type InputMedia): A JSON-serialized object for a new media content of the message - opts (type EditMessageMediaOpts): All optional parameters. https://core.telegram.org/bots/api#editmessagemedia
func (*Bot) EditMessageReplyMarkup ¶
func (bot *Bot) EditMessageReplyMarkup(opts *EditMessageReplyMarkupOpts) (*Message, error)
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. - opts (type EditMessageReplyMarkupOpts): All optional parameters. https://core.telegram.org/bots/api#editmessagereplymarkup
func (*Bot) EditMessageText ¶
func (bot *Bot) EditMessageText(text string, opts *EditMessageTextOpts) (*Message, error)
Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. - text (type string): New text of the message, 1-4096 characters after entities parsing - opts (type EditMessageTextOpts): All optional parameters. https://core.telegram.org/bots/api#editmessagetext
func (*Bot) ExportChatInviteLink ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) https://core.telegram.org/bots/api#exportchatinvitelink
func (*Bot) ForwardMessage ¶
func (bot *Bot) ForwardMessage(chatId int64, fromChatId int64, messageId int64, opts *ForwardMessageOpts) (*Message, error)
Use this method to forward messages of any kind. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - from_chat_id (type int64): Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) - message_id (type int64): Message identifier in the chat specified in from_chat_id - opts (type ForwardMessageOpts): All optional parameters. https://core.telegram.org/bots/api#forwardmessage
func (*Bot) GetChat ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) https://core.telegram.org/bots/api#getchat
func (*Bot) GetChatAdministrators ¶
func (bot *Bot) GetChatAdministrators(chatId int64) ([]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. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) https://core.telegram.org/bots/api#getchatadministrators
func (*Bot) GetChatMember ¶
func (bot *Bot) GetChatMember(chatId int64, userId int64) (*ChatMember, error)
Use this method to get information about a member of a chat. Returns a ChatMember object on success. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) - user_id (type int64): Unique identifier of the target user https://core.telegram.org/bots/api#getchatmember
func (*Bot) GetChatMembersCount ¶
Use this method to get the number of members in a chat. Returns Int on success. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) https://core.telegram.org/bots/api#getchatmemberscount
func (*Bot) GetFile ¶
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. Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received. - file_id (type string): File identifier to get info about https://core.telegram.org/bots/api#getfile
func (*Bot) GetGameHighScores ¶
func (bot *Bot) GetGameHighScores(userId int64, opts *GetGameHighScoresOpts) ([]GameHighScore, error)
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. - user_id (type int64): Target user id - opts (type GetGameHighScoresOpts): All optional parameters. https://core.telegram.org/bots/api#getgamehighscores
func (*Bot) GetMe ¶
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. https://core.telegram.org/bots/api#getme
func (*Bot) GetMyCommands ¶
func (bot *Bot) GetMyCommands() ([]BotCommand, error)
Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success. Methods and objects used in the inline mode are described in the Inline mode section. https://core.telegram.org/bots/api#getmycommands
func (*Bot) GetStickerSet ¶
func (bot *Bot) GetStickerSet(name string) (*StickerSet, error)
Use this method to get a sticker set. On success, a StickerSet object is returned. - name (type string): Name of the sticker set https://core.telegram.org/bots/api#getstickerset
func (*Bot) GetUpdates ¶
func (bot *Bot) GetUpdates(opts *GetUpdatesOpts) ([]Update, error)
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned. - opts (type GetUpdatesOpts): All optional parameters. https://core.telegram.org/bots/api#getupdates
func (*Bot) GetUserProfilePhotos ¶
func (bot *Bot) GetUserProfilePhotos(userId int64, opts *GetUserProfilePhotosOpts) (*UserProfilePhotos, error)
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. - user_id (type int64): Unique identifier of the target user - opts (type GetUserProfilePhotosOpts): All optional parameters. https://core.telegram.org/bots/api#getuserprofilephotos
func (*Bot) GetWebhookInfo ¶
func (bot *Bot) 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. https://core.telegram.org/bots/api#getwebhookinfo
func (*Bot) GetWithContext ¶
func (*Bot) KickChatMember ¶
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. - chat_id (type int64): Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) - user_id (type int64): Unique identifier of the target user - opts (type KickChatMemberOpts): All optional parameters. https://core.telegram.org/bots/api#kickchatmember
func (*Bot) LeaveChat ¶
Use this method for your bot to leave a group, supergroup or channel. Returns True on success. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) https://core.telegram.org/bots/api#leavechat
func (*Bot) LogOut ¶
Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. https://core.telegram.org/bots/api#logout
func (*Bot) PinChatMessage ¶
func (bot *Bot) PinChatMessage(chatId int64, messageId int64, opts *PinChatMessageOpts) (bool, error)
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - message_id (type int64): Identifier of a message to pin - opts (type PinChatMessageOpts): All optional parameters. https://core.telegram.org/bots/api#pinchatmessage
func (*Bot) Post ¶
func (bot *Bot) Post(method string, params url.Values, data map[string]NamedReader) (json.RawMessage, error)
func (*Bot) PostWithContext ¶
func (*Bot) PromoteChatMember ¶
func (bot *Bot) PromoteChatMember(chatId int64, userId int64, opts *PromoteChatMemberOpts) (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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - user_id (type int64): Unique identifier of the target user - opts (type PromoteChatMemberOpts): All optional parameters. https://core.telegram.org/bots/api#promotechatmember
func (*Bot) RestrictChatMember ¶
func (bot *Bot) RestrictChatMember(chatId int64, userId int64, permissions ChatPermissions, opts *RestrictChatMemberOpts) (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. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) - user_id (type int64): Unique identifier of the target user - permissions (type ChatPermissions): A JSON-serialized object for new user permissions - opts (type RestrictChatMemberOpts): All optional parameters. https://core.telegram.org/bots/api#restrictchatmember
func (*Bot) SendAnimation ¶
func (bot *Bot) SendAnimation(chatId int64, animation InputFile, opts *SendAnimationOpts) (*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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - animation (type InputFile): 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 » - opts (type SendAnimationOpts): All optional parameters. https://core.telegram.org/bots/api#sendanimation
func (*Bot) SendAudio ¶
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 or .M4A 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. For sending voice messages, use the sendVoice method instead. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - audio (type InputFile): 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 » - opts (type SendAudioOpts): All optional parameters. https://core.telegram.org/bots/api#sendaudio
func (*Bot) SendChatAction ¶
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. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - action (type string): 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_voice or upload_voice for voice notes, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes. https://core.telegram.org/bots/api#sendchataction
func (*Bot) SendContact ¶
func (bot *Bot) SendContact(chatId int64, phoneNumber string, firstName string, opts *SendContactOpts) (*Message, error)
Use this method to send phone contacts. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - phone_number (type string): Contact's phone number - first_name (type string): Contact's first name - opts (type SendContactOpts): All optional parameters. https://core.telegram.org/bots/api#sendcontact
func (*Bot) SendDice ¶
func (bot *Bot) SendDice(chatId int64, opts *SendDiceOpts) (*Message, error)
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - opts (type SendDiceOpts): All optional parameters. https://core.telegram.org/bots/api#senddice
func (*Bot) SendDocument ¶
func (bot *Bot) SendDocument(chatId int64, document InputFile, opts *SendDocumentOpts) (*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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - document (type InputFile): 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 » - opts (type SendDocumentOpts): All optional parameters. https://core.telegram.org/bots/api#senddocument
func (*Bot) SendGame ¶
Use this method to send a game. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat - game_short_name (type string): Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. - opts (type SendGameOpts): All optional parameters. https://core.telegram.org/bots/api#sendgame
func (*Bot) SendInvoice ¶
func (bot *Bot) SendInvoice(chatId int64, title string, description string, payload string, providerToken string, startParameter string, currency string, prices []LabeledPrice, opts *SendInvoiceOpts) (*Message, error)
Use this method to send invoices. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target private chat - title (type string): Product name, 1-32 characters - description (type string): Product description, 1-255 characters - payload (type string): Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. - provider_token (type string): Payments provider token, obtained via Botfather - start_parameter (type string): Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter - currency (type string): Three-letter ISO 4217 currency code, see more on currencies - prices (type []LabeledPrice): Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) - opts (type SendInvoiceOpts): All optional parameters. https://core.telegram.org/bots/api#sendinvoice
func (*Bot) SendLocation ¶
func (bot *Bot) SendLocation(chatId int64, latitude float64, longitude float64, opts *SendLocationOpts) (*Message, error)
Use this method to send point on the map. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - latitude (type float64): Latitude of the location - longitude (type float64): Longitude of the location - opts (type SendLocationOpts): All optional parameters. https://core.telegram.org/bots/api#sendlocation
func (*Bot) SendMediaGroup ¶
func (bot *Bot) SendMediaGroup(chatId int64, media []InputMedia, opts *SendMediaGroupOpts) ([]Message, error)
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - media (type []InputMedia): A JSON-serialized array describing messages to be sent, must include 2-10 items - opts (type SendMediaGroupOpts): All optional parameters. https://core.telegram.org/bots/api#sendmediagroup
func (*Bot) SendMessage ¶
Use this method to send text messages. On success, the sent Message is returned. The Bot API supports basic formatting for messages. You can use bold, italic, underlined and strikethrough text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting. Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL). Message entities can be nested, providing following restrictions are met:- If two entities has common characters then one of them is fully contained inside another.- bold, italic, underline and strikethrough entities can contain and to be contained in any other entities, except pre and code.- All other entities can't contain each other. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username. Please note: To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message: Please note: To use this mode, pass HTML in the parse_mode field. The following tags are currently supported: Please note: This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message: Please note: - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - text (type string): Text of the message to be sent, 1-4096 characters after entities parsing - opts (type SendMessageOpts): All optional parameters. https://core.telegram.org/bots/api#sendmessage
func (*Bot) SendPhoto ¶
Use this method to send photos. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - photo (type InputFile): 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 » - opts (type SendPhotoOpts): All optional parameters. https://core.telegram.org/bots/api#sendphoto
func (*Bot) SendPoll ¶
func (bot *Bot) SendPoll(chatId int64, question string, options []string, opts *SendPollOpts) (*Message, error)
Use this method to send a native poll. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - question (type string): Poll question, 1-300 characters - options (type []string): A JSON-serialized list of answer options, 2-10 strings 1-100 characters each - opts (type SendPollOpts): All optional parameters. https://core.telegram.org/bots/api#sendpoll
func (*Bot) SendSticker ¶
func (bot *Bot) SendSticker(chatId int64, sticker InputFile, opts *SendStickerOpts) (*Message, error)
Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - sticker (type InputFile): 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 » - opts (type SendStickerOpts): All optional parameters. https://core.telegram.org/bots/api#sendsticker
func (*Bot) SendVenue ¶
func (bot *Bot) SendVenue(chatId int64, latitude float64, longitude float64, title string, address string, opts *SendVenueOpts) (*Message, error)
Use this method to send information about a venue. On success, the sent Message is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - latitude (type float64): Latitude of the venue - longitude (type float64): Longitude of the venue - title (type string): Name of the venue - address (type string): Address of the venue - opts (type SendVenueOpts): All optional parameters. https://core.telegram.org/bots/api#sendvenue
func (*Bot) SendVideo ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - video (type InputFile): 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 » - opts (type SendVideoOpts): All optional parameters. https://core.telegram.org/bots/api#sendvideo
func (*Bot) SendVideoNote ¶
func (bot *Bot) SendVideoNote(chatId int64, videoNote InputFile, opts *SendVideoNoteOpts) (*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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - video_note (type InputFile): 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 - opts (type SendVideoNoteOpts): All optional parameters. https://core.telegram.org/bots/api#sendvideonote
func (*Bot) SendVoice ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - voice (type InputFile): 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 » - opts (type SendVoiceOpts): All optional parameters. https://core.telegram.org/bots/api#sendvoice
func (*Bot) SetChatAdministratorCustomTitle ¶
func (bot *Bot) SetChatAdministratorCustomTitle(chatId int64, userId int64, customTitle string) (bool, error)
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) - user_id (type int64): Unique identifier of the target user - custom_title (type string): New custom title for the administrator; 0-16 characters, emoji are not allowed https://core.telegram.org/bots/api#setchatadministratorcustomtitle
func (*Bot) SetChatDescription ¶
func (bot *Bot) SetChatDescription(chatId int64, opts *SetChatDescriptionOpts) (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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - opts (type SetChatDescriptionOpts): All optional parameters. https://core.telegram.org/bots/api#setchatdescription
func (*Bot) SetChatPermissions ¶
func (bot *Bot) SetChatPermissions(chatId int64, permissions ChatPermissions) (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. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) - permissions (type ChatPermissions): New default chat permissions https://core.telegram.org/bots/api#setchatpermissions
func (*Bot) SetChatPhoto ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - photo (type InputFile): New chat photo, uploaded using multipart/form-data https://core.telegram.org/bots/api#setchatphoto
func (*Bot) SetChatStickerSet ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) - sticker_set_name (type string): Name of the sticker set to be set as the group sticker set https://core.telegram.org/bots/api#setchatstickerset
func (*Bot) SetChatTitle ¶
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. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - title (type string): New chat title, 1-255 characters https://core.telegram.org/bots/api#setchattitle
func (*Bot) SetGameScore ¶
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. - user_id (type int64): User identifier - score (type int64): New score, must be non-negative - opts (type SetGameScoreOpts): All optional parameters. https://core.telegram.org/bots/api#setgamescore
func (*Bot) SetMyCommands ¶
func (bot *Bot) SetMyCommands(commands []BotCommand) (bool, error)
Use this method to change the list of the bot's commands. Returns True on success. - commands (type []BotCommand): A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. https://core.telegram.org/bots/api#setmycommands
func (*Bot) SetPassportDataErrors ¶
func (bot *Bot) SetPassportDataErrors(userId int64, errors []PassportElementError) (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. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. - user_id (type int64): User identifier - errors (type []PassportElementError): A JSON-serialized array describing the errors https://core.telegram.org/bots/api#setpassportdataerrors
func (*Bot) SetStickerPositionInSet ¶
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. - sticker (type string): File identifier of the sticker - position (type int64): New sticker position in the set, zero-based https://core.telegram.org/bots/api#setstickerpositioninset
func (*Bot) SetStickerSetThumb ¶
func (bot *Bot) SetStickerSetThumb(name string, userId int64, opts *SetStickerSetThumbOpts) (bool, error)
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success. - name (type string): Sticker set name - user_id (type int64): User identifier of the sticker set owner - opts (type SetStickerSetThumbOpts): All optional parameters. https://core.telegram.org/bots/api#setstickersetthumb
func (*Bot) SetWebhook ¶
func (bot *Bot) SetWebhook(url string, opts *SetWebhookOpts) (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. If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be pretty sure it's us. - url (type string): HTTPS url to send updates to. Use an empty string to remove webhook integration - opts (type SetWebhookOpts): All optional parameters. https://core.telegram.org/bots/api#setwebhook
func (*Bot) StopMessageLiveLocation ¶
func (bot *Bot) StopMessageLiveLocation(opts *StopMessageLiveLocationOpts) (*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. - opts (type StopMessageLiveLocationOpts): All optional parameters. https://core.telegram.org/bots/api#stopmessagelivelocation
func (*Bot) StopPoll ¶
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - message_id (type int64): Identifier of the original message with the poll - opts (type StopPollOpts): All optional parameters. https://core.telegram.org/bots/api#stoppoll
func (*Bot) UnbanChatMember ¶
func (bot *Bot) UnbanChatMember(chatId int64, userId int64, opts *UnbanChatMemberOpts) (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. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success. - chat_id (type int64): Unique identifier for the target group or username of the target supergroup or channel (in the format @username) - user_id (type int64): Unique identifier of the target user - opts (type UnbanChatMemberOpts): All optional parameters. https://core.telegram.org/bots/api#unbanchatmember
func (*Bot) UnpinAllChatMessages ¶
Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) https://core.telegram.org/bots/api#unpinallchatmessages
func (*Bot) UnpinChatMessage ¶
func (bot *Bot) UnpinChatMessage(chatId int64, opts *UnpinChatMessageOpts) (bool, error)
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. - chat_id (type int64): Unique identifier for the target chat or username of the target channel (in the format @channelusername) - opts (type UnpinChatMessageOpts): All optional parameters. https://core.telegram.org/bots/api#unpinchatmessage
func (*Bot) UploadStickerFile ¶
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. - user_id (type int64): User identifier of sticker file owner - png_sticker (type InputFile): 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 » https://core.telegram.org/bots/api#uploadstickerfile
type BotCommand ¶
type BotCommand struct { // Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores. Command string `json:"command,omitempty"` // Description of the command, 3-256 characters. Description string `json:"description,omitempty"` }
This object represents a bot command. https://core.telegram.org/bots/api#botcommand
type CallbackGame ¶
type CallbackGame interface{}
A placeholder, currently holds no information. Use BotFather to set up your game. https://core.telegram.org/bots/api#callbackgame
type CallbackQuery ¶
type CallbackQuery struct { // Unique identifier for this query Id string `json:"id,omitempty"` // Sender From User `json:"from,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 Message *Message `json:"message,omitempty"` // Optional. Identifier of the message sent via the bot in inline mode, that originated the query. InlineMessageId string `json:"inline_message_id,omitempty"` // Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. ChatInstance string `json:"chat_instance,omitempty"` // Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. Data string `json:"data,omitempty"` // Optional. Short name of a Game to be returned, serves as the unique identifier for the game GameShortName string `json:"game_short_name,omitempty"` }
This object 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. https://core.telegram.org/bots/api#callbackquery
func (CallbackQuery) Answer ¶
func (cq CallbackQuery) Answer(b *Bot, opts *AnswerCallbackQueryOpts) (bool, error)
Helper method for Bot.AnswerCallbackQuery
type Chat ¶
type Chat struct { // 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. Id int64 `json:"id,omitempty"` // Type of chat, can be either "private", "group", "supergroup" or "channel" Type string `json:"type,omitempty"` // Optional. Title, for supergroups, channels and group chats Title string `json:"title,omitempty"` // Optional. Username, for private chats, supergroups and channels if available Username string `json:"username,omitempty"` // Optional. First name of the other party in a private chat FirstName string `json:"first_name,omitempty"` // Optional. Last name of the other party in a private chat LastName string `json:"last_name,omitempty"` // Optional. Chat photo. Returned only in getChat. Photo *ChatPhoto `json:"photo,omitempty"` // Optional. Bio of the other party in a private chat. Returned only in getChat. Bio string `json:"bio,omitempty"` // Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. Description string `json:"description,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. InviteLink string `json:"invite_link,omitempty"` // Optional. The most recent pinned message (by sending date). Returned only in getChat. PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. Permissions *ChatPermissions `json:"permissions,omitempty"` // Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat. SlowModeDelay int64 `json:"slow_mode_delay,omitempty"` // Optional. For supergroups, name of group sticker set. Returned only in getChat. StickerSetName string `json:"sticker_set_name,omitempty"` // Optional. True, if the bot can change the group sticker set. Returned only in getChat. CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` // Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier 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. Returned only in getChat. LinkedChatId int64 `json:"linked_chat_id,omitempty"` // Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. Location *ChatLocation `json:"location,omitempty"` }
This object represents a chat. https://core.telegram.org/bots/api#chat
func (Chat) DeletePhoto ¶
Helper method for Bot.DeleteChatPhoto
func (Chat) DeleteStickerSet ¶
Helper method for Bot.DeleteChatStickerSet
func (Chat) ExportInviteLink ¶
Helper method for Bot.ExportChatInviteLink
func (Chat) GetAdministrators ¶
func (c Chat) GetAdministrators(b *Bot) ([]ChatMember, error)
Helper method for Bot.GetChatAdministrators
func (Chat) GetMember ¶
func (c Chat) GetMember(b *Bot, userId int64) (*ChatMember, error)
Helper method for Bot.GetChatMember
func (Chat) GetMembersCount ¶
Helper method for Bot.GetChatMembersCount
func (Chat) KickMember ¶
Helper method for Bot.KickChatMember
func (Chat) PinMessage ¶
Helper method for Bot.PinChatMessage
func (Chat) PromoteMember ¶
Helper method for Bot.PromoteChatMember
func (Chat) RestrictMember ¶
func (c Chat) RestrictMember(b *Bot, userId int64, permissions ChatPermissions, opts *RestrictChatMemberOpts) (bool, error)
Helper method for Bot.RestrictChatMember
func (Chat) SendAction ¶
Helper method for Bot.SendChatAction
func (Chat) SendMessage ¶
func (Chat) SetAdministratorCustomTitle ¶
Helper method for Bot.SetChatAdministratorCustomTitle
func (Chat) SetDescription ¶
func (c Chat) SetDescription(b *Bot, opts *SetChatDescriptionOpts) (bool, error)
Helper method for Bot.SetChatDescription
func (Chat) SetPermissions ¶
func (c Chat) SetPermissions(b *Bot, permissions ChatPermissions) (bool, error)
Helper method for Bot.SetChatPermissions
func (Chat) SetStickerSet ¶
Helper method for Bot.SetChatStickerSet
func (Chat) UnbanMember ¶
Helper method for Bot.UnbanChatMember
func (Chat) UnpinAllMessages ¶
Helper method for Bot.UnpinAllChatMessages
func (Chat) UnpinMessage ¶
func (c Chat) UnpinMessage(b *Bot, opts *UnpinChatMessageOpts) (bool, error)
Helper method for Bot.UnpinChatMessage
type ChatLocation ¶
type ChatLocation struct { // The location to which the supergroup is connected. Can't be a live location. Location Location `json:"location,omitempty"` // Location address; 1-64 characters, as defined by the chat owner Address string `json:"address,omitempty"` }
Represents a location to which a chat is connected. https://core.telegram.org/bots/api#chatlocation
type ChatMember ¶
type ChatMember struct { // Information about the user User User `json:"user,omitempty"` // The member's status in the chat. Can be "creator", "administrator", "member", "restricted", "left" or "kicked" Status string `json:"status,omitempty"` // Optional. Owner and administrators only. Custom title for this user CustomTitle string `json:"custom_title,omitempty"` // Optional. Owner and administrators only. True, if the user's presence in the chat is hidden IsAnonymous bool `json:"is_anonymous,omitempty"` // Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user CanBeEdited bool `json:"can_be_edited,omitempty"` // Optional. Administrators only. True, if the administrator can post in the channel; channels only CanPostMessages bool `json:"can_post_messages,omitempty"` // Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Optional. Administrators only. True, if the administrator can delete messages of other users CanDeleteMessages bool `json:"can_delete_messages,omitempty"` // Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members CanRestrictMembers bool `json:"can_restrict_members,omitempty"` // Optional. Administrators only. True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) CanPromoteMembers bool `json:"can_promote_members,omitempty"` // Optional. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings CanChangeInfo bool `json:"can_change_info,omitempty"` // Optional. Administrators and restricted only. True, if the user is allowed to invite new users to the chat CanInviteUsers bool `json:"can_invite_users,omitempty"` // Optional. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. Restricted only. True, if the user is a member of the chat at the moment of the request IsMember bool `json:"is_member,omitempty"` // Optional. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues CanSendMessages bool `json:"can_send_messages,omitempty"` // Optional. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` // Optional. Restricted only. True, if the user is allowed to send polls CanSendPolls bool `json:"can_send_polls,omitempty"` // Optional. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // Optional. Restricted only. True, if the user is allowed to add web page previews to their messages CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` // Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time UntilDate int64 `json:"until_date,omitempty"` }
This object contains information about one member of a chat. https://core.telegram.org/bots/api#chatmember
type ChatPermissions ¶
type ChatPermissions struct { // Optional. True, if the user is allowed to send text messages, contacts, locations and venues CanSendMessages bool `json:"can_send_messages,omitempty"` // Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"` // Optional. True, if the user is allowed to send polls, implies can_send_messages CanSendPolls bool `json:"can_send_polls,omitempty"` // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` // Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups CanChangeInfo bool `json:"can_change_info,omitempty"` // Optional. True, if the user is allowed to invite new users to the chat CanInviteUsers bool `json:"can_invite_users,omitempty"` // Optional. True, if the user is allowed to pin messages. Ignored in public supergroups CanPinMessages bool `json:"can_pin_messages,omitempty"` }
Describes actions that a non-administrator user is allowed to take in a chat. https://core.telegram.org/bots/api#chatpermissions
type ChatPhoto ¶
type ChatPhoto struct { // 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. SmallFileId string `json:"small_file_id,omitempty"` // Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. SmallFileUniqueId string `json:"small_file_unique_id,omitempty"` // 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. BigFileId string `json:"big_file_id,omitempty"` // Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. BigFileUniqueId string `json:"big_file_unique_id,omitempty"` }
This object represents a chat photo. https://core.telegram.org/bots/api#chatphoto
type ChosenInlineResult ¶
type ChosenInlineResult struct { // The unique identifier for the result that was chosen ResultId string `json:"result_id,omitempty"` // The user that chose the result From User `json:"from,omitempty"` // Optional. Sender location, only for bots that require user location Location *Location `json:"location,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. InlineMessageId string `json:"inline_message_id,omitempty"` // The query that was used to obtain the result Query string `json:"query,omitempty"` }
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. https://core.telegram.org/bots/api#choseninlineresult
type Contact ¶
type Contact struct { // Contact's phone number PhoneNumber string `json:"phone_number,omitempty"` // Contact's first name FirstName string `json:"first_name,omitempty"` // Optional. Contact's last name LastName string `json:"last_name,omitempty"` // Optional. Contact's user identifier in Telegram UserId int64 `json:"user_id,omitempty"` // Optional. Additional data about the contact in the form of a vCard Vcard string `json:"vcard,omitempty"` }
This object represents a phone contact. https://core.telegram.org/bots/api#contact
type CopyMessageOpts ¶
type CopyMessageOpts struct { // New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept Caption string // Mode for parsing entities in the new caption. See formatting options for more details. ParseMode string // List of special entities that appear in the new caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
CopyMessageOpts is the set of optional fields for Bot.CopyMessage.
type CreateNewStickerSetOpts ¶
type CreateNewStickerSetOpts struct { // 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 » PngSticker InputFile // TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements TgsSticker InputFile // Pass True, if a set of mask stickers should be created ContainsMasks bool // A JSON-serialized object for position where the mask should be placed on faces MaskPosition MaskPosition }
CreateNewStickerSetOpts is the set of optional fields for Bot.CreateNewStickerSet.
type DeleteWebhookOpts ¶
type DeleteWebhookOpts struct { // Pass True to drop all pending updates DropPendingUpdates bool }
DeleteWebhookOpts is the set of optional fields for Bot.DeleteWebhook.
type Dice ¶
type Dice struct { // Emoji on which the dice throw animation is based Emoji string `json:"emoji,omitempty"` // Value of the dice, 1-6 for "" and "" base emoji, 1-5 for "" and "" base emoji, 1-64 for "" base emoji Value int64 `json:"value,omitempty"` }
This object represents an animated emoji that displays a random value. https://core.telegram.org/bots/api#dice
type Document ¶
type Document struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Optional. Document thumbnail as defined by sender Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Original filename as defined by sender FileName string `json:"file_name,omitempty"` // Optional. MIME type of the file as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents a general file (as opposed to photos, voice messages and audio files). https://core.telegram.org/bots/api#document
type EditMessageCaptionOpts ¶
type EditMessageCaptionOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) ChatId int64 // Required if inline_message_id is not specified. Identifier of the message to edit MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string // New caption of the message, 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the message caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // A JSON-serialized object for an inline keyboard. ReplyMarkup InlineKeyboardMarkup }
EditMessageCaptionOpts is the set of optional fields for Bot.EditMessageCaption.
type EditMessageLiveLocationOpts ¶
type EditMessageLiveLocationOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) ChatId int64 // Required if inline_message_id is not specified. Identifier of the message to edit MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string // The radius of uncertainty for the location, measured in meters; 0-1500 HorizontalAccuracy float64 // Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. Heading int64 // Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. ProximityAlertRadius int64 // A JSON-serialized object for a new inline keyboard. ReplyMarkup InlineKeyboardMarkup }
EditMessageLiveLocationOpts is the set of optional fields for Bot.EditMessageLiveLocation.
type EditMessageMediaOpts ¶
type EditMessageMediaOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) ChatId int64 // Required if inline_message_id is not specified. Identifier of the message to edit MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string // A JSON-serialized object for a new inline keyboard. ReplyMarkup InlineKeyboardMarkup }
EditMessageMediaOpts is the set of optional fields for Bot.EditMessageMedia.
type EditMessageReplyMarkupOpts ¶
type EditMessageReplyMarkupOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) ChatId int64 // Required if inline_message_id is not specified. Identifier of the message to edit MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string // A JSON-serialized object for an inline keyboard. ReplyMarkup InlineKeyboardMarkup }
EditMessageReplyMarkupOpts is the set of optional fields for Bot.EditMessageReplyMarkup.
type EditMessageTextOpts ¶
type EditMessageTextOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) ChatId int64 // Required if inline_message_id is not specified. Identifier of the message to edit MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string // Mode for parsing entities in the message text. See formatting options for more details. ParseMode string // List of special entities that appear in message text, which can be specified instead of parse_mode Entities []MessageEntity // Disables link previews for links in this message DisableWebPagePreview bool // A JSON-serialized object for an inline keyboard. ReplyMarkup InlineKeyboardMarkup }
EditMessageTextOpts is the set of optional fields for Bot.EditMessageText.
type EncryptedCredentials ¶
type EncryptedCredentials struct { // Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication Data string `json:"data,omitempty"` // Base64-encoded data hash for data authentication Hash string `json:"hash,omitempty"` // Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption Secret string `json:"secret,omitempty"` }
Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. https://core.telegram.org/bots/api#encryptedcredentials
type EncryptedPassportElement ¶
type EncryptedPassportElement struct { // 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". Type string `json:"type,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. Data string `json:"data,omitempty"` // Optional. User's verified phone number, available only for "phone_number" type PhoneNumber string `json:"phone_number,omitempty"` // Optional. User's verified email address, available only for "email" type Email string `json:"email,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. Files []PassportFile `json:"files,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. FrontSide *PassportFile `json:"front_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. ReverseSide *PassportFile `json:"reverse_side,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. Selfie *PassportFile `json:"selfie,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. Translation []PassportFile `json:"translation,omitempty"` // Base64-encoded element hash for using in PassportElementErrorUnspecified Hash string `json:"hash,omitempty"` }
Contains information about documents or other Telegram Passport elements shared with the bot by the user. https://core.telegram.org/bots/api#encryptedpassportelement
type File ¶
type File struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Optional. File size, if known FileSize int64 `json:"file_size,omitempty"` // Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. FilePath string `json:"file_path,omitempty"` }
This object 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. https://core.telegram.org/bots/api#file
type ForceReply ¶
type ForceReply struct { // Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' ForceReply bool `json:"force_reply,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. Selective bool `json:"selective,omitempty"` }
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. https://core.telegram.org/bots/api#forcereply
func (ForceReply) ReplyMarkup ¶
func (v ForceReply) ReplyMarkup() ([]byte, error)
type ForwardMessageOpts ¶
type ForwardMessageOpts struct { // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool }
ForwardMessageOpts is the set of optional fields for Bot.ForwardMessage.
type Game ¶
type Game struct { // Title of the game Title string `json:"title,omitempty"` // Description of the game Description string `json:"description,omitempty"` // Photo that will be displayed in the game message in chats. Photo []PhotoSize `json:"photo,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. Text string `json:"text,omitempty"` // Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. Animation that will be displayed in the game message in chats. Upload via BotFather Animation *Animation `json:"animation,omitempty"` }
This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. https://core.telegram.org/bots/api#game
type GameHighScore ¶
type GameHighScore struct { // Position in high score table for the game Position int64 `json:"position,omitempty"` // User User User `json:"user,omitempty"` // Score Score int64 `json:"score,omitempty"` }
This object represents one row of the high scores table for a game. And that's about all we've got for now.If you've got any questions, please check out our Bot FAQ » https://core.telegram.org/bots/api#gamehighscore
type GetGameHighScoresOpts ¶
type GetGameHighScoresOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat ChatId int64 // Required if inline_message_id is not specified. Identifier of the sent message MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string }
GetGameHighScoresOpts is the set of optional fields for Bot.GetGameHighScores.
type GetUpdatesOpts ¶
type GetUpdatesOpts struct { // 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. Offset int64 // Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. Limit int64 // 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. Timeout int64 // A JSON-serialized list of the update types 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. AllowedUpdates []string }
GetUpdatesOpts is the set of optional fields for Bot.GetUpdates.
type GetUserProfilePhotosOpts ¶
type GetUserProfilePhotosOpts struct { // Sequential number of the first photo to be returned. By default, all photos are returned. Offset int64 // Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. Limit int64 }
GetUserProfilePhotosOpts is the set of optional fields for Bot.GetUserProfilePhotos.
type InlineKeyboardButton ¶
type InlineKeyboardButton struct { // Label text on the button Text string `json:"text,omitempty"` // Optional. HTTP or tg:// url to be opened when button is pressed Url string `json:"url,omitempty"` // Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. LoginUrl *LoginUrl `json:"login_url,omitempty"` // Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes CallbackData string `json:"callback_data,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. SwitchInlineQuery string `json:"switch_inline_query,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. SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,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. CallbackGame *CallbackGame `json:"callback_game,omitempty"` // Optional. Specify True, to send a Pay button.NOTE: This type of button must always be the first button in the first row. Pay bool `json:"pay,omitempty"` }
This object represents one button of an inline keyboard. You must use exactly one of the optional fields. https://core.telegram.org/bots/api#inlinekeyboardbutton
type InlineKeyboardMarkup ¶
type InlineKeyboardMarkup struct { // Array of button rows, each represented by an Array of InlineKeyboardButton objects InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard,omitempty"` }
This object 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. https://core.telegram.org/bots/api#inlinekeyboardmarkup
func (InlineKeyboardMarkup) ReplyMarkup ¶
func (v InlineKeyboardMarkup) ReplyMarkup() ([]byte, error)
type InlineQuery ¶
type InlineQuery struct { // Unique identifier for this query Id string `json:"id,omitempty"` // Sender From User `json:"from,omitempty"` // Optional. Sender location, only for bots that request user location Location *Location `json:"location,omitempty"` // Text of the query (up to 256 characters) Query string `json:"query,omitempty"` // Offset of the results to be returned, can be controlled by the bot Offset string `json:"offset,omitempty"` }
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. https://core.telegram.org/bots/api#inlinequery
func (InlineQuery) Answer ¶
func (iq InlineQuery) Answer(b *Bot, results []InlineQueryResult, opts *AnswerInlineQueryOpts) (bool, error)
Helper method for Bot.AnswerInlineQuery
type InlineQueryResult ¶
This object represents one result of an inline query. Telegram clients currently support results of the following 20 types: https://core.telegram.org/bots/api#inlinequeryresult
type InlineQueryResultArticle ¶
type InlineQueryResultArticle struct { // Unique identifier for this result, 1-64 Bytes Id string `json:"id,omitempty"` // Title of the result Title string `json:"title,omitempty"` // Content of the message to be sent InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. URL of the result Url string `json:"url,omitempty"` // Optional. Pass True, if you don't want the URL to be shown in the message HideUrl bool `json:"hide_url,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Url of the thumbnail for the result ThumbUrl string `json:"thumb_url,omitempty"` // Optional. Thumbnail width ThumbWidth int64 `json:"thumb_width,omitempty"` // Optional. Thumbnail height ThumbHeight int64 `json:"thumb_height,omitempty"` }
Represents a link to an article or web page. https://core.telegram.org/bots/api#inlinequeryresultarticle
func (InlineQueryResultArticle) InlineQueryResult ¶
func (v InlineQueryResultArticle) InlineQueryResult() ([]byte, error)
func (InlineQueryResultArticle) MarshalJSON ¶
func (v InlineQueryResultArticle) MarshalJSON() ([]byte, error)
type InlineQueryResultAudio ¶
type InlineQueryResultAudio struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid URL for the audio file AudioUrl string `json:"audio_url,omitempty"` // Title Title string `json:"title,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the audio caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Performer Performer string `json:"performer,omitempty"` // Optional. Audio duration in seconds AudioDuration int64 `json:"audio_duration,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the audio InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultaudio
func (InlineQueryResultAudio) InlineQueryResult ¶
func (v InlineQueryResultAudio) InlineQueryResult() ([]byte, error)
func (InlineQueryResultAudio) MarshalJSON ¶
func (v InlineQueryResultAudio) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedAudio ¶
type InlineQueryResultCachedAudio struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier for the audio file AudioFileId string `json:"audio_file_id,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the audio caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the audio InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedaudio
func (InlineQueryResultCachedAudio) InlineQueryResult ¶
func (v InlineQueryResultCachedAudio) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedAudio) MarshalJSON ¶
func (v InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedDocument ¶
type InlineQueryResultCachedDocument struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // Title for the result Title string `json:"title,omitempty"` // A valid file identifier for the file DocumentFileId string `json:"document_file_id,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the document caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the file InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcacheddocument
func (InlineQueryResultCachedDocument) InlineQueryResult ¶
func (v InlineQueryResultCachedDocument) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedDocument) MarshalJSON ¶
func (v InlineQueryResultCachedDocument) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedGif ¶
type InlineQueryResultCachedGif struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier for the GIF file GifFileId string `json:"gif_file_id,omitempty"` // Optional. Title for the result Title string `json:"title,omitempty"` // Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the GIF animation InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedgif
func (InlineQueryResultCachedGif) InlineQueryResult ¶
func (v InlineQueryResultCachedGif) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedGif) MarshalJSON ¶
func (v InlineQueryResultCachedGif) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedMpeg4Gif ¶
type InlineQueryResultCachedMpeg4Gif struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier for the MP4 file Mpeg4FileId string `json:"mpeg4_file_id,omitempty"` // Optional. Title for the result Title string `json:"title,omitempty"` // Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the video animation InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif
func (InlineQueryResultCachedMpeg4Gif) InlineQueryResult ¶
func (v InlineQueryResultCachedMpeg4Gif) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedMpeg4Gif) MarshalJSON ¶
func (v InlineQueryResultCachedMpeg4Gif) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedPhoto ¶
type InlineQueryResultCachedPhoto struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier of the photo PhotoFileId string `json:"photo_file_id,omitempty"` // Optional. Title for the result Title string `json:"title,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the photo caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the photo InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedphoto
func (InlineQueryResultCachedPhoto) InlineQueryResult ¶
func (v InlineQueryResultCachedPhoto) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedPhoto) MarshalJSON ¶
func (v InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedSticker ¶
type InlineQueryResultCachedSticker struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier of the sticker StickerFileId string `json:"sticker_file_id,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the sticker InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedsticker
func (InlineQueryResultCachedSticker) InlineQueryResult ¶
func (v InlineQueryResultCachedSticker) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedSticker) MarshalJSON ¶
func (v InlineQueryResultCachedSticker) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedVideo ¶
type InlineQueryResultCachedVideo struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier for the video file VideoFileId string `json:"video_file_id,omitempty"` // Title for the result Title string `json:"title,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the video caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the video InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedvideo
func (InlineQueryResultCachedVideo) InlineQueryResult ¶
func (v InlineQueryResultCachedVideo) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedVideo) MarshalJSON ¶
func (v InlineQueryResultCachedVideo) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedVoice ¶
type InlineQueryResultCachedVoice struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid file identifier for the voice message VoiceFileId string `json:"voice_file_id,omitempty"` // Voice message title Title string `json:"title,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the voice message InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcachedvoice
func (InlineQueryResultCachedVoice) InlineQueryResult ¶
func (v InlineQueryResultCachedVoice) InlineQueryResult() ([]byte, error)
func (InlineQueryResultCachedVoice) MarshalJSON ¶
func (v InlineQueryResultCachedVoice) MarshalJSON() ([]byte, error)
type InlineQueryResultContact ¶
type InlineQueryResultContact struct { // Unique identifier for this result, 1-64 Bytes Id string `json:"id,omitempty"` // Contact's phone number PhoneNumber string `json:"phone_number,omitempty"` // Contact's first name FirstName string `json:"first_name,omitempty"` // Optional. Contact's last name LastName string `json:"last_name,omitempty"` // Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes Vcard string `json:"vcard,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the contact InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Url of the thumbnail for the result ThumbUrl string `json:"thumb_url,omitempty"` // Optional. Thumbnail width ThumbWidth int64 `json:"thumb_width,omitempty"` // Optional. Thumbnail height ThumbHeight int64 `json:"thumb_height,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultcontact
func (InlineQueryResultContact) InlineQueryResult ¶
func (v InlineQueryResultContact) InlineQueryResult() ([]byte, error)
func (InlineQueryResultContact) MarshalJSON ¶
func (v InlineQueryResultContact) MarshalJSON() ([]byte, error)
type InlineQueryResultDocument ¶
type InlineQueryResultDocument struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // Title for the result Title string `json:"title,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the document caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A valid URL for the file DocumentUrl string `json:"document_url,omitempty"` // Mime type of the content of the file, either "application/pdf" or "application/zip" MimeType string `json:"mime_type,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the file InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. URL of the thumbnail (jpeg only) for the file ThumbUrl string `json:"thumb_url,omitempty"` // Optional. Thumbnail width ThumbWidth int64 `json:"thumb_width,omitempty"` // Optional. Thumbnail height ThumbHeight int64 `json:"thumb_height,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultdocument
func (InlineQueryResultDocument) InlineQueryResult ¶
func (v InlineQueryResultDocument) InlineQueryResult() ([]byte, error)
func (InlineQueryResultDocument) MarshalJSON ¶
func (v InlineQueryResultDocument) MarshalJSON() ([]byte, error)
type InlineQueryResultGame ¶
type InlineQueryResultGame struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // Short name of the game GameShortName string `json:"game_short_name,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultgame
func (InlineQueryResultGame) InlineQueryResult ¶
func (v InlineQueryResultGame) InlineQueryResult() ([]byte, error)
func (InlineQueryResultGame) MarshalJSON ¶
func (v InlineQueryResultGame) MarshalJSON() ([]byte, error)
type InlineQueryResultGif ¶
type InlineQueryResultGif struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid URL for the GIF file. File size must not exceed 1MB GifUrl string `json:"gif_url,omitempty"` // Optional. Width of the GIF GifWidth int64 `json:"gif_width,omitempty"` // Optional. Height of the GIF GifHeight int64 `json:"gif_height,omitempty"` // Optional. Duration of the GIF GifDuration int64 `json:"gif_duration,omitempty"` // URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result ThumbUrl string `json:"thumb_url,omitempty"` // Optional. MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" ThumbMimeType string `json:"thumb_mime_type,omitempty"` // Optional. Title for the result Title string `json:"title,omitempty"` // Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the GIF animation InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultgif
func (InlineQueryResultGif) InlineQueryResult ¶
func (v InlineQueryResultGif) InlineQueryResult() ([]byte, error)
func (InlineQueryResultGif) MarshalJSON ¶
func (v InlineQueryResultGif) MarshalJSON() ([]byte, error)
type InlineQueryResultLocation ¶
type InlineQueryResultLocation struct { // Unique identifier for this result, 1-64 Bytes Id string `json:"id,omitempty"` // Location latitude in degrees Latitude float64 `json:"latitude,omitempty"` // Location longitude in degrees Longitude float64 `json:"longitude,omitempty"` // Location title Title string `json:"title,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500 HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. LivePeriod int64 `json:"live_period,omitempty"` // Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. Heading int64 `json:"heading,omitempty"` // Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the location InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Url of the thumbnail for the result ThumbUrl string `json:"thumb_url,omitempty"` // Optional. Thumbnail width ThumbWidth int64 `json:"thumb_width,omitempty"` // Optional. Thumbnail height ThumbHeight int64 `json:"thumb_height,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultlocation
func (InlineQueryResultLocation) InlineQueryResult ¶
func (v InlineQueryResultLocation) InlineQueryResult() ([]byte, error)
func (InlineQueryResultLocation) MarshalJSON ¶
func (v InlineQueryResultLocation) MarshalJSON() ([]byte, error)
type InlineQueryResultMpeg4Gif ¶
type InlineQueryResultMpeg4Gif struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid URL for the MP4 file. File size must not exceed 1MB Mpeg4Url string `json:"mpeg4_url,omitempty"` // Optional. Video width Mpeg4Width int64 `json:"mpeg4_width,omitempty"` // Optional. Video height Mpeg4Height int64 `json:"mpeg4_height,omitempty"` // Optional. Video duration Mpeg4Duration int64 `json:"mpeg4_duration,omitempty"` // URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result ThumbUrl string `json:"thumb_url,omitempty"` // Optional. MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" ThumbMimeType string `json:"thumb_mime_type,omitempty"` // Optional. Title for the result Title string `json:"title,omitempty"` // Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the video animation InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif
func (InlineQueryResultMpeg4Gif) InlineQueryResult ¶
func (v InlineQueryResultMpeg4Gif) InlineQueryResult() ([]byte, error)
func (InlineQueryResultMpeg4Gif) MarshalJSON ¶
func (v InlineQueryResultMpeg4Gif) MarshalJSON() ([]byte, error)
type InlineQueryResultPhoto ¶
type InlineQueryResultPhoto struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB PhotoUrl string `json:"photo_url,omitempty"` // URL of the thumbnail for the photo ThumbUrl string `json:"thumb_url,omitempty"` // Optional. Width of the photo PhotoWidth int64 `json:"photo_width,omitempty"` // Optional. Height of the photo PhotoHeight int64 `json:"photo_height,omitempty"` // Optional. Title for the result Title string `json:"title,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the photo caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the photo InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultphoto
func (InlineQueryResultPhoto) InlineQueryResult ¶
func (v InlineQueryResultPhoto) InlineQueryResult() ([]byte, error)
func (InlineQueryResultPhoto) MarshalJSON ¶
func (v InlineQueryResultPhoto) MarshalJSON() ([]byte, error)
type InlineQueryResultVenue ¶
type InlineQueryResultVenue struct { // Unique identifier for this result, 1-64 Bytes Id string `json:"id,omitempty"` // Latitude of the venue location in degrees Latitude float64 `json:"latitude,omitempty"` // Longitude of the venue location in degrees Longitude float64 `json:"longitude,omitempty"` // Title of the venue Title string `json:"title,omitempty"` // Address of the venue Address string `json:"address,omitempty"` // Optional. Foursquare identifier of the venue if known FoursquareId string `json:"foursquare_id,omitempty"` // Optional. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Google Places identifier of the venue GooglePlaceId string `json:"google_place_id,omitempty"` // Optional. Google Places type of the venue. (See supported types.) GooglePlaceType string `json:"google_place_type,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the venue InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` // Optional. Url of the thumbnail for the result ThumbUrl string `json:"thumb_url,omitempty"` // Optional. Thumbnail width ThumbWidth int64 `json:"thumb_width,omitempty"` // Optional. Thumbnail height ThumbHeight int64 `json:"thumb_height,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultvenue
func (InlineQueryResultVenue) InlineQueryResult ¶
func (v InlineQueryResultVenue) InlineQueryResult() ([]byte, error)
func (InlineQueryResultVenue) MarshalJSON ¶
func (v InlineQueryResultVenue) MarshalJSON() ([]byte, error)
type InlineQueryResultVideo ¶
type InlineQueryResultVideo struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid URL for the embedded video player or video file VideoUrl string `json:"video_url,omitempty"` // Mime type of the content of video url, "text/html" or "video/mp4" MimeType string `json:"mime_type,omitempty"` // URL of the thumbnail (jpeg only) for the video ThumbUrl string `json:"thumb_url,omitempty"` // Title for the result Title string `json:"title,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the video caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Video width VideoWidth int64 `json:"video_width,omitempty"` // Optional. Video height VideoHeight int64 `json:"video_height,omitempty"` // Optional. Video duration in seconds VideoDuration int64 `json:"video_duration,omitempty"` // Optional. Short description of the result Description string `json:"description,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,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). InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultvideo
func (InlineQueryResultVideo) InlineQueryResult ¶
func (v InlineQueryResultVideo) InlineQueryResult() ([]byte, error)
func (InlineQueryResultVideo) MarshalJSON ¶
func (v InlineQueryResultVideo) MarshalJSON() ([]byte, error)
type InlineQueryResultVoice ¶
type InlineQueryResultVoice struct { // Unique identifier for this result, 1-64 bytes Id string `json:"id,omitempty"` // A valid URL for the voice recording VoiceUrl string `json:"voice_url,omitempty"` // Recording title Title string `json:"title,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Recording duration in seconds VoiceDuration int64 `json:"voice_duration,omitempty"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Content of the message to be sent instead of the voice recording InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"` }
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. https://core.telegram.org/bots/api#inlinequeryresultvoice
func (InlineQueryResultVoice) InlineQueryResult ¶
func (v InlineQueryResultVoice) InlineQueryResult() ([]byte, error)
func (InlineQueryResultVoice) MarshalJSON ¶
func (v InlineQueryResultVoice) MarshalJSON() ([]byte, error)
type InputContactMessageContent ¶
type InputContactMessageContent struct { // Contact's phone number PhoneNumber string `json:"phone_number,omitempty"` // Contact's first name FirstName string `json:"first_name,omitempty"` // Optional. Contact's last name LastName string `json:"last_name,omitempty"` // Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes Vcard string `json:"vcard,omitempty"` }
Represents the content of a contact message to be sent as the result of an inline query. https://core.telegram.org/bots/api#inputcontactmessagecontent
func (InputContactMessageContent) InputMessageContent ¶
func (v InputContactMessageContent) InputMessageContent() ([]byte, error)
type InputFile ¶
type InputFile interface{}
This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. There are three ways to send files (photos, stickers, audio, media, etc.): Sending by file_id Sending by URL Objects and methods used in the inline mode are described in the Inline mode section. https://core.telegram.org/bots/api#inputfile
type InputLocationMessageContent ¶
type InputLocationMessageContent struct { // Latitude of the location in degrees Latitude float64 `json:"latitude,omitempty"` // Longitude of the location in degrees Longitude float64 `json:"longitude,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500 HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. LivePeriod int64 `json:"live_period,omitempty"` // Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. Heading int64 `json:"heading,omitempty"` // Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"` }
Represents the content of a location message to be sent as the result of an inline query. https://core.telegram.org/bots/api#inputlocationmessagecontent
func (InputLocationMessageContent) InputMessageContent ¶
func (v InputLocationMessageContent) InputMessageContent() ([]byte, error)
type InputMedia ¶
type InputMedia interface {
InputMediaParams(string, map[string]NamedReader) ([]byte, error)
}
This object represents the content of a media message to be sent. It should be one of https://core.telegram.org/bots/api#inputmedia
type InputMediaAnimation ¶
type InputMediaAnimation struct { // 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 » Media InputFile `json:"media,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 » Thumb *InputFile `json:"thumb,omitempty"` // Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the animation caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Animation width Width int64 `json:"width,omitempty"` // Optional. Animation height Height int64 `json:"height,omitempty"` // Optional. Animation duration Duration int64 `json:"duration,omitempty"` }
Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. https://core.telegram.org/bots/api#inputmediaanimation
func (InputMediaAnimation) InputMediaParams ¶
func (v InputMediaAnimation) InputMediaParams(mediaName string, data map[string]NamedReader) ([]byte, error)
func (InputMediaAnimation) MarshalJSON ¶
func (v InputMediaAnimation) MarshalJSON() ([]byte, error)
type InputMediaAudio ¶
type InputMediaAudio struct { // 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 » Media InputFile `json:"media,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 » Thumb *InputFile `json:"thumb,omitempty"` // Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the audio caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Duration of the audio in seconds Duration int64 `json:"duration,omitempty"` // Optional. Performer of the audio Performer string `json:"performer,omitempty"` // Optional. Title of the audio Title string `json:"title,omitempty"` }
Represents an audio file to be treated as music to be sent. https://core.telegram.org/bots/api#inputmediaaudio
func (InputMediaAudio) InputMediaParams ¶
func (v InputMediaAudio) InputMediaParams(mediaName string, data map[string]NamedReader) ([]byte, error)
func (InputMediaAudio) MarshalJSON ¶
func (v InputMediaAudio) MarshalJSON() ([]byte, error)
type InputMediaDocument ¶
type InputMediaDocument struct { // 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 » Media InputFile `json:"media,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 » Thumb *InputFile `json:"thumb,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the document caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"` }
Represents a general file to be sent. https://core.telegram.org/bots/api#inputmediadocument
func (InputMediaDocument) InputMediaParams ¶
func (v InputMediaDocument) InputMediaParams(mediaName string, data map[string]NamedReader) ([]byte, error)
func (InputMediaDocument) MarshalJSON ¶
func (v InputMediaDocument) MarshalJSON() ([]byte, error)
type InputMediaPhoto ¶
type InputMediaPhoto struct { // 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 » Media InputFile `json:"media,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the photo caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` }
Represents a photo to be sent. https://core.telegram.org/bots/api#inputmediaphoto
func (InputMediaPhoto) InputMediaParams ¶
func (v InputMediaPhoto) InputMediaParams(mediaName string, data map[string]NamedReader) ([]byte, error)
func (InputMediaPhoto) MarshalJSON ¶
func (v InputMediaPhoto) MarshalJSON() ([]byte, error)
type InputMediaVideo ¶
type InputMediaVideo struct { // 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 » Media InputFile `json:"media,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 » Thumb *InputFile `json:"thumb,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters after entities parsing Caption string `json:"caption,omitempty"` // Optional. Mode for parsing entities in the video caption. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Video width Width int64 `json:"width,omitempty"` // Optional. Video height Height int64 `json:"height,omitempty"` // Optional. Video duration Duration int64 `json:"duration,omitempty"` // Optional. Pass True, if the uploaded video is suitable for streaming SupportsStreaming bool `json:"supports_streaming,omitempty"` }
Represents a video to be sent. https://core.telegram.org/bots/api#inputmediavideo
func (InputMediaVideo) InputMediaParams ¶
func (v InputMediaVideo) InputMediaParams(mediaName string, data map[string]NamedReader) ([]byte, error)
func (InputMediaVideo) MarshalJSON ¶
func (v InputMediaVideo) MarshalJSON() ([]byte, error)
type InputMessageContent ¶
This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 4 types: https://core.telegram.org/bots/api#inputmessagecontent
type InputTextMessageContent ¶
type InputTextMessageContent struct { // Text of the message to be sent, 1-4096 characters MessageText string `json:"message_text,omitempty"` // Optional. Mode for parsing entities in the message text. See formatting options for more details. ParseMode string `json:"parse_mode,omitempty"` // Optional. List of special entities that appear in message text, which can be specified instead of parse_mode Entities []MessageEntity `json:"entities,omitempty"` // Optional. Disables link previews for links in the sent message DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"` }
Represents the content of a text message to be sent as the result of an inline query. https://core.telegram.org/bots/api#inputtextmessagecontent
func (InputTextMessageContent) InputMessageContent ¶
func (v InputTextMessageContent) InputMessageContent() ([]byte, error)
type InputVenueMessageContent ¶
type InputVenueMessageContent struct { // Latitude of the venue in degrees Latitude float64 `json:"latitude,omitempty"` // Longitude of the venue in degrees Longitude float64 `json:"longitude,omitempty"` // Name of the venue Title string `json:"title,omitempty"` // Address of the venue Address string `json:"address,omitempty"` // Optional. Foursquare identifier of the venue, if known FoursquareId string `json:"foursquare_id,omitempty"` // Optional. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Google Places identifier of the venue GooglePlaceId string `json:"google_place_id,omitempty"` // Optional. Google Places type of the venue. (See supported types.) GooglePlaceType string `json:"google_place_type,omitempty"` }
Represents the content of a venue message to be sent as the result of an inline query. https://core.telegram.org/bots/api#inputvenuemessagecontent
func (InputVenueMessageContent) InputMessageContent ¶
func (v InputVenueMessageContent) InputMessageContent() ([]byte, error)
type Invoice ¶
type Invoice struct { // Product name Title string `json:"title,omitempty"` // Product description Description string `json:"description,omitempty"` // Unique bot deep-linking parameter that can be used to generate this invoice StartParameter string `json:"start_parameter,omitempty"` // Three-letter ISO 4217 currency code Currency string `json:"currency,omitempty"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount,omitempty"` }
This object contains basic information about an invoice. https://core.telegram.org/bots/api#invoice
type KeyboardButton ¶
type KeyboardButton struct { // Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed Text string `json:"text,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 RequestContact bool `json:"request_contact,omitempty"` // Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only RequestLocation bool `json:"request_location,omitempty"` // Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only RequestPoll *KeyboardButtonPollType `json:"request_poll,omitempty"` }
This object 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 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. https://core.telegram.org/bots/api#keyboardbutton
type KeyboardButtonPollType ¶
type KeyboardButtonPollType struct { // Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. Type string `json:"type,omitempty"` }
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. https://core.telegram.org/bots/api#keyboardbuttonpolltype
type KickChatMemberOpts ¶
type KickChatMemberOpts struct { // 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 UntilDate int64 }
KickChatMemberOpts is the set of optional fields for Bot.KickChatMember.
type LabeledPrice ¶
type LabeledPrice struct { // Portion label Label string `json:"label,omitempty"` // 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). Amount int64 `json:"amount,omitempty"` }
This object represents a portion of the price for goods or services. https://core.telegram.org/bots/api#labeledprice
type Location ¶
type Location struct { // Longitude as defined by sender Longitude float64 `json:"longitude,omitempty"` // Latitude as defined by sender Latitude float64 `json:"latitude,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500 HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. Time relative to the message sending date, during which the location can be updated, in seconds. For active live locations only. LivePeriod int64 `json:"live_period,omitempty"` // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. Heading int64 `json:"heading,omitempty"` // Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"` }
This object represents a point on the map. https://core.telegram.org/bots/api#location
type LoginUrl ¶
type LoginUrl struct { // 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. Url string `json:"url,omitempty"` // Optional. New text of the button in forwarded messages. ForwardText string `json:"forward_text,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. BotUsername string `json:"bot_username,omitempty"` // Optional. Pass True to request the permission for your bot to send messages to the user. RequestWriteAccess bool `json:"request_write_access,omitempty"` }
This object 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. https://core.telegram.org/bots/api#loginurl
type MaskPosition ¶
type MaskPosition struct { // The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". Point string `json:"point,omitempty"` // 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. XShift float64 `json:"x_shift,omitempty"` // 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. YShift float64 `json:"y_shift,omitempty"` // Mask scaling coefficient. For example, 2.0 means double size. Scale float64 `json:"scale,omitempty"` }
This object describes the position on faces where a mask should be placed by default. https://core.telegram.org/bots/api#maskposition
type Message ¶
type Message struct { // Unique message identifier inside this chat MessageId int64 `json:"message_id,omitempty"` // Optional. Sender, empty for messages sent to channels From *User `json:"from,omitempty"` // Optional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group SenderChat *Chat `json:"sender_chat,omitempty"` // Date the message was sent in Unix time Date int64 `json:"date,omitempty"` // Conversation the message belongs to Chat Chat `json:"chat,omitempty"` // Optional. For forwarded messages, sender of the original message ForwardFrom *User `json:"forward_from,omitempty"` // Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat ForwardFromChat *Chat `json:"forward_from_chat,omitempty"` // Optional. For messages forwarded from channels, identifier of the original message in the channel ForwardFromMessageId int64 `json:"forward_from_message_id,omitempty"` // Optional. For messages forwarded from channels, signature of the post author if present ForwardSignature string `json:"forward_signature,omitempty"` // Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages ForwardSenderName string `json:"forward_sender_name,omitempty"` // Optional. For forwarded messages, date the original message was sent in Unix time ForwardDate int64 `json:"forward_date,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. ReplyToMessage *Message `json:"reply_to_message,omitempty"` // Optional. Bot through which the message was sent ViaBot *User `json:"via_bot,omitempty"` // Optional. Date the message was last edited in Unix time EditDate int64 `json:"edit_date,omitempty"` // Optional. The unique identifier of a media message group this message belongs to MediaGroupId string `json:"media_group_id,omitempty"` // Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator AuthorSignature string `json:"author_signature,omitempty"` // Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters Text string `json:"text,omitempty"` // Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text Entities []MessageEntity `json:"entities,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 Animation *Animation `json:"animation,omitempty"` // Optional. Message is an audio file, information about the file Audio *Audio `json:"audio,omitempty"` // Optional. Message is a general file, information about the file Document *Document `json:"document,omitempty"` // Optional. Message is a photo, available sizes of the photo Photo []PhotoSize `json:"photo,omitempty"` // Optional. Message is a sticker, information about the sticker Sticker *Sticker `json:"sticker,omitempty"` // Optional. Message is a video, information about the video Video *Video `json:"video,omitempty"` // Optional. Message is a video note, information about the video message VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a voice message, information about the file Voice *Voice `json:"voice,omitempty"` // Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters Caption string `json:"caption,omitempty"` // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. Message is a shared contact, information about the contact Contact *Contact `json:"contact,omitempty"` // Optional. Message is a dice with random value from 1 to 6 Dice *Dice `json:"dice,omitempty"` // Optional. Message is a game, information about the game. More about games » Game *Game `json:"game,omitempty"` // Optional. Message is a native poll, information about the poll Poll *Poll `json:"poll,omitempty"` // Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set Venue *Venue `json:"venue,omitempty"` // Optional. Message is a shared location, information about the location Location *Location `json:"location,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) NewChatMembers []User `json:"new_chat_members,omitempty"` // Optional. A member was removed from the group, information about them (this member may be the bot itself) LeftChatMember *User `json:"left_chat_member,omitempty"` // Optional. A chat title was changed to this value NewChatTitle string `json:"new_chat_title,omitempty"` // Optional. A chat photo was change to this value NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"` // Optional. Service message: the chat photo was deleted DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"` // Optional. Service message: the group has been created GroupChatCreated bool `json:"group_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. SupergroupChatCreated bool `json:"supergroup_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. ChannelChatCreated bool `json:"channel_chat_created,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. MigrateToChatId int64 `json:"migrate_to_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. MigrateFromChatId int64 `json:"migrate_from_chat_id,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. PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. Message is an invoice for a payment, information about the invoice. More about payments » Invoice *Invoice `json:"invoice,omitempty"` // Optional. Message is a service message about a successful payment, information about the payment. More about payments » SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` // Optional. The domain name of the website on which the user has logged in. More about Telegram Login » ConnectedWebsite string `json:"connected_website,omitempty"` // Optional. Telegram Passport data PassportData *PassportData `json:"passport_data,omitempty"` // Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"` // Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
This object represents a message. https://core.telegram.org/bots/api#message
func (Message) EditCaption ¶
func (m Message) EditCaption(b *Bot, opts *EditMessageCaptionOpts) (*Message, error)
Helper method for Bot.EditMessageCaption
func (Message) EditLiveLocation ¶
func (m Message) EditLiveLocation(b *Bot, latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, error)
Helper method for Bot.EditMessageLiveLocation
func (Message) EditMedia ¶
func (m Message) EditMedia(b *Bot, media InputMedia, opts *EditMessageMediaOpts) (*Message, error)
Helper method for Bot.EditMessageMedia
func (Message) EditReplyMarkup ¶
func (m Message) EditReplyMarkup(b *Bot, opts *EditMessageReplyMarkupOpts) (*Message, error)
Helper method for Bot.EditMessageReplyMarkup
func (Message) OriginalCaptionHTML ¶
func (Message) OriginalCaptionMD ¶
func (Message) OriginalCaptionMDV2 ¶
func (Message) OriginalHTML ¶
func (Message) OriginalMD ¶
func (Message) OriginalMDV2 ¶
func (Message) ParseCaptionEntities ¶
func (m Message) ParseCaptionEntities() (out []ParsedMessageEntity)
func (Message) ParseCaptionEntity ¶
func (m Message) ParseCaptionEntity(entity MessageEntity) ParsedMessageEntity
func (Message) ParseCaptionEntityTypes ¶
func (m Message) ParseCaptionEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)
func (Message) ParseEntities ¶
func (m Message) ParseEntities() (out []ParsedMessageEntity)
func (Message) ParseEntity ¶
func (m Message) ParseEntity(entity MessageEntity) ParsedMessageEntity
func (Message) ParseEntityTypes ¶
func (m Message) ParseEntityTypes(accepted map[string]struct{}) (out []ParsedMessageEntity)
func (Message) Pin ¶
func (m Message) Pin(b *Bot, opts *PinChatMessageOpts) (bool, error)
Helper method for Bot.PinChatMessage
func (Message) StopLiveLocation ¶
func (m Message) StopLiveLocation(b *Bot, opts *StopMessageLiveLocationOpts) (*Message, error)
Helper method for Bot.StopMessageLiveLocation
type MessageEntity ¶
type MessageEntity struct { // Type of the entity. Can be "mention" (@username), "hashtag" (#hashtag), "cashtag" ($USD), "bot_command" (/start@jobs_bot), "url" (https://telegram.org), "email" (do-not-reply@telegram.org), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames) Type string `json:"type,omitempty"` // Offset in UTF-16 code units to the start of the entity Offset int64 `json:"offset,omitempty"` // Length of the entity in UTF-16 code units Length int64 `json:"length,omitempty"` // Optional. For "text_link" only, url that will be opened after user taps on the text Url string `json:"url,omitempty"` // Optional. For "text_mention" only, the mentioned user User *User `json:"user,omitempty"` // Optional. For "pre" only, the programming language of the entity text Language string `json:"language,omitempty"` }
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. https://core.telegram.org/bots/api#messageentity
type MessageId ¶
type MessageId struct { // Unique message identifier MessageId int64 `json:"message_id,omitempty"` }
This object represents a unique message identifier. https://core.telegram.org/bots/api#messageid
type NamedReader ¶
type OrderInfo ¶
type OrderInfo struct { // Optional. User name Name string `json:"name,omitempty"` // Optional. User's phone number PhoneNumber string `json:"phone_number,omitempty"` // Optional. User email Email string `json:"email,omitempty"` // Optional. User shipping address ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` }
This object represents information about an order. https://core.telegram.org/bots/api#orderinfo
type ParsedMessageEntity ¶
type ParsedMessageEntity struct { MessageEntity Text string `json:"text"` }
type PassportData ¶
type PassportData struct { // Array with information about documents and other Telegram Passport elements that was shared with the bot Data []EncryptedPassportElement `json:"data,omitempty"` // Encrypted credentials required to decrypt the data Credentials EncryptedCredentials `json:"credentials,omitempty"` }
Contains information about Telegram Passport data shared with the bot by the user. https://core.telegram.org/bots/api#passportdata
type 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: https://core.telegram.org/bots/api#passportelementerror
type PassportElementErrorDataField ¶
type PassportElementErrorDataField struct { // Error source, must be data Source string `json:"source,omitempty"` // The section of the user's Telegram Passport which has the error, one of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address" Type string `json:"type,omitempty"` // Name of the data field which has the error FieldName string `json:"field_name,omitempty"` // Base64-encoded data hash DataHash string `json:"data_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
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. https://core.telegram.org/bots/api#passportelementerrordatafield
func (PassportElementErrorDataField) PassportElementError ¶
func (v PassportElementErrorDataField) PassportElementError() ([]byte, error)
type PassportElementErrorFile ¶
type PassportElementErrorFile struct { // Error source, must be file Source string `json:"source,omitempty"` // The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" Type string `json:"type,omitempty"` // Base64-encoded file hash FileHash string `json:"file_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. https://core.telegram.org/bots/api#passportelementerrorfile
func (PassportElementErrorFile) PassportElementError ¶
func (v PassportElementErrorFile) PassportElementError() ([]byte, error)
type PassportElementErrorFiles ¶
type PassportElementErrorFiles struct { // Error source, must be files Source string `json:"source,omitempty"` // The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" Type string `json:"type,omitempty"` // List of base64-encoded file hashes FileHashes []string `json:"file_hashes,omitempty"` // Error message Message string `json:"message,omitempty"` }
Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. https://core.telegram.org/bots/api#passportelementerrorfiles
func (PassportElementErrorFiles) PassportElementError ¶
func (v PassportElementErrorFiles) PassportElementError() ([]byte, error)
type PassportElementErrorFrontSide ¶
type PassportElementErrorFrontSide struct { // Error source, must be front_side Source string `json:"source,omitempty"` // The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport" Type string `json:"type,omitempty"` // Base64-encoded hash of the file with the front side of the document FileHash string `json:"file_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
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. https://core.telegram.org/bots/api#passportelementerrorfrontside
func (PassportElementErrorFrontSide) PassportElementError ¶
func (v PassportElementErrorFrontSide) PassportElementError() ([]byte, error)
type PassportElementErrorReverseSide ¶
type PassportElementErrorReverseSide struct { // Error source, must be reverse_side Source string `json:"source,omitempty"` // The section of the user's Telegram Passport which has the issue, one of "driver_license", "identity_card" Type string `json:"type,omitempty"` // Base64-encoded hash of the file with the reverse side of the document FileHash string `json:"file_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
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. https://core.telegram.org/bots/api#passportelementerrorreverseside
func (PassportElementErrorReverseSide) PassportElementError ¶
func (v PassportElementErrorReverseSide) PassportElementError() ([]byte, error)
type PassportElementErrorSelfie ¶
type PassportElementErrorSelfie struct { // Error source, must be selfie Source string `json:"source,omitempty"` // The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport" Type string `json:"type,omitempty"` // Base64-encoded hash of the file with the selfie FileHash string `json:"file_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. https://core.telegram.org/bots/api#passportelementerrorselfie
func (PassportElementErrorSelfie) PassportElementError ¶
func (v PassportElementErrorSelfie) PassportElementError() ([]byte, error)
type PassportElementErrorTranslationFile ¶
type PassportElementErrorTranslationFile struct { // Error source, must be translation_file Source string `json:"source,omitempty"` // 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" Type string `json:"type,omitempty"` // Base64-encoded file hash FileHash string `json:"file_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. https://core.telegram.org/bots/api#passportelementerrortranslationfile
func (PassportElementErrorTranslationFile) PassportElementError ¶
func (v PassportElementErrorTranslationFile) PassportElementError() ([]byte, error)
type PassportElementErrorTranslationFiles ¶
type PassportElementErrorTranslationFiles struct { // Error source, must be translation_files Source string `json:"source,omitempty"` // 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" Type string `json:"type,omitempty"` // List of base64-encoded file hashes FileHashes []string `json:"file_hashes,omitempty"` // Error message Message string `json:"message,omitempty"` }
Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. https://core.telegram.org/bots/api#passportelementerrortranslationfiles
func (PassportElementErrorTranslationFiles) PassportElementError ¶
func (v PassportElementErrorTranslationFiles) PassportElementError() ([]byte, error)
type PassportElementErrorUnspecified ¶
type PassportElementErrorUnspecified struct { // Error source, must be unspecified Source string `json:"source,omitempty"` // Type of element of the user's Telegram Passport which has the issue Type string `json:"type,omitempty"` // Base64-encoded element hash ElementHash string `json:"element_hash,omitempty"` // Error message Message string `json:"message,omitempty"` }
Represents an issue in an unspecified place. The error is considered resolved when new data is added. https://core.telegram.org/bots/api#passportelementerrorunspecified
func (PassportElementErrorUnspecified) PassportElementError ¶
func (v PassportElementErrorUnspecified) PassportElementError() ([]byte, error)
type PassportFile ¶
type PassportFile struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // File size FileSize int64 `json:"file_size,omitempty"` // Unix time when the file was uploaded FileDate int64 `json:"file_date,omitempty"` }
This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. https://core.telegram.org/bots/api#passportfile
type PhotoSize ¶
type PhotoSize struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Photo width Width int64 `json:"width,omitempty"` // Photo height Height int64 `json:"height,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents one size of a photo or a file / sticker thumbnail. https://core.telegram.org/bots/api#photosize
type PinChatMessageOpts ¶
type PinChatMessageOpts struct { // 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 and private chats. DisableNotification bool }
PinChatMessageOpts is the set of optional fields for Bot.PinChatMessage.
type Poll ¶
type Poll struct { // Unique poll identifier Id string `json:"id,omitempty"` // Poll question, 1-255 characters Question string `json:"question,omitempty"` // List of poll options Options []PollOption `json:"options,omitempty"` // Total number of users that voted in the poll TotalVoterCount int64 `json:"total_voter_count,omitempty"` // True, if the poll is closed IsClosed bool `json:"is_closed,omitempty"` // True, if the poll is anonymous IsAnonymous bool `json:"is_anonymous,omitempty"` // Poll type, currently can be "regular" or "quiz" Type string `json:"type,omitempty"` // True, if the poll allows multiple answers AllowsMultipleAnswers bool `json:"allows_multiple_answers,omitempty"` // Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. CorrectOptionId int64 `json:"correct_option_id,omitempty"` // Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters Explanation string `json:"explanation,omitempty"` // Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` // Optional. Amount of time in seconds the poll will be active after creation OpenPeriod int64 `json:"open_period,omitempty"` // Optional. Point in time (Unix timestamp) when the poll will be automatically closed CloseDate int64 `json:"close_date,omitempty"` }
This object contains information about a poll. https://core.telegram.org/bots/api#poll
type PollAnswer ¶
type PollAnswer struct { // Unique poll identifier PollId string `json:"poll_id,omitempty"` // The user, who changed the answer to the poll User User `json:"user,omitempty"` // 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. OptionIds []int64 `json:"option_ids,omitempty"` }
This object represents an answer of a user in a non-anonymous poll. https://core.telegram.org/bots/api#pollanswer
type PollOption ¶
type PollOption struct { // Option text, 1-100 characters Text string `json:"text,omitempty"` // Number of users that voted for this option VoterCount int64 `json:"voter_count,omitempty"` }
This object contains information about one answer option in a poll. https://core.telegram.org/bots/api#polloption
type PreCheckoutQuery ¶
type PreCheckoutQuery struct { // Unique query identifier Id string `json:"id,omitempty"` // User who sent the query From User `json:"from,omitempty"` // Three-letter ISO 4217 currency code Currency string `json:"currency,omitempty"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount,omitempty"` // Bot specified invoice payload InvoicePayload string `json:"invoice_payload,omitempty"` // Optional. Identifier of the shipping option chosen by the user ShippingOptionId string `json:"shipping_option_id,omitempty"` // Optional. Order info provided by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` }
This object contains information about an incoming pre-checkout query. https://core.telegram.org/bots/api#precheckoutquery
func (PreCheckoutQuery) Answer ¶
func (pcq PreCheckoutQuery) Answer(b *Bot, ok bool, opts *AnswerPreCheckoutQueryOpts) (bool, error)
Helper method for Bot.AnswerPreCheckoutQuery
type PromoteChatMemberOpts ¶
type PromoteChatMemberOpts struct { // Pass True, if the administrator's presence in the chat is hidden IsAnonymous bool // Pass True, if the administrator can change chat title, photo and other settings CanChangeInfo bool // Pass True, if the administrator can create channel posts, channels only CanPostMessages bool // Pass True, if the administrator can edit messages of other users and can pin messages, channels only CanEditMessages bool // Pass True, if the administrator can delete messages of other users CanDeleteMessages bool // Pass True, if the administrator can invite new users to the chat CanInviteUsers bool // Pass True, if the administrator can restrict, ban or unban chat members CanRestrictMembers bool // Pass True, if the administrator can pin messages, supergroups only CanPinMessages bool // Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) CanPromoteMembers bool }
PromoteChatMemberOpts is the set of optional fields for Bot.PromoteChatMember.
type ProximityAlertTriggered ¶
type ProximityAlertTriggered struct { // User that triggered the alert Traveler User `json:"traveler,omitempty"` // User that set the alert Watcher User `json:"watcher,omitempty"` // The distance between the users Distance int64 `json:"distance,omitempty"` }
This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. https://core.telegram.org/bots/api#proximityalerttriggered
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct { // Array of button rows, each represented by an Array of KeyboardButton objects Keyboard [][]KeyboardButton `json:"keyboard,omitempty"` // 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. ResizeKeyboard bool `json:"resize_keyboard,omitempty"` // 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. OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"` // 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. Selective bool `json:"selective,omitempty"` }
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). https://core.telegram.org/bots/api#replykeyboardmarkup
func (ReplyKeyboardMarkup) ReplyMarkup ¶
func (v ReplyKeyboardMarkup) ReplyMarkup() ([]byte, error)
type ReplyKeyboardRemove ¶
type ReplyKeyboardRemove struct { // 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) RemoveKeyboard bool `json:"remove_keyboard,omitempty"` // 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. Selective bool `json:"selective,omitempty"` }
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). https://core.telegram.org/bots/api#replykeyboardremove
func (ReplyKeyboardRemove) ReplyMarkup ¶
func (v ReplyKeyboardRemove) ReplyMarkup() ([]byte, error)
type ReplyMarkup ¶
type Response ¶
type Response struct { Ok bool `json:"ok"` Result json.RawMessage `json:"result"` ErrorCode int `json:"error_code"` Description string `json:"description"` Parameters ResponseParameters `json:"parameters"` }
type ResponseParameters ¶
type ResponseParameters struct { // 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. MigrateToChatId int64 `json:"migrate_to_chat_id,omitempty"` // Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated RetryAfter int64 `json:"retry_after,omitempty"` }
Contains information about why a request was unsuccessful. https://core.telegram.org/bots/api#responseparameters
type RestrictChatMemberOpts ¶
type RestrictChatMemberOpts struct { // 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 UntilDate int64 }
RestrictChatMemberOpts is the set of optional fields for Bot.RestrictChatMember.
type SendAnimationOpts ¶
type SendAnimationOpts struct { // Duration of sent animation in seconds Duration int64 // Animation width Width int64 // Animation height Height int64 // 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 » Thumb InputFile // Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the animation caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendAnimationOpts is the set of optional fields for Bot.SendAnimation.
type SendAudioOpts ¶
type SendAudioOpts struct { // Audio caption, 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the audio caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Duration of the audio in seconds Duration int64 // Performer Performer string // Track name Title string // 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 » Thumb InputFile // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendAudioOpts is the set of optional fields for Bot.SendAudio.
type SendContactOpts ¶
type SendContactOpts struct { // Contact's last name LastName string // Additional data about the contact in the form of a vCard, 0-2048 bytes Vcard string // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendContactOpts is the set of optional fields for Bot.SendContact.
type SendDiceOpts ¶
type SendDiceOpts struct { // Emoji on which the dice throw animation is based. Currently, must be one of "", "", "", "", or "". Dice can have values 1-6 for "" and "", values 1-5 for "" and "", and values 1-64 for "". Defaults to "" Emoji string // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendDiceOpts is the set of optional fields for Bot.SendDice.
type SendDocumentOpts ¶
type SendDocumentOpts struct { // 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 » Thumb InputFile // Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the document caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Disables automatic server-side content type detection for files uploaded using multipart/form-data DisableContentTypeDetection bool // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendDocumentOpts is the set of optional fields for Bot.SendDocument.
type SendGameOpts ¶
type SendGameOpts struct { // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup InlineKeyboardMarkup }
SendGameOpts is the set of optional fields for Bot.SendGame.
type SendInvoiceOpts ¶
type SendInvoiceOpts struct { // A JSON-serialized 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. ProviderData string // 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. PhotoUrl string // Photo size PhotoSize int64 // Photo width PhotoWidth int64 // Photo height PhotoHeight int64 // Pass True, if you require the user's full name to complete the order NeedName bool // Pass True, if you require the user's phone number to complete the order NeedPhoneNumber bool // Pass True, if you require the user's email address to complete the order NeedEmail bool // Pass True, if you require the user's shipping address to complete the order NeedShippingAddress bool // Pass True, if user's phone number should be sent to provider SendPhoneNumberToProvider bool // Pass True, if user's email address should be sent to provider SendEmailToProvider bool // Pass True, if the final price depends on the shipping method IsFlexible bool // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup InlineKeyboardMarkup }
SendInvoiceOpts is the set of optional fields for Bot.SendInvoice.
type SendLocationOpts ¶
type SendLocationOpts struct { // The radius of uncertainty for the location, measured in meters; 0-1500 HorizontalAccuracy float64 // Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. LivePeriod int64 // For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. Heading int64 // For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. ProximityAlertRadius int64 // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendLocationOpts is the set of optional fields for Bot.SendLocation.
type SendMediaGroupOpts ¶
type SendMediaGroupOpts struct { // Sends messages silently. Users will receive a notification with no sound. DisableNotification bool // If the messages are a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool }
SendMediaGroupOpts is the set of optional fields for Bot.SendMediaGroup.
type SendMessageOpts ¶
type SendMessageOpts struct { // Mode for parsing entities in the message text. See formatting options for more details. ParseMode string // List of special entities that appear in message text, which can be specified instead of parse_mode Entities []MessageEntity // Disables link previews for links in this message DisableWebPagePreview bool // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendMessageOpts is the set of optional fields for Bot.SendMessage.
type SendPhotoOpts ¶
type SendPhotoOpts struct { // Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the photo caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendPhotoOpts is the set of optional fields for Bot.SendPhoto.
type SendPollOpts ¶
type SendPollOpts struct { // True, if the poll needs to be anonymous, defaults to True IsAnonymous bool // Poll type, "quiz" or "regular", defaults to "regular" Type string // True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False AllowsMultipleAnswers bool // 0-based identifier of the correct answer option, required for polls in quiz mode CorrectOptionId int64 // Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing Explanation string // Mode for parsing entities in the explanation. See formatting options for more details. ExplanationParseMode string // List of special entities that appear in the poll explanation, which can be specified instead of parse_mode ExplanationEntities []MessageEntity // Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. OpenPeriod int64 // Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period. CloseDate int64 // Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. IsClosed bool // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendPollOpts is the set of optional fields for Bot.SendPoll.
type SendStickerOpts ¶
type SendStickerOpts struct { // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendStickerOpts is the set of optional fields for Bot.SendSticker.
type SendVenueOpts ¶
type SendVenueOpts struct { // Foursquare identifier of the venue FoursquareId string // Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) FoursquareType string // Google Places identifier of the venue GooglePlaceId string // Google Places type of the venue. (See supported types.) GooglePlaceType string // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendVenueOpts is the set of optional fields for Bot.SendVenue.
type SendVideoNoteOpts ¶
type SendVideoNoteOpts struct { // Duration of sent video in seconds Duration int64 // Video width and height, i.e. diameter of the video message Length int64 // 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 » Thumb InputFile // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendVideoNoteOpts is the set of optional fields for Bot.SendVideoNote.
type SendVideoOpts ¶
type SendVideoOpts struct { // Duration of sent video in seconds Duration int64 // Video width Width int64 // Video height Height int64 // 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 » Thumb InputFile // Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the video caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Pass True, if the uploaded video is suitable for streaming SupportsStreaming bool // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendVideoOpts is the set of optional fields for Bot.SendVideo.
type SendVoiceOpts ¶
type SendVoiceOpts struct { // Voice message caption, 0-1024 characters after entities parsing Caption string // Mode for parsing entities in the voice message caption. See formatting options for more details. ParseMode string // List of special entities that appear in the caption, which can be specified instead of parse_mode CaptionEntities []MessageEntity // Duration of the voice message in seconds Duration int64 // Sends the message silently. Users will receive a notification with no sound. DisableNotification bool // If the message is a reply, ID of the original message ReplyToMessageId int64 // Pass True, if the message should be sent even if the specified replied-to message is not found AllowSendingWithoutReply bool // 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. ReplyMarkup ReplyMarkup }
SendVoiceOpts is the set of optional fields for Bot.SendVoice.
type SetChatDescriptionOpts ¶
type SetChatDescriptionOpts struct { // New chat description, 0-255 characters Description string }
SetChatDescriptionOpts is the set of optional fields for Bot.SetChatDescription.
type SetGameScoreOpts ¶
type SetGameScoreOpts struct { // Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters Force bool // Pass True, if the game message should not be automatically edited to include the current scoreboard DisableEditMessage bool // Required if inline_message_id is not specified. Unique identifier for the target chat ChatId int64 // Required if inline_message_id is not specified. Identifier of the sent message MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string }
SetGameScoreOpts is the set of optional fields for Bot.SetGameScore.
type SetStickerSetThumbOpts ¶
type SetStickerSetThumbOpts struct { // A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. 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 ». Animated sticker set thumbnail can't be uploaded via HTTP URL. Thumb InputFile }
SetStickerSetThumbOpts is the set of optional fields for Bot.SetStickerSetThumb.
type SetWebhookOpts ¶
type SetWebhookOpts struct { // Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details. Certificate InputFile // The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS IpAddress string // 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. MaxConnections int64 // A JSON-serialized list of the update types 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. AllowedUpdates []string // Pass True to drop all pending updates DropPendingUpdates bool }
SetWebhookOpts is the set of optional fields for Bot.SetWebhook.
type ShippingAddress ¶
type ShippingAddress struct { // ISO 3166-1 alpha-2 country code CountryCode string `json:"country_code,omitempty"` // State, if applicable State string `json:"state,omitempty"` // City City string `json:"city,omitempty"` // First line for the address StreetLine1 string `json:"street_line1,omitempty"` // Second line for the address StreetLine2 string `json:"street_line2,omitempty"` // Address post code PostCode string `json:"post_code,omitempty"` }
This object represents a shipping address. https://core.telegram.org/bots/api#shippingaddress
type ShippingOption ¶
type ShippingOption struct { // Shipping option identifier Id string `json:"id,omitempty"` // Option title Title string `json:"title,omitempty"` // List of price portions Prices []LabeledPrice `json:"prices,omitempty"` }
This object represents one shipping option. https://core.telegram.org/bots/api#shippingoption
type ShippingQuery ¶
type ShippingQuery struct { // Unique query identifier Id string `json:"id,omitempty"` // User who sent the query From User `json:"from,omitempty"` // Bot specified invoice payload InvoicePayload string `json:"invoice_payload,omitempty"` // User specified shipping address ShippingAddress ShippingAddress `json:"shipping_address,omitempty"` }
This object contains information about an incoming shipping query. https://core.telegram.org/bots/api#shippingquery
func (ShippingQuery) Answer ¶
func (sq ShippingQuery) Answer(b *Bot, ok bool, opts *AnswerShippingQueryOpts) (bool, error)
Helper method for Bot.AnswerShippingQuery
type Sticker ¶
type Sticker struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Sticker width Width int64 `json:"width,omitempty"` // Sticker height Height int64 `json:"height,omitempty"` // True, if the sticker is animated IsAnimated bool `json:"is_animated,omitempty"` // Optional. Sticker thumbnail in the .WEBP or .JPG format Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Emoji associated with the sticker Emoji string `json:"emoji,omitempty"` // Optional. Name of the sticker set to which the sticker belongs SetName string `json:"set_name,omitempty"` // Optional. For mask stickers, the position where the mask should be placed MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents a sticker. https://core.telegram.org/bots/api#sticker
type StickerSet ¶
type StickerSet struct { // Sticker set name Name string `json:"name,omitempty"` // Sticker set title Title string `json:"title,omitempty"` // True, if the sticker set contains animated stickers IsAnimated bool `json:"is_animated,omitempty"` // True, if the sticker set contains masks ContainsMasks bool `json:"contains_masks,omitempty"` // List of all set stickers Stickers []Sticker `json:"stickers,omitempty"` // Optional. Sticker set thumbnail in the .WEBP or .TGS format Thumb *PhotoSize `json:"thumb,omitempty"` }
This object represents a sticker set. https://core.telegram.org/bots/api#stickerset
type StopMessageLiveLocationOpts ¶
type StopMessageLiveLocationOpts struct { // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) ChatId int64 // Required if inline_message_id is not specified. Identifier of the message with live location to stop MessageId int64 // Required if chat_id and message_id are not specified. Identifier of the inline message InlineMessageId string // A JSON-serialized object for a new inline keyboard. ReplyMarkup InlineKeyboardMarkup }
StopMessageLiveLocationOpts is the set of optional fields for Bot.StopMessageLiveLocation.
type StopPollOpts ¶
type StopPollOpts struct { // A JSON-serialized object for a new message inline keyboard. ReplyMarkup InlineKeyboardMarkup }
StopPollOpts is the set of optional fields for Bot.StopPoll.
type SuccessfulPayment ¶
type SuccessfulPayment struct { // Three-letter ISO 4217 currency code Currency string `json:"currency,omitempty"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int64 `json:"total_amount,omitempty"` // Bot specified invoice payload InvoicePayload string `json:"invoice_payload,omitempty"` // Optional. Identifier of the shipping option chosen by the user ShippingOptionId string `json:"shipping_option_id,omitempty"` // Optional. Order info provided by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` // Telegram payment identifier TelegramPaymentChargeId string `json:"telegram_payment_charge_id,omitempty"` // Provider payment identifier ProviderPaymentChargeId string `json:"provider_payment_charge_id,omitempty"` }
This object contains basic information about a successful payment. https://core.telegram.org/bots/api#successfulpayment
type TelegramError ¶
func (*TelegramError) Error ¶
func (t *TelegramError) Error() string
type UnbanChatMemberOpts ¶
type UnbanChatMemberOpts struct { // Do nothing if the user is not banned OnlyIfBanned bool }
UnbanChatMemberOpts is the set of optional fields for Bot.UnbanChatMember.
type UnpinChatMessageOpts ¶
type UnpinChatMessageOpts struct { // Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. MessageId int64 }
UnpinChatMessageOpts is the set of optional fields for Bot.UnpinChatMessage.
type Update ¶
type Update struct { // 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. UpdateId int64 `json:"update_id,omitempty"` // Optional. New incoming message of any kind — text, photo, sticker, etc. Message *Message `json:"message,omitempty"` // Optional. New version of a message that is known to the bot and was edited EditedMessage *Message `json:"edited_message,omitempty"` // Optional. New incoming channel post of any kind — text, photo, sticker, etc. ChannelPost *Message `json:"channel_post,omitempty"` // Optional. New version of a channel post that is known to the bot and was edited EditedChannelPost *Message `json:"edited_channel_post,omitempty"` // Optional. New incoming inline query InlineQuery *InlineQuery `json:"inline_query,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. ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // Optional. New incoming callback query CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` // Optional. New incoming shipping query. Only for invoices with flexible price ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // Optional. New incoming pre-checkout query. Contains full information about checkout PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot Poll *Poll `json:"poll,omitempty"` // Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. PollAnswer *PollAnswer `json:"poll_answer,omitempty"` }
This object represents an incoming update.At most one of the optional parameters can be present in any given update. https://core.telegram.org/bots/api#update
type User ¶
type User struct { // Unique identifier for this user or bot Id int64 `json:"id,omitempty"` // True, if this user is a bot IsBot bool `json:"is_bot,omitempty"` // User's or bot's first name FirstName string `json:"first_name,omitempty"` // Optional. User's or bot's last name LastName string `json:"last_name,omitempty"` // Optional. User's or bot's username Username string `json:"username,omitempty"` // Optional. IETF language tag of the user's language LanguageCode string `json:"language_code,omitempty"` // Optional. True, if the bot can be invited to groups. Returned only in getMe. CanJoinGroups bool `json:"can_join_groups,omitempty"` // Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"` // Optional. True, if the bot supports inline queries. Returned only in getMe. SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"` }
This object represents a Telegram user or bot. https://core.telegram.org/bots/api#user
func (User) GetProfilePhotos ¶
func (u User) GetProfilePhotos(b *Bot, opts *GetUserProfilePhotosOpts) (*UserProfilePhotos, error)
Helper method for Bot.GetUserProfilePhotos
type UserProfilePhotos ¶
type UserProfilePhotos struct { // Total number of profile pictures the target user has TotalCount int64 `json:"total_count,omitempty"` // Requested profile pictures (in up to 4 sizes each) Photos [][]PhotoSize `json:"photos,omitempty"` }
This object represent a user's profile pictures. https://core.telegram.org/bots/api#userprofilephotos
type Venue ¶
type Venue struct { // Venue location. Can't be a live location Location Location `json:"location,omitempty"` // Name of the venue Title string `json:"title,omitempty"` // Address of the venue Address string `json:"address,omitempty"` // Optional. Foursquare identifier of the venue FoursquareId string `json:"foursquare_id,omitempty"` // Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Google Places identifier of the venue GooglePlaceId string `json:"google_place_id,omitempty"` // Optional. Google Places type of the venue. (See supported types.) GooglePlaceType string `json:"google_place_type,omitempty"` }
This object represents a venue. https://core.telegram.org/bots/api#venue
type Video ¶
type Video struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Video width as defined by sender Width int64 `json:"width,omitempty"` // Video height as defined by sender Height int64 `json:"height,omitempty"` // Duration of the video in seconds as defined by sender Duration int64 `json:"duration,omitempty"` // Optional. Video thumbnail Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. Original filename as defined by sender FileName string `json:"file_name,omitempty"` // Optional. Mime type of a file as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents a video file. https://core.telegram.org/bots/api#video
type VideoNote ¶
type VideoNote struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Video width and height (diameter of the video message) as defined by sender Length int64 `json:"length,omitempty"` // Duration of the video in seconds as defined by sender Duration int64 `json:"duration,omitempty"` // Optional. Video thumbnail Thumb *PhotoSize `json:"thumb,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents a video message (available in Telegram apps as of v.4.0). https://core.telegram.org/bots/api#videonote
type Voice ¶
type Voice struct { // Identifier for this file, which can be used to download or reuse the file FileId string `json:"file_id,omitempty"` // Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. FileUniqueId string `json:"file_unique_id,omitempty"` // Duration of the audio in seconds as defined by sender Duration int64 `json:"duration,omitempty"` // Optional. MIME type of the file as defined by sender MimeType string `json:"mime_type,omitempty"` // Optional. File size FileSize int64 `json:"file_size,omitempty"` }
This object represents a voice note. https://core.telegram.org/bots/api#voice
type WebhookInfo ¶
type WebhookInfo struct { // Webhook URL, may be empty if webhook is not set up Url string `json:"url,omitempty"` // True, if a custom certificate was provided for webhook certificate checks HasCustomCertificate bool `json:"has_custom_certificate,omitempty"` // Number of updates awaiting delivery PendingUpdateCount int64 `json:"pending_update_count,omitempty"` // Optional. Currently used webhook IP address IpAddress string `json:"ip_address,omitempty"` // Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook LastErrorDate int64 `json:"last_error_date,omitempty"` // Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook LastErrorMessage string `json:"last_error_message,omitempty"` // Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery MaxConnections int64 `json:"max_connections,omitempty"` // Optional. A list of update types the bot is subscribed to. Defaults to all update types AllowedUpdates []string `json:"allowed_updates,omitempty"` }
Contains information about the current status of a webhook. https://core.telegram.org/bots/api#webhookinfo