Documentation ¶
Overview ¶
Package tg contains a low level API to interact with Telegram Bot API.
Index ¶
- func BindClient[C interface{ ... }](call C, client *Client) C
- func NewButtonColumn[T Button](buttons ...T) [][]T
- func NewButtonRow[T Button](buttons ...T) []T
- type AddStickerToSetCall
- type Animation
- type AnswerCallbackQueryCall
- func (call *AnswerCallbackQueryCall) CacheTime(cacheTime int) *AnswerCallbackQueryCall
- func (call *AnswerCallbackQueryCall) CallbackQueryID(callbackQueryID string) *AnswerCallbackQueryCall
- func (call *AnswerCallbackQueryCall) ShowAlert(showAlert bool) *AnswerCallbackQueryCall
- func (call *AnswerCallbackQueryCall) Text(text string) *AnswerCallbackQueryCall
- func (call *AnswerCallbackQueryCall) URL(url string) *AnswerCallbackQueryCall
- type AnswerInlineQueryCall
- func (call *AnswerInlineQueryCall) Button(button InlineQueryResultsButton) *AnswerInlineQueryCall
- func (call *AnswerInlineQueryCall) CacheTime(cacheTime int) *AnswerInlineQueryCall
- func (call *AnswerInlineQueryCall) InlineQueryID(inlineQueryID string) *AnswerInlineQueryCall
- func (call *AnswerInlineQueryCall) IsPersonal(isPersonal bool) *AnswerInlineQueryCall
- func (call *AnswerInlineQueryCall) NextOffset(nextOffset string) *AnswerInlineQueryCall
- func (call *AnswerInlineQueryCall) Results(results []InlineQueryResult) *AnswerInlineQueryCall
- type AnswerPreCheckoutQueryCall
- type AnswerShippingQueryCall
- func (call *AnswerShippingQueryCall) ErrorMessage(errorMessage string) *AnswerShippingQueryCall
- func (call *AnswerShippingQueryCall) Ok(ok bool) *AnswerShippingQueryCall
- func (call *AnswerShippingQueryCall) ShippingOptions(shippingOptions []ShippingOption) *AnswerShippingQueryCall
- func (call *AnswerShippingQueryCall) ShippingQueryID(shippingQueryID string) *AnswerShippingQueryCall
- type AnswerWebAppQueryCall
- type ApproveChatJoinRequestCall
- type Audio
- type AuthWidget
- type BanChatMemberCall
- func (call *BanChatMemberCall) ChatID(chatID PeerID) *BanChatMemberCall
- func (call *BanChatMemberCall) RevokeMessages(revokeMessages bool) *BanChatMemberCall
- func (call *BanChatMemberCall) UntilDate(untilDate int) *BanChatMemberCall
- func (call *BanChatMemberCall) UserID(userID UserID) *BanChatMemberCall
- type BanChatSenderChatCall
- type BotCommand
- type BotCommandScope
- type BotCommandScopeAllChatAdministrators
- type BotCommandScopeAllGroupChats
- type BotCommandScopeAllPrivateChats
- type BotCommandScopeChat
- type BotCommandScopeChatAdministrators
- type BotCommandScopeChatMember
- type BotCommandScopeDefault
- type BotDescription
- type BotName
- type BotShortDescription
- type Button
- type ButtonLayout
- type Call
- type CallNoResult
- type CallbackGame
- type CallbackQuery
- type Chat
- type ChatAction
- type ChatAdministratorRights
- type ChatID
- type ChatInviteLink
- type ChatJoinRequest
- type ChatLocation
- type ChatMember
- type ChatMemberAdministrator
- type ChatMemberBanned
- type ChatMemberLeft
- type ChatMemberMember
- type ChatMemberOwner
- type ChatMemberRestricted
- type ChatMemberUpdated
- type ChatPermissions
- type ChatPhoto
- type ChatShared
- type ChatType
- type ChosenInlineResult
- type Client
- func (client *Client) AddStickerToSet(userID UserID, name string, sticker InputSticker) *AddStickerToSetCall
- func (client *Client) AnswerCallbackQuery(callbackQueryID string) *AnswerCallbackQueryCall
- func (client *Client) AnswerInlineQuery(inlineQueryID string, results []InlineQueryResult) *AnswerInlineQueryCall
- func (client *Client) AnswerPreCheckoutQuery(preCheckoutQueryID string, ok bool) *AnswerPreCheckoutQueryCall
- func (client *Client) AnswerShippingQuery(shippingQueryID string, ok bool) *AnswerShippingQueryCall
- func (client *Client) AnswerWebAppQuery(webAppQueryID string, result InlineQueryResult) *AnswerWebAppQueryCall
- func (client *Client) ApproveChatJoinRequest(chatID PeerID, userID UserID) *ApproveChatJoinRequestCall
- func (client *Client) BanChatMember(chatID PeerID, userID UserID) *BanChatMemberCall
- func (client *Client) BanChatSenderChat(chatID PeerID, senderChatID int) *BanChatSenderChatCall
- func (client *Client) Close() *CloseCall
- func (client *Client) CloseForumTopic(chatID PeerID, messageThreadID int) *CloseForumTopicCall
- func (client *Client) CloseGeneralForumTopic(chatID PeerID) *CloseGeneralForumTopicCall
- func (client *Client) CopyMessage(chatID PeerID, fromChatID PeerID, messageID int) *CopyMessageCall
- func (client *Client) CreateChatInviteLink(chatID PeerID) *CreateChatInviteLinkCall
- func (client *Client) CreateForumTopic(chatID PeerID, name string) *CreateForumTopicCall
- func (client *Client) CreateInvoiceLink(title string, description string, payload string, providerToken string, ...) *CreateInvoiceLinkCall
- func (client *Client) CreateNewStickerSet(userID UserID, name string, title string, stickers []InputSticker, ...) *CreateNewStickerSetCall
- func (client *Client) DeclineChatJoinRequest(chatID PeerID, userID UserID) *DeclineChatJoinRequestCall
- func (client *Client) DeleteChatPhoto(chatID PeerID) *DeleteChatPhotoCall
- func (client *Client) DeleteChatStickerSet(chatID PeerID) *DeleteChatStickerSetCall
- func (client *Client) DeleteForumTopic(chatID PeerID, messageThreadID int) *DeleteForumTopicCall
- func (client *Client) DeleteMessage(chatID PeerID, messageID int) *DeleteMessageCall
- func (client *Client) DeleteMyCommands() *DeleteMyCommandsCall
- func (client *Client) DeleteStickerFromSet(sticker string) *DeleteStickerFromSetCall
- func (client *Client) DeleteStickerSet(name string) *DeleteStickerSetCall
- func (client *Client) DeleteWebhook() *DeleteWebhookCall
- func (client *Client) Do(ctx context.Context, req *Request, dst interface{}) error
- func (client *Client) Download(ctx context.Context, path string) (io.ReadCloser, error)
- func (client *Client) EditChatInviteLink(chatID PeerID, inviteLink string) *EditChatInviteLinkCall
- func (client *Client) EditForumTopic(chatID PeerID, messageThreadID int) *EditForumTopicCall
- func (client *Client) EditGeneralForumTopic(chatID PeerID, name string) *EditGeneralForumTopicCall
- func (client *Client) EditMessageCaption(chatID PeerID, messageID int, caption string) *EditMessageCaptionCall
- func (client *Client) EditMessageCaptionInline(inlineMessageID string, caption string) *EditMessageCaptionCall
- func (client *Client) EditMessageLiveLocation(chatID PeerID, messageID int) *EditMessageLiveLocationCall
- func (client *Client) EditMessageLiveLocationInline(inlineMessageID string) *EditMessageLiveLocationCall
- func (client *Client) EditMessageMedia(media InputMedia) *EditMessageMediaCall
- func (client *Client) EditMessageReplyMarkup(chatID PeerID, messageID int) *EditMessageReplyMarkupCall
- func (client *Client) EditMessageReplyMarkupInline(inlineMessageID string) *EditMessageReplyMarkupCall
- func (client *Client) EditMessageText(chatID PeerID, messageID int, text string) *EditMessageTextCall
- func (client *Client) EditMessageTextInline(inlineMessageID string, text string) *EditMessageTextCall
- func (client *Client) ExportChatInviteLink(chatID PeerID) *ExportChatInviteLinkCall
- func (client *Client) ForwardMessage(chatID PeerID, fromChatID PeerID, messageID int) *ForwardMessageCall
- func (client *Client) GetChat(chatID PeerID) *GetChatCall
- func (client *Client) GetChatAdministrators(chatID PeerID) *GetChatAdministratorsCall
- func (client *Client) GetChatMember(chatID PeerID, userID UserID) *GetChatMemberCall
- func (client *Client) GetChatMemberCount(chatID PeerID) *GetChatMemberCountCall
- func (client *Client) GetChatMenuButton() *GetChatMenuButtonCall
- func (client *Client) GetCustomEmojiStickers(customEmojiIds []string) *GetCustomEmojiStickersCall
- func (client *Client) GetFile(fileID FileID) *GetFileCall
- func (client *Client) GetForumTopicIconStickers() *GetForumTopicIconStickersCall
- func (client *Client) GetGameHighScores(userID UserID) *GetGameHighScoresCall
- func (client *Client) GetMe() *GetMeCall
- func (client *Client) GetMyCommands() *GetMyCommandsCall
- func (client *Client) GetMyDefaultAdministratorRights() *GetMyDefaultAdministratorRightsCall
- func (client *Client) GetMyDescription() *GetMyDescriptionCall
- func (client *Client) GetMyName() *GetMyNameCall
- func (client *Client) GetMyShortDescription() *GetMyShortDescriptionCall
- func (client *Client) GetStickerSet(name string) *GetStickerSetCall
- func (client *Client) GetUpdates() *GetUpdatesCall
- func (client *Client) GetUserProfilePhotos(userID UserID) *GetUserProfilePhotosCall
- func (client *Client) GetWebhookInfo() *GetWebhookInfoCall
- func (client *Client) HideGeneralForumTopic(chatID PeerID) *HideGeneralForumTopicCall
- func (client *Client) LeaveChat(chatID PeerID) *LeaveChatCall
- func (client *Client) LogOut() *LogOutCall
- func (client *Client) Me(ctx context.Context) (User, error)
- func (client *Client) PinChatMessage(chatID PeerID, messageID int) *PinChatMessageCall
- func (client *Client) PromoteChatMember(chatID PeerID, userID UserID) *PromoteChatMemberCall
- func (client *Client) ReopenForumTopic(chatID PeerID, messageThreadID int) *ReopenForumTopicCall
- func (client *Client) ReopenGeneralForumTopic(chatID PeerID) *ReopenGeneralForumTopicCall
- func (client *Client) RestrictChatMember(chatID PeerID, userID UserID, permissions ChatPermissions) *RestrictChatMemberCall
- func (client *Client) RevokeChatInviteLink(chatID PeerID, inviteLink string) *RevokeChatInviteLinkCall
- func (client *Client) SendAnimation(chatID PeerID, animation FileArg) *SendAnimationCall
- func (client *Client) SendAudio(chatID PeerID, audio FileArg) *SendAudioCall
- func (client *Client) SendChatAction(chatID PeerID, action ChatAction) *SendChatActionCall
- func (client *Client) SendContact(chatID PeerID, phoneNumber string, firstName string) *SendContactCall
- func (client *Client) SendDice(chatID PeerID) *SendDiceCall
- func (client *Client) SendDocument(chatID PeerID, document FileArg) *SendDocumentCall
- func (client *Client) SendGame(chatID ChatID, gameShortName string) *SendGameCall
- func (client *Client) SendInvoice(chatID PeerID, title string, description string, payload string, ...) *SendInvoiceCall
- func (client *Client) SendLocation(chatID PeerID, latitude float64, longitude float64) *SendLocationCall
- func (client *Client) SendMediaGroup(chatID PeerID, media []InputMedia) *SendMediaGroupCall
- func (client *Client) SendMessage(chatID PeerID, text string) *SendMessageCall
- func (client *Client) SendPhoto(chatID PeerID, photo FileArg) *SendPhotoCall
- func (client *Client) SendPoll(chatID PeerID, question string, options []string) *SendPollCall
- func (client *Client) SendSticker(chatID PeerID, sticker FileArg) *SendStickerCall
- func (client *Client) SendVenue(chatID PeerID, latitude float64, longitude float64, title string, ...) *SendVenueCall
- func (client *Client) SendVideo(chatID PeerID, video FileArg) *SendVideoCall
- func (client *Client) SendVideoNote(chatID PeerID, videoNote FileArg) *SendVideoNoteCall
- func (client *Client) SendVoice(chatID PeerID, voice FileArg) *SendVoiceCall
- func (client *Client) SetChatAdministratorCustomTitle(chatID PeerID, userID UserID, customTitle string) *SetChatAdministratorCustomTitleCall
- func (client *Client) SetChatDescription(chatID PeerID) *SetChatDescriptionCall
- func (client *Client) SetChatMenuButton() *SetChatMenuButtonCall
- func (client *Client) SetChatPermissions(chatID PeerID, permissions ChatPermissions) *SetChatPermissionsCall
- func (client *Client) SetChatPhoto(chatID PeerID, photo InputFile) *SetChatPhotoCall
- func (client *Client) SetChatStickerSet(chatID PeerID, stickerSetName string) *SetChatStickerSetCall
- func (client *Client) SetChatTitle(chatID PeerID, title string) *SetChatTitleCall
- func (client *Client) SetCustomEmojiStickerSetThumbnail(name string) *SetCustomEmojiStickerSetThumbnailCall
- func (client *Client) SetGameScore(userID UserID, score int) *SetGameScoreCall
- func (client *Client) SetMyCommands(commands []BotCommand) *SetMyCommandsCall
- func (client *Client) SetMyDefaultAdministratorRights() *SetMyDefaultAdministratorRightsCall
- func (client *Client) SetMyDescription() *SetMyDescriptionCall
- func (client *Client) SetMyName() *SetMyNameCall
- func (client *Client) SetMyShortDescription() *SetMyShortDescriptionCall
- func (client *Client) SetPassportDataErrors(userID UserID, errors []PassportElementError) *SetPassportDataErrorsCall
- func (client *Client) SetStickerEmojiList(sticker string, emojiList []string) *SetStickerEmojiListCall
- func (client *Client) SetStickerKeywords(sticker string) *SetStickerKeywordsCall
- func (client *Client) SetStickerMaskPosition(sticker string) *SetStickerMaskPositionCall
- func (client *Client) SetStickerPositionInSet(sticker string, position int) *SetStickerPositionInSetCall
- func (client *Client) SetStickerSetThumbnail(name string, userID UserID) *SetStickerSetThumbnailCall
- func (client *Client) SetStickerSetTitle(name string, title string) *SetStickerSetTitleCall
- func (client *Client) SetWebhook(url string) *SetWebhookCall
- func (client *Client) StopMessageLiveLocation(chatID PeerID, messageID int) *StopMessageLiveLocationCall
- func (client *Client) StopMessageLiveLocationInline(inlineMessageID string) *StopMessageLiveLocationCall
- func (client *Client) StopPoll(chatID PeerID, messageID int) *StopPollCall
- func (client *Client) Token() string
- func (client *Client) UnbanChatMember(chatID PeerID, userID UserID) *UnbanChatMemberCall
- func (client *Client) UnbanChatSenderChat(chatID PeerID, senderChatID int) *UnbanChatSenderChatCall
- func (client *Client) UnhideGeneralForumTopic(chatID PeerID) *UnhideGeneralForumTopicCall
- func (client *Client) UnpinAllChatMessages(chatID PeerID) *UnpinAllChatMessagesCall
- func (client *Client) UnpinAllForumTopicMessages(chatID PeerID, messageThreadID int) *UnpinAllForumTopicMessagesCall
- func (client *Client) UnpinChatMessage(chatID PeerID) *UnpinChatMessageCall
- func (client *Client) UploadStickerFile(userID UserID, sticker InputFile, stickerFormat string) *UploadStickerFileCall
- type ClientOption
- type CloseCall
- type CloseForumTopicCall
- type CloseGeneralForumTopicCall
- type Contact
- type CopyMessageCall
- func (call *CopyMessageCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *CopyMessageCall
- func (call *CopyMessageCall) Caption(caption string) *CopyMessageCall
- func (call *CopyMessageCall) CaptionEntities(captionEntities []MessageEntity) *CopyMessageCall
- func (call *CopyMessageCall) ChatID(chatID PeerID) *CopyMessageCall
- func (call *CopyMessageCall) DisableNotification(disableNotification bool) *CopyMessageCall
- func (call *CopyMessageCall) FromChatID(fromChatID PeerID) *CopyMessageCall
- func (call *CopyMessageCall) MessageID(messageID int) *CopyMessageCall
- func (call *CopyMessageCall) MessageThreadID(messageThreadID int) *CopyMessageCall
- func (call *CopyMessageCall) ParseMode(parseMode ParseMode) *CopyMessageCall
- func (call *CopyMessageCall) ProtectContent(protectContent bool) *CopyMessageCall
- func (call *CopyMessageCall) ReplyMarkup(replyMarkup ReplyMarkup) *CopyMessageCall
- func (call *CopyMessageCall) ReplyToMessageID(replyToMessageID int) *CopyMessageCall
- type CreateChatInviteLinkCall
- func (call *CreateChatInviteLinkCall) ChatID(chatID PeerID) *CreateChatInviteLinkCall
- func (call *CreateChatInviteLinkCall) CreatesJoinRequest(createsJoinRequest bool) *CreateChatInviteLinkCall
- func (call *CreateChatInviteLinkCall) ExpireDate(expireDate int) *CreateChatInviteLinkCall
- func (call *CreateChatInviteLinkCall) MemberLimit(memberLimit int) *CreateChatInviteLinkCall
- func (call *CreateChatInviteLinkCall) Name(name string) *CreateChatInviteLinkCall
- type CreateForumTopicCall
- func (call *CreateForumTopicCall) ChatID(chatID PeerID) *CreateForumTopicCall
- func (call *CreateForumTopicCall) IconColor(iconColor int) *CreateForumTopicCall
- func (call *CreateForumTopicCall) IconCustomEmojiID(iconCustomEmojiID string) *CreateForumTopicCall
- func (call *CreateForumTopicCall) Name(name string) *CreateForumTopicCall
- type CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) Currency(currency string) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) Description(description string) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) IsFlexible(isFlexible bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) MaxTipAmount(maxTipAmount int) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) NeedEmail(needEmail bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) NeedName(needName bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) NeedPhoneNumber(needPhoneNumber bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) NeedShippingAddress(needShippingAddress bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) Payload(payload string) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) PhotoHeight(photoHeight int) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) PhotoSize(photoSize int) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) PhotoURL(photoURL string) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) PhotoWidth(photoWidth int) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) Prices(prices []LabeledPrice) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) ProviderData(providerData string) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) ProviderToken(providerToken string) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) SendEmailToProvider(sendEmailToProvider bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) SendPhoneNumberToProvider(sendPhoneNumberToProvider bool) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) SuggestedTipAmounts(suggestedTipAmounts []int) *CreateInvoiceLinkCall
- func (call *CreateInvoiceLinkCall) Title(title string) *CreateInvoiceLinkCall
- type CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) Name(name string) *CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) NeedsRepainting(needsRepainting bool) *CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) StickerFormat(stickerFormat string) *CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) StickerType(stickerType StickerType) *CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) Stickers(stickers []InputSticker) *CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) Title(title string) *CreateNewStickerSetCall
- func (call *CreateNewStickerSetCall) UserID(userID UserID) *CreateNewStickerSetCall
- type DeclineChatJoinRequestCall
- type DeleteChatPhotoCall
- type DeleteChatStickerSetCall
- type DeleteForumTopicCall
- type DeleteMessageCall
- type DeleteMyCommandsCall
- type DeleteStickerFromSetCall
- type DeleteStickerSetCall
- type DeleteWebhookCall
- type Dice
- type Document
- type Doer
- type EditChatInviteLinkCall
- func (call *EditChatInviteLinkCall) ChatID(chatID PeerID) *EditChatInviteLinkCall
- func (call *EditChatInviteLinkCall) CreatesJoinRequest(createsJoinRequest bool) *EditChatInviteLinkCall
- func (call *EditChatInviteLinkCall) ExpireDate(expireDate int) *EditChatInviteLinkCall
- func (call *EditChatInviteLinkCall) InviteLink(inviteLink string) *EditChatInviteLinkCall
- func (call *EditChatInviteLinkCall) MemberLimit(memberLimit int) *EditChatInviteLinkCall
- func (call *EditChatInviteLinkCall) Name(name string) *EditChatInviteLinkCall
- type EditForumTopicCall
- func (call *EditForumTopicCall) ChatID(chatID PeerID) *EditForumTopicCall
- func (call *EditForumTopicCall) IconCustomEmojiID(iconCustomEmojiID string) *EditForumTopicCall
- func (call *EditForumTopicCall) MessageThreadID(messageThreadID int) *EditForumTopicCall
- func (call *EditForumTopicCall) Name(name string) *EditForumTopicCall
- type EditGeneralForumTopicCall
- type EditMessageCaptionCall
- func (call *EditMessageCaptionCall) Caption(caption string) *EditMessageCaptionCall
- func (call *EditMessageCaptionCall) CaptionEntities(captionEntities []MessageEntity) *EditMessageCaptionCall
- func (call *EditMessageCaptionCall) ChatID(chatID PeerID) *EditMessageCaptionCall
- func (call *EditMessageCaptionCall) InlineMessageID(inlineMessageID string) *EditMessageCaptionCall
- func (call *EditMessageCaptionCall) MessageID(messageID int) *EditMessageCaptionCall
- func (call *EditMessageCaptionCall) ParseMode(parseMode ParseMode) *EditMessageCaptionCall
- func (call *EditMessageCaptionCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageCaptionCall
- type EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) ChatID(chatID PeerID) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) Heading(heading int) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) HorizontalAccuracy(horizontalAccuracy float64) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) InlineMessageID(inlineMessageID string) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) Latitude(latitude float64) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) Longitude(longitude float64) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) MessageID(messageID int) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) ProximityAlertRadius(proximityAlertRadius int) *EditMessageLiveLocationCall
- func (call *EditMessageLiveLocationCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageLiveLocationCall
- type EditMessageMediaCall
- func (call *EditMessageMediaCall) ChatID(chatID PeerID) *EditMessageMediaCall
- func (call *EditMessageMediaCall) InlineMessageID(inlineMessageID string) *EditMessageMediaCall
- func (call *EditMessageMediaCall) Media(media InputMedia) *EditMessageMediaCall
- func (call *EditMessageMediaCall) MessageID(messageID int) *EditMessageMediaCall
- func (call *EditMessageMediaCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageMediaCall
- type EditMessageReplyMarkupCall
- func (call *EditMessageReplyMarkupCall) ChatID(chatID PeerID) *EditMessageReplyMarkupCall
- func (call *EditMessageReplyMarkupCall) InlineMessageID(inlineMessageID string) *EditMessageReplyMarkupCall
- func (call *EditMessageReplyMarkupCall) MessageID(messageID int) *EditMessageReplyMarkupCall
- func (call *EditMessageReplyMarkupCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageReplyMarkupCall
- type EditMessageTextCall
- func (call *EditMessageTextCall) ChatID(chatID PeerID) *EditMessageTextCall
- func (call *EditMessageTextCall) DisableWebPagePreview(disableWebPagePreview bool) *EditMessageTextCall
- func (call *EditMessageTextCall) Entities(entities []MessageEntity) *EditMessageTextCall
- func (call *EditMessageTextCall) InlineMessageID(inlineMessageID string) *EditMessageTextCall
- func (call *EditMessageTextCall) MessageID(messageID int) *EditMessageTextCall
- func (call *EditMessageTextCall) ParseMode(parseMode ParseMode) *EditMessageTextCall
- func (call *EditMessageTextCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageTextCall
- func (call *EditMessageTextCall) Text(text string) *EditMessageTextCall
- type Encoder
- type EncryptedCredentials
- type EncryptedPassportElement
- type Error
- type ExportChatInviteLinkCall
- type File
- type FileArg
- type FileID
- type ForceReply
- type ForumTopic
- type ForumTopicClosed
- type ForumTopicCreated
- type ForumTopicEdited
- type ForumTopicReopened
- type ForwardMessageCall
- func (call *ForwardMessageCall) ChatID(chatID PeerID) *ForwardMessageCall
- func (call *ForwardMessageCall) DisableNotification(disableNotification bool) *ForwardMessageCall
- func (call *ForwardMessageCall) FromChatID(fromChatID PeerID) *ForwardMessageCall
- func (call *ForwardMessageCall) MessageID(messageID int) *ForwardMessageCall
- func (call *ForwardMessageCall) MessageThreadID(messageThreadID int) *ForwardMessageCall
- func (call *ForwardMessageCall) ProtectContent(protectContent bool) *ForwardMessageCall
- type Game
- type GameHighScore
- type GeneralForumTopicHidden
- type GeneralForumTopicUnhidden
- type GetChatAdministratorsCall
- type GetChatCall
- type GetChatMemberCall
- type GetChatMemberCountCall
- type GetChatMenuButtonCall
- type GetCustomEmojiStickersCall
- type GetFileCall
- type GetForumTopicIconStickersCall
- type GetGameHighScoresCall
- func (call *GetGameHighScoresCall) ChatID(chatID ChatID) *GetGameHighScoresCall
- func (call *GetGameHighScoresCall) InlineMessageID(inlineMessageID string) *GetGameHighScoresCall
- func (call *GetGameHighScoresCall) MessageID(messageID int) *GetGameHighScoresCall
- func (call *GetGameHighScoresCall) UserID(userID UserID) *GetGameHighScoresCall
- type GetMeCall
- type GetMyCommandsCall
- type GetMyDefaultAdministratorRightsCall
- type GetMyDescriptionCall
- type GetMyNameCall
- type GetMyShortDescriptionCall
- type GetStickerSetCall
- type GetUpdatesCall
- type GetUserProfilePhotosCall
- type GetWebhookInfoCall
- type HideGeneralForumTopicCall
- type InlineKeyboardButton
- func NewInlineKeyboardButtonCallback(text string, query string) InlineKeyboardButton
- func NewInlineKeyboardButtonCallbackGame(text string) InlineKeyboardButton
- func NewInlineKeyboardButtonLoginURL(text string, loginURL LoginURL) InlineKeyboardButton
- func NewInlineKeyboardButtonPay(text string) InlineKeyboardButton
- func NewInlineKeyboardButtonSwitchInlineQuery(text string, query string) InlineKeyboardButton
- func NewInlineKeyboardButtonSwitchInlineQueryCurrentChat(text string, query string) InlineKeyboardButton
- func NewInlineKeyboardButtonURL(text string, url string) InlineKeyboardButton
- func NewInlineKeyboardButtonWebApp(text string, webApp WebAppInfo) 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 InlineQueryResultGIF
- type InlineQueryResultGame
- type InlineQueryResultLocation
- type InlineQueryResultMPEG4GIF
- type InlineQueryResultPhoto
- type InlineQueryResultVenue
- type InlineQueryResultVideo
- type InlineQueryResultVoice
- type InlineQueryResultsButton
- type InputContactMessageContent
- type InputFile
- type InputInvoiceMessageContent
- type InputLocationMessageContent
- type InputMedia
- type InputMediaAnimation
- type InputMediaAudio
- type InputMediaDocument
- type InputMediaPhoto
- type InputMediaVideo
- type InputMessageContent
- type InputSticker
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type KeyboardButton
- func NewKeyboardButton(text string) KeyboardButton
- func NewKeyboardButtonRequestContact(text string) KeyboardButton
- func NewKeyboardButtonRequestLocation(text string) KeyboardButton
- func NewKeyboardButtonRequestPoll(text string, poll KeyboardButtonPollType) KeyboardButton
- func NewKeyboardButtonWebApp(text string, webApp WebAppInfo) KeyboardButton
- type KeyboardButtonPollType
- type KeyboardButtonRequestChat
- type KeyboardButtonRequestUser
- type LabeledPrice
- type LeaveChatCall
- type Location
- type LogOutCall
- type LoginURL
- type MaskPosition
- type MenuButton
- type MenuButtonCommands
- type MenuButtonDefault
- type MenuButtonOneOf
- type MenuButtonWebApp
- type Message
- type MessageAutoDeleteTimerChanged
- type MessageEntity
- type MessageEntityType
- type MessageID
- type MessageType
- type OrderInfo
- type ParseMode
- 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 PeerID
- type PhotoSize
- type PinChatMessageCall
- type Poll
- type PollAnswer
- type PollOption
- type PreCheckoutQuery
- type PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanChangeInfo(canChangeInfo bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanDeleteMessages(canDeleteMessages bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanEditMessages(canEditMessages bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanInviteUsers(canInviteUsers bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanManageChat(canManageChat bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanManageTopics(canManageTopics bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanManageVideoChats(canManageVideoChats bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanPinMessages(canPinMessages bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanPostMessages(canPostMessages bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanPromoteMembers(canPromoteMembers bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) CanRestrictMembers(canRestrictMembers bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) ChatID(chatID PeerID) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) IsAnonymous(isAnonymous bool) *PromoteChatMemberCall
- func (call *PromoteChatMemberCall) UserID(userID UserID) *PromoteChatMemberCall
- type ProximityAlertTriggered
- type ReopenForumTopicCall
- type ReopenGeneralForumTopicCall
- type ReplyKeyboardMarkup
- func (markup *ReplyKeyboardMarkup) WithInputFieldPlaceholder(placeholder string) *ReplyKeyboardMarkup
- func (markup *ReplyKeyboardMarkup) WithOneTimeKeyboardMarkup() *ReplyKeyboardMarkup
- func (markup *ReplyKeyboardMarkup) WithResizeKeyboardMarkup() *ReplyKeyboardMarkup
- func (markup *ReplyKeyboardMarkup) WithSelective() *ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type ReplyMarkup
- type Request
- func (r *Request) Bool(name string, value bool) *Request
- func (r *Request) ChatID(name string, v ChatID) *Request
- func (r *Request) Encode(encoder Encoder) error
- func (r *Request) File(name string, arg FileArg) *Request
- func (r *Request) FileID(name string, v FileID) *Request
- func (r *Request) Float64(name string, value float64) *Request
- func (r *Request) InputFile(name string, file InputFile) *Request
- func (r *Request) InputMedia(im InputMedia) *Request
- func (r *Request) InputMediaSlice(name string, im []InputMedia) *Request
- func (r *Request) Int(name string, value int) *Request
- func (r *Request) Int64(name string, value int64) *Request
- func (r *Request) JSON(name string, v any) *Request
- func (req *Request) MarshalJSON() ([]byte, error)
- func (r *Request) PeerID(name string, v PeerID) *Request
- func (r *Request) String(name, value string) *Request
- func (r *Request) Stringer(name string, v fmt.Stringer) *Request
- func (r *Request) UserID(name string, v UserID) *Request
- type Response
- type ResponseParameters
- type RestrictChatMemberCall
- func (call *RestrictChatMemberCall) ChatID(chatID PeerID) *RestrictChatMemberCall
- func (call *RestrictChatMemberCall) Permissions(permissions ChatPermissions) *RestrictChatMemberCall
- func (call *RestrictChatMemberCall) UntilDate(untilDate int) *RestrictChatMemberCall
- func (call *RestrictChatMemberCall) UseIndependentChatPermissions(useIndependentChatPermissions bool) *RestrictChatMemberCall
- func (call *RestrictChatMemberCall) UserID(userID UserID) *RestrictChatMemberCall
- type RevokeChatInviteLinkCall
- type SendAnimationCall
- func (call *SendAnimationCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendAnimationCall
- func (call *SendAnimationCall) Animation(animation FileArg) *SendAnimationCall
- func (call *SendAnimationCall) Caption(caption string) *SendAnimationCall
- func (call *SendAnimationCall) CaptionEntities(captionEntities []MessageEntity) *SendAnimationCall
- func (call *SendAnimationCall) ChatID(chatID PeerID) *SendAnimationCall
- func (call *SendAnimationCall) DisableNotification(disableNotification bool) *SendAnimationCall
- func (call *SendAnimationCall) Duration(duration int) *SendAnimationCall
- func (call *SendAnimationCall) HasSpoiler(hasSpoiler bool) *SendAnimationCall
- func (call *SendAnimationCall) Height(height int) *SendAnimationCall
- func (call *SendAnimationCall) MessageThreadID(messageThreadID int) *SendAnimationCall
- func (call *SendAnimationCall) ParseMode(parseMode ParseMode) *SendAnimationCall
- func (call *SendAnimationCall) ProtectContent(protectContent bool) *SendAnimationCall
- func (call *SendAnimationCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendAnimationCall
- func (call *SendAnimationCall) ReplyToMessageID(replyToMessageID int) *SendAnimationCall
- func (call *SendAnimationCall) Thumbnail(thumbnail FileArg) *SendAnimationCall
- func (call *SendAnimationCall) Width(width int) *SendAnimationCall
- type SendAudioCall
- func (call *SendAudioCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendAudioCall
- func (call *SendAudioCall) Audio(audio FileArg) *SendAudioCall
- func (call *SendAudioCall) Caption(caption string) *SendAudioCall
- func (call *SendAudioCall) CaptionEntities(captionEntities []MessageEntity) *SendAudioCall
- func (call *SendAudioCall) ChatID(chatID PeerID) *SendAudioCall
- func (call *SendAudioCall) DisableNotification(disableNotification bool) *SendAudioCall
- func (call *SendAudioCall) Duration(duration int) *SendAudioCall
- func (call *SendAudioCall) MessageThreadID(messageThreadID int) *SendAudioCall
- func (call *SendAudioCall) ParseMode(parseMode ParseMode) *SendAudioCall
- func (call *SendAudioCall) Performer(performer string) *SendAudioCall
- func (call *SendAudioCall) ProtectContent(protectContent bool) *SendAudioCall
- func (call *SendAudioCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendAudioCall
- func (call *SendAudioCall) ReplyToMessageID(replyToMessageID int) *SendAudioCall
- func (call *SendAudioCall) Thumbnail(thumbnail FileArg) *SendAudioCall
- func (call *SendAudioCall) Title(title string) *SendAudioCall
- type SendChatActionCall
- type SendContactCall
- func (call *SendContactCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendContactCall
- func (call *SendContactCall) ChatID(chatID PeerID) *SendContactCall
- func (call *SendContactCall) DisableNotification(disableNotification bool) *SendContactCall
- func (call *SendContactCall) FirstName(firstName string) *SendContactCall
- func (call *SendContactCall) LastName(lastName string) *SendContactCall
- func (call *SendContactCall) MessageThreadID(messageThreadID int) *SendContactCall
- func (call *SendContactCall) PhoneNumber(phoneNumber string) *SendContactCall
- func (call *SendContactCall) ProtectContent(protectContent bool) *SendContactCall
- func (call *SendContactCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendContactCall
- func (call *SendContactCall) ReplyToMessageID(replyToMessageID int) *SendContactCall
- func (call *SendContactCall) Vcard(vcard string) *SendContactCall
- type SendDiceCall
- func (call *SendDiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendDiceCall
- func (call *SendDiceCall) ChatID(chatID PeerID) *SendDiceCall
- func (call *SendDiceCall) DisableNotification(disableNotification bool) *SendDiceCall
- func (call *SendDiceCall) Emoji(emoji string) *SendDiceCall
- func (call *SendDiceCall) MessageThreadID(messageThreadID int) *SendDiceCall
- func (call *SendDiceCall) ProtectContent(protectContent bool) *SendDiceCall
- func (call *SendDiceCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendDiceCall
- func (call *SendDiceCall) ReplyToMessageID(replyToMessageID int) *SendDiceCall
- type SendDocumentCall
- func (call *SendDocumentCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendDocumentCall
- func (call *SendDocumentCall) Caption(caption string) *SendDocumentCall
- func (call *SendDocumentCall) CaptionEntities(captionEntities []MessageEntity) *SendDocumentCall
- func (call *SendDocumentCall) ChatID(chatID PeerID) *SendDocumentCall
- func (call *SendDocumentCall) DisableContentTypeDetection(disableContentTypeDetection bool) *SendDocumentCall
- func (call *SendDocumentCall) DisableNotification(disableNotification bool) *SendDocumentCall
- func (call *SendDocumentCall) Document(document FileArg) *SendDocumentCall
- func (call *SendDocumentCall) MessageThreadID(messageThreadID int) *SendDocumentCall
- func (call *SendDocumentCall) ParseMode(parseMode ParseMode) *SendDocumentCall
- func (call *SendDocumentCall) ProtectContent(protectContent bool) *SendDocumentCall
- func (call *SendDocumentCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendDocumentCall
- func (call *SendDocumentCall) ReplyToMessageID(replyToMessageID int) *SendDocumentCall
- func (call *SendDocumentCall) Thumbnail(thumbnail FileArg) *SendDocumentCall
- type SendGameCall
- func (call *SendGameCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendGameCall
- func (call *SendGameCall) ChatID(chatID ChatID) *SendGameCall
- func (call *SendGameCall) DisableNotification(disableNotification bool) *SendGameCall
- func (call *SendGameCall) GameShortName(gameShortName string) *SendGameCall
- func (call *SendGameCall) MessageThreadID(messageThreadID int) *SendGameCall
- func (call *SendGameCall) ProtectContent(protectContent bool) *SendGameCall
- func (call *SendGameCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *SendGameCall
- func (call *SendGameCall) ReplyToMessageID(replyToMessageID int) *SendGameCall
- type SendInvoiceCall
- func (call *SendInvoiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendInvoiceCall
- func (call *SendInvoiceCall) ChatID(chatID PeerID) *SendInvoiceCall
- func (call *SendInvoiceCall) Currency(currency string) *SendInvoiceCall
- func (call *SendInvoiceCall) Description(description string) *SendInvoiceCall
- func (call *SendInvoiceCall) DisableNotification(disableNotification bool) *SendInvoiceCall
- func (call *SendInvoiceCall) IsFlexible(isFlexible bool) *SendInvoiceCall
- func (call *SendInvoiceCall) MaxTipAmount(maxTipAmount int) *SendInvoiceCall
- func (call *SendInvoiceCall) MessageThreadID(messageThreadID int) *SendInvoiceCall
- func (call *SendInvoiceCall) NeedEmail(needEmail bool) *SendInvoiceCall
- func (call *SendInvoiceCall) NeedName(needName bool) *SendInvoiceCall
- func (call *SendInvoiceCall) NeedPhoneNumber(needPhoneNumber bool) *SendInvoiceCall
- func (call *SendInvoiceCall) NeedShippingAddress(needShippingAddress bool) *SendInvoiceCall
- func (call *SendInvoiceCall) Payload(payload string) *SendInvoiceCall
- func (call *SendInvoiceCall) PhotoHeight(photoHeight int) *SendInvoiceCall
- func (call *SendInvoiceCall) PhotoSize(photoSize int) *SendInvoiceCall
- func (call *SendInvoiceCall) PhotoURL(photoURL string) *SendInvoiceCall
- func (call *SendInvoiceCall) PhotoWidth(photoWidth int) *SendInvoiceCall
- func (call *SendInvoiceCall) Prices(prices []LabeledPrice) *SendInvoiceCall
- func (call *SendInvoiceCall) ProtectContent(protectContent bool) *SendInvoiceCall
- func (call *SendInvoiceCall) ProviderData(providerData string) *SendInvoiceCall
- func (call *SendInvoiceCall) ProviderToken(providerToken string) *SendInvoiceCall
- func (call *SendInvoiceCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *SendInvoiceCall
- func (call *SendInvoiceCall) ReplyToMessageID(replyToMessageID int) *SendInvoiceCall
- func (call *SendInvoiceCall) SendEmailToProvider(sendEmailToProvider bool) *SendInvoiceCall
- func (call *SendInvoiceCall) SendPhoneNumberToProvider(sendPhoneNumberToProvider bool) *SendInvoiceCall
- func (call *SendInvoiceCall) StartParameter(startParameter string) *SendInvoiceCall
- func (call *SendInvoiceCall) SuggestedTipAmounts(suggestedTipAmounts []int) *SendInvoiceCall
- func (call *SendInvoiceCall) Title(title string) *SendInvoiceCall
- type SendLocationCall
- func (call *SendLocationCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendLocationCall
- func (call *SendLocationCall) ChatID(chatID PeerID) *SendLocationCall
- func (call *SendLocationCall) DisableNotification(disableNotification bool) *SendLocationCall
- func (call *SendLocationCall) Heading(heading int) *SendLocationCall
- func (call *SendLocationCall) HorizontalAccuracy(horizontalAccuracy float64) *SendLocationCall
- func (call *SendLocationCall) Latitude(latitude float64) *SendLocationCall
- func (call *SendLocationCall) LivePeriod(livePeriod int) *SendLocationCall
- func (call *SendLocationCall) Longitude(longitude float64) *SendLocationCall
- func (call *SendLocationCall) MessageThreadID(messageThreadID int) *SendLocationCall
- func (call *SendLocationCall) ProtectContent(protectContent bool) *SendLocationCall
- func (call *SendLocationCall) ProximityAlertRadius(proximityAlertRadius int) *SendLocationCall
- func (call *SendLocationCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendLocationCall
- func (call *SendLocationCall) ReplyToMessageID(replyToMessageID int) *SendLocationCall
- type SendMediaGroupCall
- func (call *SendMediaGroupCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendMediaGroupCall
- func (call *SendMediaGroupCall) ChatID(chatID PeerID) *SendMediaGroupCall
- func (call *SendMediaGroupCall) DisableNotification(disableNotification bool) *SendMediaGroupCall
- func (call *SendMediaGroupCall) Media(media []InputMedia) *SendMediaGroupCall
- func (call *SendMediaGroupCall) MessageThreadID(messageThreadID int) *SendMediaGroupCall
- func (call *SendMediaGroupCall) ProtectContent(protectContent bool) *SendMediaGroupCall
- func (call *SendMediaGroupCall) ReplyToMessageID(replyToMessageID int) *SendMediaGroupCall
- type SendMessageCall
- func (call *SendMessageCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendMessageCall
- func (call *SendMessageCall) ChatID(chatID PeerID) *SendMessageCall
- func (call *SendMessageCall) DisableNotification(disableNotification bool) *SendMessageCall
- func (call *SendMessageCall) DisableWebPagePreview(disableWebPagePreview bool) *SendMessageCall
- func (call *SendMessageCall) Entities(entities []MessageEntity) *SendMessageCall
- func (call *SendMessageCall) MessageThreadID(messageThreadID int) *SendMessageCall
- func (call *SendMessageCall) ParseMode(parseMode ParseMode) *SendMessageCall
- func (call *SendMessageCall) ProtectContent(protectContent bool) *SendMessageCall
- func (call *SendMessageCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendMessageCall
- func (call *SendMessageCall) ReplyToMessageID(replyToMessageID int) *SendMessageCall
- func (call *SendMessageCall) Text(text string) *SendMessageCall
- type SendPhotoCall
- func (call *SendPhotoCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendPhotoCall
- func (call *SendPhotoCall) Caption(caption string) *SendPhotoCall
- func (call *SendPhotoCall) CaptionEntities(captionEntities []MessageEntity) *SendPhotoCall
- func (call *SendPhotoCall) ChatID(chatID PeerID) *SendPhotoCall
- func (call *SendPhotoCall) DisableNotification(disableNotification bool) *SendPhotoCall
- func (call *SendPhotoCall) HasSpoiler(hasSpoiler bool) *SendPhotoCall
- func (call *SendPhotoCall) MessageThreadID(messageThreadID int) *SendPhotoCall
- func (call *SendPhotoCall) ParseMode(parseMode ParseMode) *SendPhotoCall
- func (call *SendPhotoCall) Photo(photo FileArg) *SendPhotoCall
- func (call *SendPhotoCall) ProtectContent(protectContent bool) *SendPhotoCall
- func (call *SendPhotoCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendPhotoCall
- func (call *SendPhotoCall) ReplyToMessageID(replyToMessageID int) *SendPhotoCall
- type SendPollCall
- func (call *SendPollCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendPollCall
- func (call *SendPollCall) AllowsMultipleAnswers(allowsMultipleAnswers bool) *SendPollCall
- func (call *SendPollCall) ChatID(chatID PeerID) *SendPollCall
- func (call *SendPollCall) CloseDate(closeDate int) *SendPollCall
- func (call *SendPollCall) CorrectOptionID(correctOptionID int) *SendPollCall
- func (call *SendPollCall) DisableNotification(disableNotification bool) *SendPollCall
- func (call *SendPollCall) Explanation(explanation string) *SendPollCall
- func (call *SendPollCall) ExplanationEntities(explanationEntities []MessageEntity) *SendPollCall
- func (call *SendPollCall) ExplanationParseMode(explanationParseMode string) *SendPollCall
- func (call *SendPollCall) IsAnonymous(isAnonymous bool) *SendPollCall
- func (call *SendPollCall) IsClosed(isClosed bool) *SendPollCall
- func (call *SendPollCall) MessageThreadID(messageThreadID int) *SendPollCall
- func (call *SendPollCall) OpenPeriod(openPeriod int) *SendPollCall
- func (call *SendPollCall) Options(options []string) *SendPollCall
- func (call *SendPollCall) ProtectContent(protectContent bool) *SendPollCall
- func (call *SendPollCall) Question(question string) *SendPollCall
- func (call *SendPollCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendPollCall
- func (call *SendPollCall) ReplyToMessageID(replyToMessageID int) *SendPollCall
- func (call *SendPollCall) Type(typ string) *SendPollCall
- type SendStickerCall
- func (call *SendStickerCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendStickerCall
- func (call *SendStickerCall) ChatID(chatID PeerID) *SendStickerCall
- func (call *SendStickerCall) DisableNotification(disableNotification bool) *SendStickerCall
- func (call *SendStickerCall) Emoji(emoji string) *SendStickerCall
- func (call *SendStickerCall) MessageThreadID(messageThreadID int) *SendStickerCall
- func (call *SendStickerCall) ProtectContent(protectContent bool) *SendStickerCall
- func (call *SendStickerCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendStickerCall
- func (call *SendStickerCall) ReplyToMessageID(replyToMessageID int) *SendStickerCall
- func (call *SendStickerCall) Sticker(sticker FileArg) *SendStickerCall
- type SendVenueCall
- func (call *SendVenueCall) Address(address string) *SendVenueCall
- func (call *SendVenueCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVenueCall
- func (call *SendVenueCall) ChatID(chatID PeerID) *SendVenueCall
- func (call *SendVenueCall) DisableNotification(disableNotification bool) *SendVenueCall
- func (call *SendVenueCall) FoursquareID(foursquareID string) *SendVenueCall
- func (call *SendVenueCall) FoursquareType(foursquareType string) *SendVenueCall
- func (call *SendVenueCall) GooglePlaceID(googlePlaceID string) *SendVenueCall
- func (call *SendVenueCall) GooglePlaceType(googlePlaceType string) *SendVenueCall
- func (call *SendVenueCall) Latitude(latitude float64) *SendVenueCall
- func (call *SendVenueCall) Longitude(longitude float64) *SendVenueCall
- func (call *SendVenueCall) MessageThreadID(messageThreadID int) *SendVenueCall
- func (call *SendVenueCall) ProtectContent(protectContent bool) *SendVenueCall
- func (call *SendVenueCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVenueCall
- func (call *SendVenueCall) ReplyToMessageID(replyToMessageID int) *SendVenueCall
- func (call *SendVenueCall) Title(title string) *SendVenueCall
- type SendVideoCall
- func (call *SendVideoCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVideoCall
- func (call *SendVideoCall) Caption(caption string) *SendVideoCall
- func (call *SendVideoCall) CaptionEntities(captionEntities []MessageEntity) *SendVideoCall
- func (call *SendVideoCall) ChatID(chatID PeerID) *SendVideoCall
- func (call *SendVideoCall) DisableNotification(disableNotification bool) *SendVideoCall
- func (call *SendVideoCall) Duration(duration int) *SendVideoCall
- func (call *SendVideoCall) HasSpoiler(hasSpoiler bool) *SendVideoCall
- func (call *SendVideoCall) Height(height int) *SendVideoCall
- func (call *SendVideoCall) MessageThreadID(messageThreadID int) *SendVideoCall
- func (call *SendVideoCall) ParseMode(parseMode ParseMode) *SendVideoCall
- func (call *SendVideoCall) ProtectContent(protectContent bool) *SendVideoCall
- func (call *SendVideoCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVideoCall
- func (call *SendVideoCall) ReplyToMessageID(replyToMessageID int) *SendVideoCall
- func (call *SendVideoCall) SupportsStreaming(supportsStreaming bool) *SendVideoCall
- func (call *SendVideoCall) Thumbnail(thumbnail FileArg) *SendVideoCall
- func (call *SendVideoCall) Video(video FileArg) *SendVideoCall
- func (call *SendVideoCall) Width(width int) *SendVideoCall
- type SendVideoNoteCall
- func (call *SendVideoNoteCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVideoNoteCall
- func (call *SendVideoNoteCall) ChatID(chatID PeerID) *SendVideoNoteCall
- func (call *SendVideoNoteCall) DisableNotification(disableNotification bool) *SendVideoNoteCall
- func (call *SendVideoNoteCall) Duration(duration int) *SendVideoNoteCall
- func (call *SendVideoNoteCall) Length(length int) *SendVideoNoteCall
- func (call *SendVideoNoteCall) MessageThreadID(messageThreadID int) *SendVideoNoteCall
- func (call *SendVideoNoteCall) ProtectContent(protectContent bool) *SendVideoNoteCall
- func (call *SendVideoNoteCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVideoNoteCall
- func (call *SendVideoNoteCall) ReplyToMessageID(replyToMessageID int) *SendVideoNoteCall
- func (call *SendVideoNoteCall) Thumbnail(thumbnail FileArg) *SendVideoNoteCall
- func (call *SendVideoNoteCall) VideoNote(videoNote FileArg) *SendVideoNoteCall
- type SendVoiceCall
- func (call *SendVoiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVoiceCall
- func (call *SendVoiceCall) Caption(caption string) *SendVoiceCall
- func (call *SendVoiceCall) CaptionEntities(captionEntities []MessageEntity) *SendVoiceCall
- func (call *SendVoiceCall) ChatID(chatID PeerID) *SendVoiceCall
- func (call *SendVoiceCall) DisableNotification(disableNotification bool) *SendVoiceCall
- func (call *SendVoiceCall) Duration(duration int) *SendVoiceCall
- func (call *SendVoiceCall) MessageThreadID(messageThreadID int) *SendVoiceCall
- func (call *SendVoiceCall) ParseMode(parseMode ParseMode) *SendVoiceCall
- func (call *SendVoiceCall) ProtectContent(protectContent bool) *SendVoiceCall
- func (call *SendVoiceCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVoiceCall
- func (call *SendVoiceCall) ReplyToMessageID(replyToMessageID int) *SendVoiceCall
- func (call *SendVoiceCall) Voice(voice FileArg) *SendVoiceCall
- type SentWebAppMessage
- type SetChatAdministratorCustomTitleCall
- func (call *SetChatAdministratorCustomTitleCall) ChatID(chatID PeerID) *SetChatAdministratorCustomTitleCall
- func (call *SetChatAdministratorCustomTitleCall) CustomTitle(customTitle string) *SetChatAdministratorCustomTitleCall
- func (call *SetChatAdministratorCustomTitleCall) UserID(userID UserID) *SetChatAdministratorCustomTitleCall
- type SetChatDescriptionCall
- type SetChatMenuButtonCall
- type SetChatPermissionsCall
- func (call *SetChatPermissionsCall) ChatID(chatID PeerID) *SetChatPermissionsCall
- func (call *SetChatPermissionsCall) Permissions(permissions ChatPermissions) *SetChatPermissionsCall
- func (call *SetChatPermissionsCall) UseIndependentChatPermissions(useIndependentChatPermissions bool) *SetChatPermissionsCall
- type SetChatPhotoCall
- type SetChatStickerSetCall
- type SetChatTitleCall
- type SetCustomEmojiStickerSetThumbnailCall
- type SetGameScoreCall
- func (call *SetGameScoreCall) ChatID(chatID ChatID) *SetGameScoreCall
- func (call *SetGameScoreCall) DisableEditMessage(disableEditMessage bool) *SetGameScoreCall
- func (call *SetGameScoreCall) Force(force bool) *SetGameScoreCall
- func (call *SetGameScoreCall) InlineMessageID(inlineMessageID string) *SetGameScoreCall
- func (call *SetGameScoreCall) MessageID(messageID int) *SetGameScoreCall
- func (call *SetGameScoreCall) Score(score int) *SetGameScoreCall
- func (call *SetGameScoreCall) UserID(userID UserID) *SetGameScoreCall
- type SetMyCommandsCall
- type SetMyDefaultAdministratorRightsCall
- type SetMyDescriptionCall
- type SetMyNameCall
- type SetMyShortDescriptionCall
- type SetPassportDataErrorsCall
- type SetStickerEmojiListCall
- type SetStickerKeywordsCall
- type SetStickerMaskPositionCall
- type SetStickerPositionInSetCall
- type SetStickerSetThumbnailCall
- type SetStickerSetTitleCall
- type SetWebhookCall
- func (call *SetWebhookCall) AllowedUpdates(allowedUpdates []UpdateType) *SetWebhookCall
- func (call *SetWebhookCall) Certificate(certificate InputFile) *SetWebhookCall
- func (call *SetWebhookCall) DropPendingUpdates(dropPendingUpdates bool) *SetWebhookCall
- func (call *SetWebhookCall) IPAddress(ipAddress string) *SetWebhookCall
- func (call *SetWebhookCall) MaxConnections(maxConnections int) *SetWebhookCall
- func (call *SetWebhookCall) SecretToken(secretToken string) *SetWebhookCall
- func (call *SetWebhookCall) URL(url string) *SetWebhookCall
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type Sticker
- type StickerSet
- type StickerType
- type StopMessageLiveLocationCall
- func (call *StopMessageLiveLocationCall) ChatID(chatID PeerID) *StopMessageLiveLocationCall
- func (call *StopMessageLiveLocationCall) InlineMessageID(inlineMessageID string) *StopMessageLiveLocationCall
- func (call *StopMessageLiveLocationCall) MessageID(messageID int) *StopMessageLiveLocationCall
- func (call *StopMessageLiveLocationCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *StopMessageLiveLocationCall
- type StopPollCall
- type SuccessfulPayment
- type SwitchInlineQueryChosenChat
- type UnbanChatMemberCall
- type UnbanChatSenderChatCall
- type UnhideGeneralForumTopicCall
- type UnpinAllChatMessagesCall
- type UnpinAllForumTopicMessagesCall
- type UnpinChatMessageCall
- type Update
- type UpdateType
- type UploadStickerFileCall
- type User
- type UserID
- type UserProfilePhotos
- type UserShared
- type Username
- type Venue
- type Video
- type VideoChatEnded
- type VideoChatParticipantsInvited
- type VideoChatScheduled
- type VideoChatStarted
- type VideoNote
- type Voice
- type WebAppChat
- type WebAppData
- type WebAppInfo
- type WebAppInitData
- type WebAppUser
- type WebhookInfo
- type WriteAccessAllowed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindClient ¶ added in v0.2.0
BindClient binds Client to the Call. It's useful for chaining calls.
return tg.BindClient(tg.NewGetMeCall(), client).DoVoid(ctx)
func NewButtonColumn ¶ added in v0.0.2
func NewButtonColumn[T Button](buttons ...T) [][]T
NewButtonColumn returns keyboard from a single column of Button.
func NewButtonRow ¶ added in v0.0.2
func NewButtonRow[T Button](buttons ...T) []T
NewButtonRow it's generic helper for create keyboards in functional way.
Types ¶
type AddStickerToSetCall ¶
type AddStickerToSetCall struct {
CallNoResult
}
AddStickerToSetCall reprenesents a call to the addStickerToSet method. Use this method to add a new sticker to a set created by the bot The format of the added sticker must match the format of the other stickers in the set Emoji sticker sets can have up to 200 stickers Animated and video sticker sets can have up to 50 stickers Static sticker sets can have up to 120 stickers
func NewAddStickerToSetCall ¶
func NewAddStickerToSetCall(userID UserID, name string, sticker InputSticker) *AddStickerToSetCall
NewAddStickerToSetCall constructs a new AddStickerToSetCall with required parameters. userID - User identifier of sticker set owner name - Sticker set name sticker - A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.
func (*AddStickerToSetCall) Name ¶
func (call *AddStickerToSetCall) Name(name string) *AddStickerToSetCall
Name Sticker set name
func (*AddStickerToSetCall) Sticker ¶ added in v0.8.0
func (call *AddStickerToSetCall) Sticker(sticker InputSticker) *AddStickerToSetCall
Sticker A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.
func (*AddStickerToSetCall) UserID ¶ added in v0.0.5
func (call *AddStickerToSetCall) UserID(userID UserID) *AddStickerToSetCall
UserID User identifier of sticker set owner
type Animation ¶
type Animation struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Video width as defined by sender Width int `json:"width"` // Video height as defined by sender Height int `json:"height"` // Duration of the video in seconds as defined by sender Duration int `json:"duration"` // Optional. Animation thumbnail as defined by sender Thumbnail *PhotoSize `json:"thumbnail,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 in bytes. FileSize int64 `json:"file_size,omitempty"` }
Animation this object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
type AnswerCallbackQueryCall ¶
type AnswerCallbackQueryCall struct {
CallNoResult
}
AnswerCallbackQueryCall reprenesents a call to the answerCallbackQuery method. 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. Alternatively, the user can be redirected to the specified Game URL For this option to work, you must first create a game for your bot via @BotFather and accept the terms Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
func NewAnswerCallbackQueryCall ¶
func NewAnswerCallbackQueryCall(callbackQueryID string) *AnswerCallbackQueryCall
NewAnswerCallbackQueryCall constructs a new AnswerCallbackQueryCall with required parameters. callbackQueryID - Unique identifier for the query to be answered
func (*AnswerCallbackQueryCall) CacheTime ¶
func (call *AnswerCallbackQueryCall) CacheTime(cacheTime int) *AnswerCallbackQueryCall
CacheTime 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.
func (*AnswerCallbackQueryCall) CallbackQueryID ¶ added in v0.0.5
func (call *AnswerCallbackQueryCall) CallbackQueryID(callbackQueryID string) *AnswerCallbackQueryCall
CallbackQueryID Unique identifier for the query to be answered
func (*AnswerCallbackQueryCall) ShowAlert ¶
func (call *AnswerCallbackQueryCall) ShowAlert(showAlert bool) *AnswerCallbackQueryCall
ShowAlert If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
func (*AnswerCallbackQueryCall) Text ¶
func (call *AnswerCallbackQueryCall) Text(text string) *AnswerCallbackQueryCall
Text Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
func (*AnswerCallbackQueryCall) URL ¶ added in v0.0.5
func (call *AnswerCallbackQueryCall) URL(url string) *AnswerCallbackQueryCall
URL 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.
type AnswerInlineQueryCall ¶
type AnswerInlineQueryCall struct {
CallNoResult
}
AnswerInlineQueryCall reprenesents a call to the answerInlineQuery method. Use this method to send answers to an inline query On success, True is returned.No more than 50 results per query are allowed.
func NewAnswerInlineQueryCall ¶
func NewAnswerInlineQueryCall(inlineQueryID string, results []InlineQueryResult) *AnswerInlineQueryCall
NewAnswerInlineQueryCall constructs a new AnswerInlineQueryCall with required parameters. inlineQueryID - Unique identifier for the answered query results - A JSON-serialized array of results for the inline query
func (*AnswerInlineQueryCall) Button ¶ added in v0.9.0
func (call *AnswerInlineQueryCall) Button(button InlineQueryResultsButton) *AnswerInlineQueryCall
Button A JSON-serialized object describing a button to be shown above inline query results
func (*AnswerInlineQueryCall) CacheTime ¶
func (call *AnswerInlineQueryCall) CacheTime(cacheTime int) *AnswerInlineQueryCall
CacheTime The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
func (*AnswerInlineQueryCall) InlineQueryID ¶ added in v0.0.5
func (call *AnswerInlineQueryCall) InlineQueryID(inlineQueryID string) *AnswerInlineQueryCall
InlineQueryID Unique identifier for the answered query
func (*AnswerInlineQueryCall) IsPersonal ¶
func (call *AnswerInlineQueryCall) IsPersonal(isPersonal bool) *AnswerInlineQueryCall
IsPersonal 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.
func (*AnswerInlineQueryCall) NextOffset ¶
func (call *AnswerInlineQueryCall) NextOffset(nextOffset string) *AnswerInlineQueryCall
NextOffset 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.
func (*AnswerInlineQueryCall) Results ¶
func (call *AnswerInlineQueryCall) Results(results []InlineQueryResult) *AnswerInlineQueryCall
Results A JSON-serialized array of results for the inline query
type AnswerPreCheckoutQueryCall ¶
type AnswerPreCheckoutQueryCall struct {
CallNoResult
}
AnswerPreCheckoutQueryCall reprenesents a call to the answerPreCheckoutQuery method. Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query Use this method to respond to such pre-checkout queries On success, True is returned Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
func NewAnswerPreCheckoutQueryCall ¶
func NewAnswerPreCheckoutQueryCall(preCheckoutQueryID string, ok bool) *AnswerPreCheckoutQueryCall
NewAnswerPreCheckoutQueryCall constructs a new AnswerPreCheckoutQueryCall with required parameters. preCheckoutQueryID - Unique identifier for the query to be answered ok - Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
func (*AnswerPreCheckoutQueryCall) ErrorMessage ¶
func (call *AnswerPreCheckoutQueryCall) ErrorMessage(errorMessage string) *AnswerPreCheckoutQueryCall
ErrorMessage 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.
func (*AnswerPreCheckoutQueryCall) Ok ¶
func (call *AnswerPreCheckoutQueryCall) Ok(ok bool) *AnswerPreCheckoutQueryCall
Ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
func (*AnswerPreCheckoutQueryCall) PreCheckoutQueryID ¶ added in v0.0.5
func (call *AnswerPreCheckoutQueryCall) PreCheckoutQueryID(preCheckoutQueryID string) *AnswerPreCheckoutQueryCall
PreCheckoutQueryID Unique identifier for the query to be answered
type AnswerShippingQueryCall ¶
type AnswerShippingQueryCall struct {
CallNoResult
}
AnswerShippingQueryCall reprenesents a call to the answerShippingQuery method. If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot Use this method to reply to shipping queries On success, True is returned.
func NewAnswerShippingQueryCall ¶
func NewAnswerShippingQueryCall(shippingQueryID string, ok bool) *AnswerShippingQueryCall
NewAnswerShippingQueryCall constructs a new AnswerShippingQueryCall with required parameters. shippingQueryID - Unique identifier for the query to be answered ok - Pass 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)
func (*AnswerShippingQueryCall) ErrorMessage ¶
func (call *AnswerShippingQueryCall) ErrorMessage(errorMessage string) *AnswerShippingQueryCall
ErrorMessage 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.
func (*AnswerShippingQueryCall) Ok ¶
func (call *AnswerShippingQueryCall) Ok(ok bool) *AnswerShippingQueryCall
Ok Pass 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)
func (*AnswerShippingQueryCall) ShippingOptions ¶
func (call *AnswerShippingQueryCall) ShippingOptions(shippingOptions []ShippingOption) *AnswerShippingQueryCall
ShippingOptions Required if ok is True. A JSON-serialized array of available shipping options.
func (*AnswerShippingQueryCall) ShippingQueryID ¶ added in v0.0.5
func (call *AnswerShippingQueryCall) ShippingQueryID(shippingQueryID string) *AnswerShippingQueryCall
ShippingQueryID Unique identifier for the query to be answered
type AnswerWebAppQueryCall ¶
type AnswerWebAppQueryCall struct { Call[SentWebAppMessage] }
AnswerWebAppQueryCall reprenesents a call to the answerWebAppQuery method. Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated On success, a SentWebAppMessage object is returned.
func NewAnswerWebAppQueryCall ¶
func NewAnswerWebAppQueryCall(webAppQueryID string, result InlineQueryResult) *AnswerWebAppQueryCall
NewAnswerWebAppQueryCall constructs a new AnswerWebAppQueryCall with required parameters. webAppQueryID - Unique identifier for the query to be answered result - A JSON-serialized object describing the message to be sent
func (*AnswerWebAppQueryCall) Result ¶
func (call *AnswerWebAppQueryCall) Result(result InlineQueryResult) *AnswerWebAppQueryCall
Result A JSON-serialized object describing the message to be sent
func (*AnswerWebAppQueryCall) WebAppQueryID ¶ added in v0.0.5
func (call *AnswerWebAppQueryCall) WebAppQueryID(webAppQueryID string) *AnswerWebAppQueryCall
WebAppQueryID Unique identifier for the query to be answered
type ApproveChatJoinRequestCall ¶
type ApproveChatJoinRequestCall struct {
CallNoResult
}
ApproveChatJoinRequestCall reprenesents a call to the approveChatJoinRequest method. Use this method to approve a chat join request The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right
func NewApproveChatJoinRequestCall ¶
func NewApproveChatJoinRequestCall(chatID PeerID, userID UserID) *ApproveChatJoinRequestCall
NewApproveChatJoinRequestCall constructs a new ApproveChatJoinRequestCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) userID - Unique identifier of the target user
func (*ApproveChatJoinRequestCall) ChatID ¶ added in v0.0.5
func (call *ApproveChatJoinRequestCall) ChatID(chatID PeerID) *ApproveChatJoinRequestCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*ApproveChatJoinRequestCall) UserID ¶ added in v0.0.5
func (call *ApproveChatJoinRequestCall) UserID(userID UserID) *ApproveChatJoinRequestCall
UserID Unique identifier of the target user
type Audio ¶
type Audio struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Duration of the audio in seconds as defined by sender Duration int `json:"duration"` // 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 in bytes. FileSize int64 `json:"file_size,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs Thumbnail *PhotoSize `json:"thumbnail,omitempty"` }
Audio this object represents an audio file to be treated as music by the Telegram clients.
type AuthWidget ¶ added in v0.0.5
type AuthWidget struct { ID UserID `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name,omitempty"` Username string `json:"username,omitempty"` PhotoURL string `json:"photo_url,omitempty"` AuthDate int64 `json:"auth_date"` Hash string `json:"hash"` }
AuthWidget represents Telegram Login Widget data.
See https://core.telegram.org/widgets/login#receiving-authorization-data for more information.
func ParseAuthWidgetQuery ¶ added in v0.0.5
func ParseAuthWidgetQuery(vs url.Values) (*AuthWidget, error)
ParseAuthWidgetQuery parses a query string and returns an AuthWidget.
func (AuthWidget) AuthDateTime ¶ added in v0.0.5
func (w AuthWidget) AuthDateTime() time.Time
AuthDateTime returns the AuthDate as a time.Time.
func (AuthWidget) Query ¶ added in v0.0.5
func (w AuthWidget) Query() url.Values
Query returns a query values for the widget.
func (AuthWidget) Signature ¶ added in v0.0.5
func (w AuthWidget) Signature(token string) string
Signature returns the signature of the widget data.
func (AuthWidget) Valid ¶ added in v0.0.5
func (w AuthWidget) Valid(token string) bool
Valid returns true if the signature is valid.
type BanChatMemberCall ¶
type BanChatMemberCall struct {
CallNoResult
}
BanChatMemberCall reprenesents a call to the banChatMember method. Use this method to ban a user in a group, a supergroup or a channel In the case of supergroups and channels, the user will not be able to return to the chat 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 administrator rights
func NewBanChatMemberCall ¶
func NewBanChatMemberCall(chatID PeerID, userID UserID) *BanChatMemberCall
NewBanChatMemberCall constructs a new BanChatMemberCall with required parameters. chatID - Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) userID - Unique identifier of the target user
func (*BanChatMemberCall) ChatID ¶ added in v0.0.5
func (call *BanChatMemberCall) ChatID(chatID PeerID) *BanChatMemberCall
ChatID Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
func (*BanChatMemberCall) RevokeMessages ¶
func (call *BanChatMemberCall) RevokeMessages(revokeMessages bool) *BanChatMemberCall
RevokeMessages Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
func (*BanChatMemberCall) UntilDate ¶
func (call *BanChatMemberCall) UntilDate(untilDate int) *BanChatMemberCall
UntilDate 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. Applied for supergroups and channels only.
func (*BanChatMemberCall) UserID ¶ added in v0.0.5
func (call *BanChatMemberCall) UserID(userID UserID) *BanChatMemberCall
UserID Unique identifier of the target user
type BanChatSenderChatCall ¶
type BanChatSenderChatCall struct {
CallNoResult
}
BanChatSenderChatCall reprenesents a call to the banChatSenderChat method. Use this method to ban a channel chat in a supergroup or a channel Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights
func NewBanChatSenderChatCall ¶
func NewBanChatSenderChatCall(chatID PeerID, senderChatID int) *BanChatSenderChatCall
NewBanChatSenderChatCall constructs a new BanChatSenderChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) senderChatID - Unique identifier of the target sender chat
func (*BanChatSenderChatCall) ChatID ¶ added in v0.0.5
func (call *BanChatSenderChatCall) ChatID(chatID PeerID) *BanChatSenderChatCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*BanChatSenderChatCall) SenderChatID ¶ added in v0.0.5
func (call *BanChatSenderChatCall) SenderChatID(senderChatID int) *BanChatSenderChatCall
SenderChatID Unique identifier of the target sender chat
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"` // Description of the command; 1-256 characters. Description string `json:"description"` }
BotCommand this object represents a bot command.
type BotCommandScope ¶
BotCommandScope it's generic interface for all types of bot command scope.
Known implementations:
type BotCommandScopeAllChatAdministrators ¶
type BotCommandScopeAllChatAdministrators struct { // Scope type, must be all_chat_administrators Type string `json:"type"` }
BotCommandScopeAllChatAdministrators represents the scope of bot commands, covering all group and supergroup chat administrators.
func (BotCommandScopeAllChatAdministrators) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error)
type BotCommandScopeAllGroupChats ¶
type BotCommandScopeAllGroupChats struct { // Scope type, must be all_group_chats Type string `json:"type"` }
BotCommandScopeAllGroupChats represents the scope of bot commands, covering all group and supergroup chats.
func (BotCommandScopeAllGroupChats) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error)
type BotCommandScopeAllPrivateChats ¶
type BotCommandScopeAllPrivateChats struct { // Scope type, must be all_private_chats Type string `json:"type"` }
BotCommandScopeAllPrivateChats represents the scope of bot commands, covering all private chats.
func (BotCommandScopeAllPrivateChats) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error)
type BotCommandScopeChat ¶
type BotCommandScopeChat struct { // Scope type, must be chat Type string `json:"type"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) ChatID ChatID `json:"chat_id"` }
BotCommandScopeChat represents the scope of bot commands, covering a specific chat.
func (BotCommandScopeChat) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeChat) MarshalJSON() ([]byte, error)
type BotCommandScopeChatAdministrators ¶
type BotCommandScopeChatAdministrators struct { // Scope type, must be chat_administrators Type string `json:"type"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) ChatID ChatID `json:"chat_id"` }
BotCommandScopeChatAdministrators represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
func (BotCommandScopeChatAdministrators) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error)
type BotCommandScopeChatMember ¶
type BotCommandScopeChatMember struct { // Scope type, must be chat_member Type string `json:"type"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) ChatID ChatID `json:"chat_id"` // Unique identifier of the target user UserID int `json:"user_id"` }
BotCommandScopeChatMember represents the scope of bot commands, covering a specific member of a group or supergroup chat.
func (BotCommandScopeChatMember) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeChatMember) MarshalJSON() ([]byte, error)
type BotCommandScopeDefault ¶
type BotCommandScopeDefault struct { // Scope type, must be default Type string `json:"type"` }
BotCommandScopeDefault represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
func (BotCommandScopeDefault) MarshalJSON ¶ added in v0.0.5
func (scope BotCommandScopeDefault) MarshalJSON() ([]byte, error)
type BotDescription ¶ added in v0.8.0
type BotDescription struct { // The bot's description Description string `json:"description"` }
BotDescription this object represents the bot's description.
type BotName ¶ added in v0.9.0
type BotName struct { // The bot's name Name string `json:"name"` }
BotName this object represents the bot's name.
type BotShortDescription ¶ added in v0.8.0
type BotShortDescription struct { // The bot's short description ShortDescription string `json:"short_description"` }
BotShortDescription this object represents the bot's short description.
type Button ¶ added in v0.0.2
type Button interface { InlineKeyboardButton | KeyboardButton }
Button define generic button interface
type ButtonLayout ¶ added in v0.0.2
type ButtonLayout[T Button] struct { // contains filtered or unexported fields }
ButtonLayout it's build for fixed width keyboards.
func NewButtonLayout ¶ added in v0.0.2
func NewButtonLayout[T Button](rowWidth int, buttons ...T) *ButtonLayout[T]
NewButtonLayout creates layout with specified width. Buttons will be added via Insert method.
func (*ButtonLayout[T]) Add ¶ added in v0.0.2
func (layout *ButtonLayout[T]) Add(buttons ...T) *ButtonLayout[T]
Add accepts any number of buttons, always starts adding from a new row and adds a row when it reaches the set width.
func (*ButtonLayout[T]) Insert ¶ added in v0.0.2
func (layout *ButtonLayout[T]) Insert(buttons ...T) *ButtonLayout[T]
Insert buttons to last row if possible, or create new and insert.
func (*ButtonLayout[T]) Keyboard ¶ added in v0.0.2
func (layout *ButtonLayout[T]) Keyboard() [][]T
Keyboard returns result of building.
func (*ButtonLayout[T]) Row ¶ added in v0.0.2
func (layout *ButtonLayout[T]) Row(buttons ...T) *ButtonLayout[T]
Row add new row with no respect for row width
type Call ¶
type Call[T any] struct { // contains filtered or unexported fields }
func (*Call[T]) MarshalJSON ¶
type CallNoResult ¶
type CallNoResult struct {
// contains filtered or unexported fields
}
func (*CallNoResult) Bind ¶
func (call *CallNoResult) Bind(client *Client)
func (*CallNoResult) DoVoid ¶ added in v0.0.3
func (call *CallNoResult) DoVoid(ctx context.Context) (err error)
func (*CallNoResult) MarshalJSON ¶
func (call *CallNoResult) MarshalJSON() ([]byte, error)
func (*CallNoResult) Request ¶ added in v0.0.3
func (call *CallNoResult) Request() *Request
type CallbackGame ¶
type CallbackGame struct{}
type CallbackQuery ¶
type CallbackQuery struct { // Unique identifier for this query ID string `json:"id"` // Sender From User `json:"from"` // 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"` // Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. 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"` }
CallbackQuery 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.
type Chat ¶
type Chat struct { // Unique identifier for this chat. ID ChatID `json:"id"` // Type of chat, can be either “private”, “group”, “supergroup” or “channel” Type ChatType `json:"type"` // Optional. Title, for supergroups, channels and group chats Title string `json:"title,omitempty"` // Optional. Username, for private chats, supergroups and channels if available Username Username `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. True, if the supergroup chat is a forum (has topics enabled) IsForum bool `json:"is_forum,omitempty"` // Optional. Chat photo. Returned only in getChat. Photo *ChatPhoto `json:"photo,omitempty"` // Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. ActiveUsernames []string `json:"active_usernames,omitempty"` // Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` // Optional. Bio of the other party in a private chat. Returned only in getChat. Bio string `json:"bio,omitempty"` // Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. HasPrivateForwards bool `json:"has_private_forwards,omitempty"` // Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"` // Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat. JoinToSendMessages bool `json:"join_to_send_messages,omitempty"` // Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. JoinByRequest bool `json:"join_by_request,omitempty"` // Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. Description string `json:"description,omitempty"` // Optional. Primary invite link, for groups, supergroups and channel chats. 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; in seconds. Returned only in getChat. SlowModeDelay int `json:"slow_mode_delay,omitempty"` // Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"` // Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"` // Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat. HasHiddenMembers bool `json:"has_hidden_members,omitempty"` // Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. HasProtectedContent bool `json:"has_protected_content,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. 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"` }
Chat this object represents a chat.
type ChatAction ¶ added in v0.0.4
type ChatAction int8
ChatAction type of action to broadcast via sendChatAction.
const ( ChatActionTyping ChatAction = iota + 1 ChatActionUploadPhoto ChatActionRecordVideo ChatActionUploadVideo ChatActionRecordVoice ChatActionUploadVoice ChatActionUploadDocument ChatActionChooseSticker ChatActionFindLocation ChatActionRecordVideoNote ChatActionUploadVideoNote )
func (ChatAction) String ¶ added in v0.0.4
func (action ChatAction) String() string
type ChatAdministratorRights ¶
type ChatAdministratorRights struct { // True, if the user's presence in the chat is hidden IsAnonymous bool `json:"is_anonymous"` // True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can delete messages of other users CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can manage video chats CanManageVideoChats bool `json:"can_manage_video_chats"` // True, if the administrator can restrict, ban or unban chat members CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) CanPromoteMembers bool `json:"can_promote_members"` // True, if the user is allowed to change the chat title, photo and other settings CanChangeInfo bool `json:"can_change_info"` // True, if the user is allowed to invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` // Optional. True, if the administrator can post in the channel; channels only CanPostMessages bool `json:"can_post_messages,omitempty"` // Optional. True, if the administrator can edit messages of other users and can pin messages; channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Optional. True, if the user is allowed to pin messages; groups and supergroups only CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only CanManageTopics bool `json:"can_manage_topics,omitempty"` }
ChatAdministratorRights represents the rights of an administrator in a chat.
type ChatInviteLink ¶
type ChatInviteLink struct { // The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. InviteLink string `json:"invite_link"` // Creator of the link Creator User `json:"creator"` // True, if users joining the chat via the link need to be approved by chat administrators CreatesJoinRequest bool `json:"creates_join_request"` // True, if the link is primary IsPrimary bool `json:"is_primary"` // True, if the link is revoked IsRevoked bool `json:"is_revoked"` // Optional. Invite link name Name string `json:"name,omitempty"` // Optional. Point in time (Unix timestamp) when the link will expire or has been expired ExpireDate int `json:"expire_date,omitempty"` // Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 MemberLimit int `json:"member_limit,omitempty"` // Optional. Number of pending join requests created using this link PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"` }
ChatInviteLink represents an invite link for a chat.
type ChatJoinRequest ¶
type ChatJoinRequest struct { // Chat to which the request was sent Chat Chat `json:"chat"` // User that sent the join request From User `json:"from"` // Identifier of a private chat with the user who sent the join request. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. UserChatID int64 `json:"user_chat_id"` // Date the request was sent in Unix time Date int `json:"date"` // Optional. Bio of the user. Bio string `json:"bio,omitempty"` // Optional. Chat invite link that was used by the user to send the join request InviteLink *ChatInviteLink `json:"invite_link,omitempty"` }
ChatJoinRequest represents a join request sent to a chat.
type ChatLocation ¶
type ChatLocation struct { // The location to which the supergroup is connected. Can't be a live location. Location Location `json:"location"` // Location address; 1-64 characters, as defined by the chat owner Address string `json:"address"` }
ChatLocation represents a location to which a chat is connected.
type ChatMember ¶
type ChatMember struct { // The member's status in the chat, always “creator” Status string `json:"status"` // Information about the user User User `json:"user"` // True, if the user's presence in the chat is hidden IsAnonymous bool `json:"is_anonymous"` // Optional. Custom title for this user CustomTitle string `json:"custom_title,omitempty"` }
ChatMember this object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
type ChatMemberAdministrator ¶
type ChatMemberAdministrator struct { // The member's status in the chat, always “administrator” Status string `json:"status"` // Information about the user User User `json:"user"` // True, if the bot is allowed to edit administrator privileges of that user CanBeEdited bool `json:"can_be_edited"` // True, if the user's presence in the chat is hidden IsAnonymous bool `json:"is_anonymous"` // True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can delete messages of other users CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can manage video chats CanManageVideoChats bool `json:"can_manage_video_chats"` // True, if the administrator can restrict, ban or unban chat members CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) CanPromoteMembers bool `json:"can_promote_members"` // True, if the user is allowed to change the chat title, photo and other settings CanChangeInfo bool `json:"can_change_info"` // True, if the user is allowed to invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` // Optional. True, if the administrator can post in the channel; channels only CanPostMessages bool `json:"can_post_messages,omitempty"` // Optional. True, if the administrator can edit messages of other users and can pin messages; channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Optional. True, if the user is allowed to pin messages; groups and supergroups only CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only CanManageTopics bool `json:"can_manage_topics,omitempty"` // Optional. Custom title for this user CustomTitle string `json:"custom_title,omitempty"` }
ChatMemberAdministrator represents a chat member that has some additional privileges.
type ChatMemberBanned ¶
type ChatMemberBanned struct { // The member's status in the chat, always “kicked” Status string `json:"status"` // Information about the user User User `json:"user"` // Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever UntilDate int `json:"until_date"` }
ChatMemberBanned represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
type ChatMemberLeft ¶
type ChatMemberLeft struct { // The member's status in the chat, always “left” Status string `json:"status"` // Information about the user User User `json:"user"` }
ChatMemberLeft represents a chat member that isn't currently a member of the chat, but may join it themselves.
type ChatMemberMember ¶
type ChatMemberMember struct { // The member's status in the chat, always “member” Status string `json:"status"` // Information about the user User User `json:"user"` }
ChatMemberMember represents a chat member that has no additional privileges or restrictions.
type ChatMemberOwner ¶
type ChatMemberOwner struct { // The member's status in the chat, always “creator” Status string `json:"status"` // Information about the user User User `json:"user"` // True, if the user's presence in the chat is hidden IsAnonymous bool `json:"is_anonymous"` // Optional. Custom title for this user CustomTitle string `json:"custom_title,omitempty"` }
ChatMemberOwner represents a chat member that owns the chat and has all administrator privileges.
type ChatMemberRestricted ¶
type ChatMemberRestricted struct { // The member's status in the chat, always “restricted” Status string `json:"status"` // Information about the user User User `json:"user"` // True, if the user is a member of the chat at the moment of the request IsMember bool `json:"is_member"` // True, if the user is allowed to send text messages, contacts, invoices, locations and venues CanSendMessages bool `json:"can_send_messages"` // True, if the user is allowed to send audios CanSendAudios bool `json:"can_send_audios"` // True, if the user is allowed to send documents CanSendDocuments bool `json:"can_send_documents"` // True, if the user is allowed to send photos CanSendPhotos bool `json:"can_send_photos"` // True, if the user is allowed to send videos CanSendVideos bool `json:"can_send_videos"` // True, if the user is allowed to send video notes CanSendVideoNotes bool `json:"can_send_video_notes"` // True, if the user is allowed to send voice notes CanSendVoiceNotes bool `json:"can_send_voice_notes"` // True, if the user is allowed to send polls CanSendPolls bool `json:"can_send_polls"` // True, if the user is allowed to send animations, games, stickers and use inline bots CanSendOtherMessages bool `json:"can_send_other_messages"` // True, if the user is allowed to add web page previews to their messages CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` // True, if the user is allowed to change the chat title, photo and other settings CanChangeInfo bool `json:"can_change_info"` // True, if the user is allowed to invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` // True, if the user is allowed to pin messages CanPinMessages bool `json:"can_pin_messages"` // True, if the user is allowed to create forum topics CanManageTopics bool `json:"can_manage_topics"` // Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever UntilDate int `json:"until_date"` }
ChatMemberRestricted represents a chat member that is under certain restrictions in the chat. Supergroups only.
type ChatMemberUpdated ¶
type ChatMemberUpdated struct { // Chat the user belongs to Chat Chat `json:"chat"` // Performer of the action, which resulted in the change From User `json:"from"` // Date the change was done in Unix time Date int `json:"date"` // Previous information about the chat member OldChatMember ChatMember `json:"old_chat_member"` // New information about the chat member NewChatMember ChatMember `json:"new_chat_member"` // Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. InviteLink *ChatInviteLink `json:"invite_link,omitempty"` // Optional. True, if the user joined the chat via a chat folder invite link ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link,omitempty"` }
ChatMemberUpdated this object represents changes in the status of a chat member.
type ChatPermissions ¶
type ChatPermissions struct { // Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues CanSendMessages bool `json:"can_send_messages,omitempty"` // Optional. True, if the user is allowed to send audios CanSendAudios bool `json:"can_send_audios,omitempty"` // Optional. True, if the user is allowed to send documents CanSendDocuments bool `json:"can_send_documents,omitempty"` // Optional. True, if the user is allowed to send photos CanSendPhotos bool `json:"can_send_photos,omitempty"` // Optional. True, if the user is allowed to send videos CanSendVideos bool `json:"can_send_videos,omitempty"` // Optional. True, if the user is allowed to send video notes CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"` // Optional. True, if the user is allowed to send voice notes CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"` // Optional. True, if the user is allowed to send polls CanSendPolls bool `json:"can_send_polls,omitempty"` // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // Optional. True, if the user is allowed to add web page previews to their 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"` // Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages CanManageTopics bool `json:"can_manage_topics,omitempty"` }
ChatPermissions describes actions that a non-administrator user is allowed to take in a chat.
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 FileID `json:"small_file_id"` // 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"` // 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 FileID `json:"big_file_id"` // 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"` }
ChatPhoto this object represents a chat photo.
type ChatShared ¶ added in v0.6.0
ChatShared this object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
type ChatType ¶ added in v0.0.2
type ChatType int8
ChatType represents enum of possible chat types.
const ( // ChatTypePrivate represents one-to-one chat. ChatTypePrivate ChatType = iota + 1 // ChatTypeGroup represents group chats. ChatTypeGroup // ChatTypeSupergroup supergroup chats. ChatTypeSupergroup // ChatTypeChannel represents channels ChatTypeChannel // ChatTypeSender for a private chat with the inline query sender ChatTypeSender )
func (ChatType) MarshalJSON ¶ added in v0.0.2
func (*ChatType) UnmarshalJSON ¶ added in v0.0.2
type ChosenInlineResult ¶
type ChosenInlineResult struct { // The unique identifier for the result that was chosen ResultID string `json:"result_id"` // The user that chose the result From User `json:"from"` // 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"` }
ChosenInlineResult represents a result of an inline query that was chosen by the user and sent to their chat partner.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is Telegram Bot API client structure. Create new client with NewClient function.
func New ¶
func New(token string, options ...ClientOption) *Client
New creates new Client with given token and options.
func (*Client) AddStickerToSet ¶
func (client *Client) AddStickerToSet(userID UserID, name string, sticker InputSticker) *AddStickerToSetCall
AddStickerToSetCall constructs a new AddStickerToSetCall with required parameters.
func (*Client) AnswerCallbackQuery ¶
func (client *Client) AnswerCallbackQuery(callbackQueryID string) *AnswerCallbackQueryCall
AnswerCallbackQueryCall constructs a new AnswerCallbackQueryCall with required parameters.
func (*Client) AnswerInlineQuery ¶
func (client *Client) AnswerInlineQuery(inlineQueryID string, results []InlineQueryResult) *AnswerInlineQueryCall
AnswerInlineQueryCall constructs a new AnswerInlineQueryCall with required parameters.
func (*Client) AnswerPreCheckoutQuery ¶
func (client *Client) AnswerPreCheckoutQuery(preCheckoutQueryID string, ok bool) *AnswerPreCheckoutQueryCall
AnswerPreCheckoutQueryCall constructs a new AnswerPreCheckoutQueryCall with required parameters.
func (*Client) AnswerShippingQuery ¶
func (client *Client) AnswerShippingQuery(shippingQueryID string, ok bool) *AnswerShippingQueryCall
AnswerShippingQueryCall constructs a new AnswerShippingQueryCall with required parameters.
func (*Client) AnswerWebAppQuery ¶
func (client *Client) AnswerWebAppQuery(webAppQueryID string, result InlineQueryResult) *AnswerWebAppQueryCall
AnswerWebAppQueryCall constructs a new AnswerWebAppQueryCall with required parameters.
func (*Client) ApproveChatJoinRequest ¶
func (client *Client) ApproveChatJoinRequest(chatID PeerID, userID UserID) *ApproveChatJoinRequestCall
ApproveChatJoinRequestCall constructs a new ApproveChatJoinRequestCall with required parameters.
func (*Client) BanChatMember ¶
func (client *Client) BanChatMember(chatID PeerID, userID UserID) *BanChatMemberCall
BanChatMemberCall constructs a new BanChatMemberCall with required parameters.
func (*Client) BanChatSenderChat ¶
func (client *Client) BanChatSenderChat(chatID PeerID, senderChatID int) *BanChatSenderChatCall
BanChatSenderChatCall constructs a new BanChatSenderChatCall with required parameters.
func (*Client) CloseForumTopic ¶ added in v0.6.0
func (client *Client) CloseForumTopic(chatID PeerID, messageThreadID int) *CloseForumTopicCall
CloseForumTopicCall constructs a new CloseForumTopicCall with required parameters.
func (*Client) CloseGeneralForumTopic ¶ added in v0.6.0
func (client *Client) CloseGeneralForumTopic(chatID PeerID) *CloseGeneralForumTopicCall
CloseGeneralForumTopicCall constructs a new CloseGeneralForumTopicCall with required parameters.
func (*Client) CopyMessage ¶
func (client *Client) CopyMessage(chatID PeerID, fromChatID PeerID, messageID int) *CopyMessageCall
CopyMessageCall constructs a new CopyMessageCall with required parameters.
func (*Client) CreateChatInviteLink ¶
func (client *Client) CreateChatInviteLink(chatID PeerID) *CreateChatInviteLinkCall
CreateChatInviteLinkCall constructs a new CreateChatInviteLinkCall with required parameters.
func (*Client) CreateForumTopic ¶ added in v0.6.0
func (client *Client) CreateForumTopic(chatID PeerID, name string) *CreateForumTopicCall
CreateForumTopicCall constructs a new CreateForumTopicCall with required parameters.
func (*Client) CreateInvoiceLink ¶
func (client *Client) CreateInvoiceLink(title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *CreateInvoiceLinkCall
CreateInvoiceLinkCall constructs a new CreateInvoiceLinkCall with required parameters.
func (*Client) CreateNewStickerSet ¶
func (client *Client) CreateNewStickerSet(userID UserID, name string, title string, stickers []InputSticker, stickerFormat string) *CreateNewStickerSetCall
CreateNewStickerSetCall constructs a new CreateNewStickerSetCall with required parameters.
func (*Client) DeclineChatJoinRequest ¶
func (client *Client) DeclineChatJoinRequest(chatID PeerID, userID UserID) *DeclineChatJoinRequestCall
DeclineChatJoinRequestCall constructs a new DeclineChatJoinRequestCall with required parameters.
func (*Client) DeleteChatPhoto ¶
func (client *Client) DeleteChatPhoto(chatID PeerID) *DeleteChatPhotoCall
DeleteChatPhotoCall constructs a new DeleteChatPhotoCall with required parameters.
func (*Client) DeleteChatStickerSet ¶
func (client *Client) DeleteChatStickerSet(chatID PeerID) *DeleteChatStickerSetCall
DeleteChatStickerSetCall constructs a new DeleteChatStickerSetCall with required parameters.
func (*Client) DeleteForumTopic ¶ added in v0.6.0
func (client *Client) DeleteForumTopic(chatID PeerID, messageThreadID int) *DeleteForumTopicCall
DeleteForumTopicCall constructs a new DeleteForumTopicCall with required parameters.
func (*Client) DeleteMessage ¶
func (client *Client) DeleteMessage(chatID PeerID, messageID int) *DeleteMessageCall
DeleteMessageCall constructs a new DeleteMessageCall with required parameters.
func (*Client) DeleteMyCommands ¶
func (client *Client) DeleteMyCommands() *DeleteMyCommandsCall
DeleteMyCommandsCall constructs a new DeleteMyCommandsCall with required parameters.
func (*Client) DeleteStickerFromSet ¶
func (client *Client) DeleteStickerFromSet(sticker string) *DeleteStickerFromSetCall
DeleteStickerFromSetCall constructs a new DeleteStickerFromSetCall with required parameters.
func (*Client) DeleteStickerSet ¶ added in v0.8.0
func (client *Client) DeleteStickerSet(name string) *DeleteStickerSetCall
DeleteStickerSetCall constructs a new DeleteStickerSetCall with required parameters.
func (*Client) DeleteWebhook ¶
func (client *Client) DeleteWebhook() *DeleteWebhookCall
DeleteWebhookCall constructs a new DeleteWebhookCall with required parameters.
func (*Client) Download ¶ added in v0.1.0
Download file by path from Client.GetFile method. Don't forget to close ReadCloser.
func (*Client) EditChatInviteLink ¶
func (client *Client) EditChatInviteLink(chatID PeerID, inviteLink string) *EditChatInviteLinkCall
EditChatInviteLinkCall constructs a new EditChatInviteLinkCall with required parameters.
func (*Client) EditForumTopic ¶ added in v0.6.0
func (client *Client) EditForumTopic(chatID PeerID, messageThreadID int) *EditForumTopicCall
EditForumTopicCall constructs a new EditForumTopicCall with required parameters.
func (*Client) EditGeneralForumTopic ¶ added in v0.6.0
func (client *Client) EditGeneralForumTopic(chatID PeerID, name string) *EditGeneralForumTopicCall
EditGeneralForumTopicCall constructs a new EditGeneralForumTopicCall with required parameters.
func (*Client) EditMessageCaption ¶
func (client *Client) EditMessageCaption(chatID PeerID, messageID int, caption string) *EditMessageCaptionCall
EditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters.
func (*Client) EditMessageCaptionInline ¶ added in v0.0.3
func (client *Client) EditMessageCaptionInline(inlineMessageID string, caption string) *EditMessageCaptionCall
EditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters.
func (*Client) EditMessageLiveLocation ¶
func (client *Client) EditMessageLiveLocation(chatID PeerID, messageID int) *EditMessageLiveLocationCall
EditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters.
func (*Client) EditMessageLiveLocationInline ¶
func (client *Client) EditMessageLiveLocationInline(inlineMessageID string) *EditMessageLiveLocationCall
EditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters.
func (*Client) EditMessageMedia ¶
func (client *Client) EditMessageMedia(media InputMedia) *EditMessageMediaCall
EditMessageMediaCall constructs a new EditMessageMediaCall with required parameters.
func (*Client) EditMessageReplyMarkup ¶
func (client *Client) EditMessageReplyMarkup(chatID PeerID, messageID int) *EditMessageReplyMarkupCall
EditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters.
func (*Client) EditMessageReplyMarkupInline ¶ added in v0.0.3
func (client *Client) EditMessageReplyMarkupInline(inlineMessageID string) *EditMessageReplyMarkupCall
EditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters.
func (*Client) EditMessageText ¶
func (client *Client) EditMessageText(chatID PeerID, messageID int, text string) *EditMessageTextCall
EditMessageTextCall constructs a new EditMessageTextCall with required parameters.
func (*Client) EditMessageTextInline ¶ added in v0.0.3
func (client *Client) EditMessageTextInline(inlineMessageID string, text string) *EditMessageTextCall
EditMessageTextCall constructs a new EditMessageTextCall with required parameters.
func (*Client) ExportChatInviteLink ¶
func (client *Client) ExportChatInviteLink(chatID PeerID) *ExportChatInviteLinkCall
ExportChatInviteLinkCall constructs a new ExportChatInviteLinkCall with required parameters.
func (*Client) ForwardMessage ¶
func (client *Client) ForwardMessage(chatID PeerID, fromChatID PeerID, messageID int) *ForwardMessageCall
ForwardMessageCall constructs a new ForwardMessageCall with required parameters.
func (*Client) GetChat ¶
func (client *Client) GetChat(chatID PeerID) *GetChatCall
GetChatCall constructs a new GetChatCall with required parameters.
func (*Client) GetChatAdministrators ¶
func (client *Client) GetChatAdministrators(chatID PeerID) *GetChatAdministratorsCall
GetChatAdministratorsCall constructs a new GetChatAdministratorsCall with required parameters.
func (*Client) GetChatMember ¶
func (client *Client) GetChatMember(chatID PeerID, userID UserID) *GetChatMemberCall
GetChatMemberCall constructs a new GetChatMemberCall with required parameters.
func (*Client) GetChatMemberCount ¶
func (client *Client) GetChatMemberCount(chatID PeerID) *GetChatMemberCountCall
GetChatMemberCountCall constructs a new GetChatMemberCountCall with required parameters.
func (*Client) GetChatMenuButton ¶
func (client *Client) GetChatMenuButton() *GetChatMenuButtonCall
GetChatMenuButtonCall constructs a new GetChatMenuButtonCall with required parameters.
func (*Client) GetCustomEmojiStickers ¶ added in v0.5.0
func (client *Client) GetCustomEmojiStickers(customEmojiIds []string) *GetCustomEmojiStickersCall
GetCustomEmojiStickersCall constructs a new GetCustomEmojiStickersCall with required parameters.
func (*Client) GetFile ¶
func (client *Client) GetFile(fileID FileID) *GetFileCall
GetFileCall constructs a new GetFileCall with required parameters.
func (*Client) GetForumTopicIconStickers ¶ added in v0.6.0
func (client *Client) GetForumTopicIconStickers() *GetForumTopicIconStickersCall
GetForumTopicIconStickersCall constructs a new GetForumTopicIconStickersCall with required parameters.
func (*Client) GetGameHighScores ¶
func (client *Client) GetGameHighScores(userID UserID) *GetGameHighScoresCall
GetGameHighScoresCall constructs a new GetGameHighScoresCall with required parameters.
func (*Client) GetMyCommands ¶
func (client *Client) GetMyCommands() *GetMyCommandsCall
GetMyCommandsCall constructs a new GetMyCommandsCall with required parameters.
func (*Client) GetMyDefaultAdministratorRights ¶
func (client *Client) GetMyDefaultAdministratorRights() *GetMyDefaultAdministratorRightsCall
GetMyDefaultAdministratorRightsCall constructs a new GetMyDefaultAdministratorRightsCall with required parameters.
func (*Client) GetMyDescription ¶ added in v0.8.0
func (client *Client) GetMyDescription() *GetMyDescriptionCall
GetMyDescriptionCall constructs a new GetMyDescriptionCall with required parameters.
func (*Client) GetMyName ¶ added in v0.9.0
func (client *Client) GetMyName() *GetMyNameCall
GetMyNameCall constructs a new GetMyNameCall with required parameters.
func (*Client) GetMyShortDescription ¶ added in v0.8.0
func (client *Client) GetMyShortDescription() *GetMyShortDescriptionCall
GetMyShortDescriptionCall constructs a new GetMyShortDescriptionCall with required parameters.
func (*Client) GetStickerSet ¶
func (client *Client) GetStickerSet(name string) *GetStickerSetCall
GetStickerSetCall constructs a new GetStickerSetCall with required parameters.
func (*Client) GetUpdates ¶
func (client *Client) GetUpdates() *GetUpdatesCall
GetUpdatesCall constructs a new GetUpdatesCall with required parameters.
func (*Client) GetUserProfilePhotos ¶
func (client *Client) GetUserProfilePhotos(userID UserID) *GetUserProfilePhotosCall
GetUserProfilePhotosCall constructs a new GetUserProfilePhotosCall with required parameters.
func (*Client) GetWebhookInfo ¶
func (client *Client) GetWebhookInfo() *GetWebhookInfoCall
GetWebhookInfoCall constructs a new GetWebhookInfoCall with required parameters.
func (*Client) HideGeneralForumTopic ¶ added in v0.6.0
func (client *Client) HideGeneralForumTopic(chatID PeerID) *HideGeneralForumTopicCall
HideGeneralForumTopicCall constructs a new HideGeneralForumTopicCall with required parameters.
func (*Client) LeaveChat ¶
func (client *Client) LeaveChat(chatID PeerID) *LeaveChatCall
LeaveChatCall constructs a new LeaveChatCall with required parameters.
func (*Client) LogOut ¶
func (client *Client) LogOut() *LogOutCall
LogOutCall constructs a new LogOutCall with required parameters.
func (*Client) PinChatMessage ¶
func (client *Client) PinChatMessage(chatID PeerID, messageID int) *PinChatMessageCall
PinChatMessageCall constructs a new PinChatMessageCall with required parameters.
func (*Client) PromoteChatMember ¶
func (client *Client) PromoteChatMember(chatID PeerID, userID UserID) *PromoteChatMemberCall
PromoteChatMemberCall constructs a new PromoteChatMemberCall with required parameters.
func (*Client) ReopenForumTopic ¶ added in v0.6.0
func (client *Client) ReopenForumTopic(chatID PeerID, messageThreadID int) *ReopenForumTopicCall
ReopenForumTopicCall constructs a new ReopenForumTopicCall with required parameters.
func (*Client) ReopenGeneralForumTopic ¶ added in v0.6.0
func (client *Client) ReopenGeneralForumTopic(chatID PeerID) *ReopenGeneralForumTopicCall
ReopenGeneralForumTopicCall constructs a new ReopenGeneralForumTopicCall with required parameters.
func (*Client) RestrictChatMember ¶
func (client *Client) RestrictChatMember(chatID PeerID, userID UserID, permissions ChatPermissions) *RestrictChatMemberCall
RestrictChatMemberCall constructs a new RestrictChatMemberCall with required parameters.
func (*Client) RevokeChatInviteLink ¶
func (client *Client) RevokeChatInviteLink(chatID PeerID, inviteLink string) *RevokeChatInviteLinkCall
RevokeChatInviteLinkCall constructs a new RevokeChatInviteLinkCall with required parameters.
func (*Client) SendAnimation ¶
func (client *Client) SendAnimation(chatID PeerID, animation FileArg) *SendAnimationCall
SendAnimationCall constructs a new SendAnimationCall with required parameters.
func (*Client) SendAudio ¶
func (client *Client) SendAudio(chatID PeerID, audio FileArg) *SendAudioCall
SendAudioCall constructs a new SendAudioCall with required parameters.
func (*Client) SendChatAction ¶
func (client *Client) SendChatAction(chatID PeerID, action ChatAction) *SendChatActionCall
SendChatActionCall constructs a new SendChatActionCall with required parameters.
func (*Client) SendContact ¶
func (client *Client) SendContact(chatID PeerID, phoneNumber string, firstName string) *SendContactCall
SendContactCall constructs a new SendContactCall with required parameters.
func (*Client) SendDice ¶
func (client *Client) SendDice(chatID PeerID) *SendDiceCall
SendDiceCall constructs a new SendDiceCall with required parameters.
func (*Client) SendDocument ¶
func (client *Client) SendDocument(chatID PeerID, document FileArg) *SendDocumentCall
SendDocumentCall constructs a new SendDocumentCall with required parameters.
func (*Client) SendGame ¶
func (client *Client) SendGame(chatID ChatID, gameShortName string) *SendGameCall
SendGameCall constructs a new SendGameCall with required parameters.
func (*Client) SendInvoice ¶
func (client *Client) SendInvoice(chatID PeerID, title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *SendInvoiceCall
SendInvoiceCall constructs a new SendInvoiceCall with required parameters.
func (*Client) SendLocation ¶
func (client *Client) SendLocation(chatID PeerID, latitude float64, longitude float64) *SendLocationCall
SendLocationCall constructs a new SendLocationCall with required parameters.
func (*Client) SendMediaGroup ¶ added in v0.0.5
func (client *Client) SendMediaGroup(chatID PeerID, media []InputMedia) *SendMediaGroupCall
SendMediaGroupCall constructs a new SendMediaGroupCall with required parameters.
func (*Client) SendMessage ¶
func (client *Client) SendMessage(chatID PeerID, text string) *SendMessageCall
SendMessageCall constructs a new SendMessageCall with required parameters.
func (*Client) SendPhoto ¶
func (client *Client) SendPhoto(chatID PeerID, photo FileArg) *SendPhotoCall
SendPhotoCall constructs a new SendPhotoCall with required parameters.
func (*Client) SendPoll ¶
func (client *Client) SendPoll(chatID PeerID, question string, options []string) *SendPollCall
SendPollCall constructs a new SendPollCall with required parameters.
func (*Client) SendSticker ¶
func (client *Client) SendSticker(chatID PeerID, sticker FileArg) *SendStickerCall
SendStickerCall constructs a new SendStickerCall with required parameters.
func (*Client) SendVenue ¶
func (client *Client) SendVenue(chatID PeerID, latitude float64, longitude float64, title string, address string) *SendVenueCall
SendVenueCall constructs a new SendVenueCall with required parameters.
func (*Client) SendVideo ¶
func (client *Client) SendVideo(chatID PeerID, video FileArg) *SendVideoCall
SendVideoCall constructs a new SendVideoCall with required parameters.
func (*Client) SendVideoNote ¶
func (client *Client) SendVideoNote(chatID PeerID, videoNote FileArg) *SendVideoNoteCall
SendVideoNoteCall constructs a new SendVideoNoteCall with required parameters.
func (*Client) SendVoice ¶
func (client *Client) SendVoice(chatID PeerID, voice FileArg) *SendVoiceCall
SendVoiceCall constructs a new SendVoiceCall with required parameters.
func (*Client) SetChatAdministratorCustomTitle ¶
func (client *Client) SetChatAdministratorCustomTitle(chatID PeerID, userID UserID, customTitle string) *SetChatAdministratorCustomTitleCall
SetChatAdministratorCustomTitleCall constructs a new SetChatAdministratorCustomTitleCall with required parameters.
func (*Client) SetChatDescription ¶
func (client *Client) SetChatDescription(chatID PeerID) *SetChatDescriptionCall
SetChatDescriptionCall constructs a new SetChatDescriptionCall with required parameters.
func (*Client) SetChatMenuButton ¶
func (client *Client) SetChatMenuButton() *SetChatMenuButtonCall
SetChatMenuButtonCall constructs a new SetChatMenuButtonCall with required parameters.
func (*Client) SetChatPermissions ¶
func (client *Client) SetChatPermissions(chatID PeerID, permissions ChatPermissions) *SetChatPermissionsCall
SetChatPermissionsCall constructs a new SetChatPermissionsCall with required parameters.
func (*Client) SetChatPhoto ¶
func (client *Client) SetChatPhoto(chatID PeerID, photo InputFile) *SetChatPhotoCall
SetChatPhotoCall constructs a new SetChatPhotoCall with required parameters.
func (*Client) SetChatStickerSet ¶
func (client *Client) SetChatStickerSet(chatID PeerID, stickerSetName string) *SetChatStickerSetCall
SetChatStickerSetCall constructs a new SetChatStickerSetCall with required parameters.
func (*Client) SetChatTitle ¶
func (client *Client) SetChatTitle(chatID PeerID, title string) *SetChatTitleCall
SetChatTitleCall constructs a new SetChatTitleCall with required parameters.
func (*Client) SetCustomEmojiStickerSetThumbnail ¶ added in v0.8.0
func (client *Client) SetCustomEmojiStickerSetThumbnail(name string) *SetCustomEmojiStickerSetThumbnailCall
SetCustomEmojiStickerSetThumbnailCall constructs a new SetCustomEmojiStickerSetThumbnailCall with required parameters.
func (*Client) SetGameScore ¶
func (client *Client) SetGameScore(userID UserID, score int) *SetGameScoreCall
SetGameScoreCall constructs a new SetGameScoreCall with required parameters.
func (*Client) SetMyCommands ¶
func (client *Client) SetMyCommands(commands []BotCommand) *SetMyCommandsCall
SetMyCommandsCall constructs a new SetMyCommandsCall with required parameters.
func (*Client) SetMyDefaultAdministratorRights ¶
func (client *Client) SetMyDefaultAdministratorRights() *SetMyDefaultAdministratorRightsCall
SetMyDefaultAdministratorRightsCall constructs a new SetMyDefaultAdministratorRightsCall with required parameters.
func (*Client) SetMyDescription ¶ added in v0.8.0
func (client *Client) SetMyDescription() *SetMyDescriptionCall
SetMyDescriptionCall constructs a new SetMyDescriptionCall with required parameters.
func (*Client) SetMyName ¶ added in v0.9.0
func (client *Client) SetMyName() *SetMyNameCall
SetMyNameCall constructs a new SetMyNameCall with required parameters.
func (*Client) SetMyShortDescription ¶ added in v0.8.0
func (client *Client) SetMyShortDescription() *SetMyShortDescriptionCall
SetMyShortDescriptionCall constructs a new SetMyShortDescriptionCall with required parameters.
func (*Client) SetPassportDataErrors ¶
func (client *Client) SetPassportDataErrors(userID UserID, errors []PassportElementError) *SetPassportDataErrorsCall
SetPassportDataErrorsCall constructs a new SetPassportDataErrorsCall with required parameters.
func (*Client) SetStickerEmojiList ¶ added in v0.8.0
func (client *Client) SetStickerEmojiList(sticker string, emojiList []string) *SetStickerEmojiListCall
SetStickerEmojiListCall constructs a new SetStickerEmojiListCall with required parameters.
func (*Client) SetStickerKeywords ¶ added in v0.8.0
func (client *Client) SetStickerKeywords(sticker string) *SetStickerKeywordsCall
SetStickerKeywordsCall constructs a new SetStickerKeywordsCall with required parameters.
func (*Client) SetStickerMaskPosition ¶ added in v0.8.0
func (client *Client) SetStickerMaskPosition(sticker string) *SetStickerMaskPositionCall
SetStickerMaskPositionCall constructs a new SetStickerMaskPositionCall with required parameters.
func (*Client) SetStickerPositionInSet ¶
func (client *Client) SetStickerPositionInSet(sticker string, position int) *SetStickerPositionInSetCall
SetStickerPositionInSetCall constructs a new SetStickerPositionInSetCall with required parameters.
func (*Client) SetStickerSetThumbnail ¶ added in v0.8.0
func (client *Client) SetStickerSetThumbnail(name string, userID UserID) *SetStickerSetThumbnailCall
SetStickerSetThumbnailCall constructs a new SetStickerSetThumbnailCall with required parameters.
func (*Client) SetStickerSetTitle ¶ added in v0.8.0
func (client *Client) SetStickerSetTitle(name string, title string) *SetStickerSetTitleCall
SetStickerSetTitleCall constructs a new SetStickerSetTitleCall with required parameters.
func (*Client) SetWebhook ¶
func (client *Client) SetWebhook(url string) *SetWebhookCall
SetWebhookCall constructs a new SetWebhookCall with required parameters.
func (*Client) StopMessageLiveLocation ¶
func (client *Client) StopMessageLiveLocation(chatID PeerID, messageID int) *StopMessageLiveLocationCall
StopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters.
func (*Client) StopMessageLiveLocationInline ¶
func (client *Client) StopMessageLiveLocationInline(inlineMessageID string) *StopMessageLiveLocationCall
StopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters.
func (*Client) StopPoll ¶
func (client *Client) StopPoll(chatID PeerID, messageID int) *StopPollCall
StopPollCall constructs a new StopPollCall with required parameters.
func (*Client) UnbanChatMember ¶
func (client *Client) UnbanChatMember(chatID PeerID, userID UserID) *UnbanChatMemberCall
UnbanChatMemberCall constructs a new UnbanChatMemberCall with required parameters.
func (*Client) UnbanChatSenderChat ¶
func (client *Client) UnbanChatSenderChat(chatID PeerID, senderChatID int) *UnbanChatSenderChatCall
UnbanChatSenderChatCall constructs a new UnbanChatSenderChatCall with required parameters.
func (*Client) UnhideGeneralForumTopic ¶ added in v0.6.0
func (client *Client) UnhideGeneralForumTopic(chatID PeerID) *UnhideGeneralForumTopicCall
UnhideGeneralForumTopicCall constructs a new UnhideGeneralForumTopicCall with required parameters.
func (*Client) UnpinAllChatMessages ¶
func (client *Client) UnpinAllChatMessages(chatID PeerID) *UnpinAllChatMessagesCall
UnpinAllChatMessagesCall constructs a new UnpinAllChatMessagesCall with required parameters.
func (*Client) UnpinAllForumTopicMessages ¶ added in v0.6.0
func (client *Client) UnpinAllForumTopicMessages(chatID PeerID, messageThreadID int) *UnpinAllForumTopicMessagesCall
UnpinAllForumTopicMessagesCall constructs a new UnpinAllForumTopicMessagesCall with required parameters.
func (*Client) UnpinChatMessage ¶
func (client *Client) UnpinChatMessage(chatID PeerID) *UnpinChatMessageCall
UnpinChatMessageCall constructs a new UnpinChatMessageCall with required parameters.
func (*Client) UploadStickerFile ¶
func (client *Client) UploadStickerFile(userID UserID, sticker InputFile, stickerFormat string) *UploadStickerFileCall
UploadStickerFileCall constructs a new UploadStickerFileCall with required parameters.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption is a function that sets some option for Client.
func WithClientDoer ¶ added in v0.0.5
func WithClientDoer(doer Doer) ClientOption
WithClientDoer sets custom http client for Client.
func WithClientServerURL ¶ added in v0.0.6
func WithClientServerURL(server string) ClientOption
WithClientServerURL sets custom server url for Client.
func WithClientTestEnv ¶ added in v0.1.0
func WithClientTestEnv() ClientOption
WithClientTestEnv switches bot to test environment. See https://core.telegram.org/bots/webapps#using-bots-in-the-test-environment
type CloseCall ¶
type CloseCall struct {
CallNoResult
}
CloseCall reprenesents a call to the close method. 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 Requires no parameters.
func NewCloseCall ¶
func NewCloseCall() *CloseCall
NewCloseCall constructs a new CloseCall with required parameters.
type CloseForumTopicCall ¶ added in v0.6.0
type CloseForumTopicCall struct {
CallNoResult
}
CloseForumTopicCall reprenesents a call to the closeForumTopic method. Use this method to close an open topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic
func NewCloseForumTopicCall ¶ added in v0.6.0
func NewCloseForumTopicCall(chatID PeerID, messageThreadID int) *CloseForumTopicCall
NewCloseForumTopicCall constructs a new CloseForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) messageThreadID - Unique identifier for the target message thread of the forum topic
func (*CloseForumTopicCall) ChatID ¶ added in v0.6.0
func (call *CloseForumTopicCall) ChatID(chatID PeerID) *CloseForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*CloseForumTopicCall) MessageThreadID ¶ added in v0.6.0
func (call *CloseForumTopicCall) MessageThreadID(messageThreadID int) *CloseForumTopicCall
MessageThreadID Unique identifier for the target message thread of the forum topic
type CloseGeneralForumTopicCall ¶ added in v0.6.0
type CloseGeneralForumTopicCall struct {
CallNoResult
}
CloseGeneralForumTopicCall reprenesents a call to the closeGeneralForumTopic method. Use this method to close an open 'General' topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
func NewCloseGeneralForumTopicCall ¶ added in v0.6.0
func NewCloseGeneralForumTopicCall(chatID PeerID) *CloseGeneralForumTopicCall
NewCloseGeneralForumTopicCall constructs a new CloseGeneralForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*CloseGeneralForumTopicCall) ChatID ¶ added in v0.6.0
func (call *CloseGeneralForumTopicCall) ChatID(chatID PeerID) *CloseGeneralForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type Contact ¶
type Contact struct { // Contact's phone number PhoneNumber string `json:"phone_number"` // Contact's first name FirstName string `json:"first_name"` // 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"` }
Contact this object represents a phone contact.
type CopyMessageCall ¶
CopyMessageCall reprenesents a call to the copyMessage method. Use this method to copy messages of any kind Service messages and invoice messages can't be copied A quiz poll can be copied only if the value of the field correct_option_id is known to the bot The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message Returns the MessageId of the sent message on success.
func NewCopyMessageCall ¶
func NewCopyMessageCall(chatID PeerID, fromChatID PeerID, messageID int) *CopyMessageCall
NewCopyMessageCall constructs a new CopyMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) fromChatID - Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) messageID - Message identifier in the chat specified in from_chat_id
func (*CopyMessageCall) AllowSendingWithoutReply ¶
func (call *CopyMessageCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *CopyMessageCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*CopyMessageCall) Caption ¶
func (call *CopyMessageCall) Caption(caption string) *CopyMessageCall
Caption New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
func (*CopyMessageCall) CaptionEntities ¶
func (call *CopyMessageCall) CaptionEntities(captionEntities []MessageEntity) *CopyMessageCall
CaptionEntities A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
func (*CopyMessageCall) ChatID ¶ added in v0.0.5
func (call *CopyMessageCall) ChatID(chatID PeerID) *CopyMessageCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*CopyMessageCall) DisableNotification ¶
func (call *CopyMessageCall) DisableNotification(disableNotification bool) *CopyMessageCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*CopyMessageCall) FromChatID ¶ added in v0.0.5
func (call *CopyMessageCall) FromChatID(fromChatID PeerID) *CopyMessageCall
FromChatID Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
func (*CopyMessageCall) MessageID ¶ added in v0.0.5
func (call *CopyMessageCall) MessageID(messageID int) *CopyMessageCall
MessageID Message identifier in the chat specified in from_chat_id
func (*CopyMessageCall) MessageThreadID ¶ added in v0.6.0
func (call *CopyMessageCall) MessageThreadID(messageThreadID int) *CopyMessageCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*CopyMessageCall) ParseMode ¶
func (call *CopyMessageCall) ParseMode(parseMode ParseMode) *CopyMessageCall
ParseMode Mode for parsing entities in the new caption. See formatting options for more details.
func (*CopyMessageCall) ProtectContent ¶
func (call *CopyMessageCall) ProtectContent(protectContent bool) *CopyMessageCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*CopyMessageCall) ReplyMarkup ¶
func (call *CopyMessageCall) ReplyMarkup(replyMarkup ReplyMarkup) *CopyMessageCall
ReplyMarkup 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.
func (*CopyMessageCall) ReplyToMessageID ¶ added in v0.0.5
func (call *CopyMessageCall) ReplyToMessageID(replyToMessageID int) *CopyMessageCall
ReplyToMessageID If the message is a reply, ID of the original message
type CreateChatInviteLinkCall ¶
type CreateChatInviteLinkCall struct { Call[ChatInviteLink] }
CreateChatInviteLinkCall reprenesents a call to the createChatInviteLink method. Use this method to create an additional invite link for a chat The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights The link can be revoked using the method revokeChatInviteLink Returns the new invite link as ChatInviteLink object.
func NewCreateChatInviteLinkCall ¶
func NewCreateChatInviteLinkCall(chatID PeerID) *CreateChatInviteLinkCall
NewCreateChatInviteLinkCall constructs a new CreateChatInviteLinkCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*CreateChatInviteLinkCall) ChatID ¶ added in v0.0.5
func (call *CreateChatInviteLinkCall) ChatID(chatID PeerID) *CreateChatInviteLinkCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*CreateChatInviteLinkCall) CreatesJoinRequest ¶
func (call *CreateChatInviteLinkCall) CreatesJoinRequest(createsJoinRequest bool) *CreateChatInviteLinkCall
CreatesJoinRequest True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
func (*CreateChatInviteLinkCall) ExpireDate ¶
func (call *CreateChatInviteLinkCall) ExpireDate(expireDate int) *CreateChatInviteLinkCall
ExpireDate Point in time (Unix timestamp) when the link will expire
func (*CreateChatInviteLinkCall) MemberLimit ¶
func (call *CreateChatInviteLinkCall) MemberLimit(memberLimit int) *CreateChatInviteLinkCall
MemberLimit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
func (*CreateChatInviteLinkCall) Name ¶
func (call *CreateChatInviteLinkCall) Name(name string) *CreateChatInviteLinkCall
Name Invite link name; 0-32 characters
type CreateForumTopicCall ¶ added in v0.6.0
type CreateForumTopicCall struct { Call[ForumTopic] }
CreateForumTopicCall reprenesents a call to the createForumTopic method. Use this method to create a topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights Returns information about the created topic as a ForumTopic object.
func NewCreateForumTopicCall ¶ added in v0.6.0
func NewCreateForumTopicCall(chatID PeerID, name string) *CreateForumTopicCall
NewCreateForumTopicCall constructs a new CreateForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) name - Topic name, 1-128 characters
func (*CreateForumTopicCall) ChatID ¶ added in v0.6.0
func (call *CreateForumTopicCall) ChatID(chatID PeerID) *CreateForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*CreateForumTopicCall) IconColor ¶ added in v0.6.0
func (call *CreateForumTopicCall) IconColor(iconColor int) *CreateForumTopicCall
IconColor Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)
func (*CreateForumTopicCall) IconCustomEmojiID ¶ added in v0.6.0
func (call *CreateForumTopicCall) IconCustomEmojiID(iconCustomEmojiID string) *CreateForumTopicCall
IconCustomEmojiID Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
func (*CreateForumTopicCall) Name ¶ added in v0.6.0
func (call *CreateForumTopicCall) Name(name string) *CreateForumTopicCall
Name Topic name, 1-128 characters
type CreateInvoiceLinkCall ¶
CreateInvoiceLinkCall reprenesents a call to the createInvoiceLink method. Use this method to create a link for an invoice Returns the created invoice link as String on success.
func NewCreateInvoiceLinkCall ¶
func NewCreateInvoiceLinkCall(title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *CreateInvoiceLinkCall
NewCreateInvoiceLinkCall constructs a new CreateInvoiceLinkCall with required parameters. title - Product name, 1-32 characters description - Product description, 1-255 characters payload - Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. providerToken - Payment provider token, obtained via BotFather currency - Three-letter ISO 4217 currency code, see more on currencies prices - Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
func (*CreateInvoiceLinkCall) Currency ¶
func (call *CreateInvoiceLinkCall) Currency(currency string) *CreateInvoiceLinkCall
Currency Three-letter ISO 4217 currency code, see more on currencies
func (*CreateInvoiceLinkCall) Description ¶
func (call *CreateInvoiceLinkCall) Description(description string) *CreateInvoiceLinkCall
Description Product description, 1-255 characters
func (*CreateInvoiceLinkCall) IsFlexible ¶
func (call *CreateInvoiceLinkCall) IsFlexible(isFlexible bool) *CreateInvoiceLinkCall
IsFlexible Pass True if the final price depends on the shipping method
func (*CreateInvoiceLinkCall) MaxTipAmount ¶
func (call *CreateInvoiceLinkCall) MaxTipAmount(maxTipAmount int) *CreateInvoiceLinkCall
MaxTipAmount The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0
func (*CreateInvoiceLinkCall) NeedEmail ¶
func (call *CreateInvoiceLinkCall) NeedEmail(needEmail bool) *CreateInvoiceLinkCall
NeedEmail Pass True if you require the user's email address to complete the order
func (*CreateInvoiceLinkCall) NeedName ¶
func (call *CreateInvoiceLinkCall) NeedName(needName bool) *CreateInvoiceLinkCall
NeedName Pass True if you require the user's full name to complete the order
func (*CreateInvoiceLinkCall) NeedPhoneNumber ¶
func (call *CreateInvoiceLinkCall) NeedPhoneNumber(needPhoneNumber bool) *CreateInvoiceLinkCall
NeedPhoneNumber Pass True if you require the user's phone number to complete the order
func (*CreateInvoiceLinkCall) NeedShippingAddress ¶
func (call *CreateInvoiceLinkCall) NeedShippingAddress(needShippingAddress bool) *CreateInvoiceLinkCall
NeedShippingAddress Pass True if you require the user's shipping address to complete the order
func (*CreateInvoiceLinkCall) Payload ¶
func (call *CreateInvoiceLinkCall) Payload(payload string) *CreateInvoiceLinkCall
Payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
func (*CreateInvoiceLinkCall) PhotoHeight ¶
func (call *CreateInvoiceLinkCall) PhotoHeight(photoHeight int) *CreateInvoiceLinkCall
PhotoHeight Photo height
func (*CreateInvoiceLinkCall) PhotoSize ¶
func (call *CreateInvoiceLinkCall) PhotoSize(photoSize int) *CreateInvoiceLinkCall
PhotoSize Photo size in bytes
func (*CreateInvoiceLinkCall) PhotoURL ¶ added in v0.0.5
func (call *CreateInvoiceLinkCall) PhotoURL(photoURL string) *CreateInvoiceLinkCall
PhotoURL URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
func (*CreateInvoiceLinkCall) PhotoWidth ¶
func (call *CreateInvoiceLinkCall) PhotoWidth(photoWidth int) *CreateInvoiceLinkCall
PhotoWidth Photo width
func (*CreateInvoiceLinkCall) Prices ¶
func (call *CreateInvoiceLinkCall) Prices(prices []LabeledPrice) *CreateInvoiceLinkCall
Prices Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
func (*CreateInvoiceLinkCall) ProviderData ¶
func (call *CreateInvoiceLinkCall) ProviderData(providerData string) *CreateInvoiceLinkCall
ProviderData 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.
func (*CreateInvoiceLinkCall) ProviderToken ¶
func (call *CreateInvoiceLinkCall) ProviderToken(providerToken string) *CreateInvoiceLinkCall
ProviderToken Payment provider token, obtained via BotFather
func (*CreateInvoiceLinkCall) SendEmailToProvider ¶
func (call *CreateInvoiceLinkCall) SendEmailToProvider(sendEmailToProvider bool) *CreateInvoiceLinkCall
SendEmailToProvider Pass True if the user's email address should be sent to the provider
func (*CreateInvoiceLinkCall) SendPhoneNumberToProvider ¶
func (call *CreateInvoiceLinkCall) SendPhoneNumberToProvider(sendPhoneNumberToProvider bool) *CreateInvoiceLinkCall
SendPhoneNumberToProvider Pass True if the user's phone number should be sent to the provider
func (*CreateInvoiceLinkCall) SuggestedTipAmounts ¶
func (call *CreateInvoiceLinkCall) SuggestedTipAmounts(suggestedTipAmounts []int) *CreateInvoiceLinkCall
SuggestedTipAmounts A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
func (*CreateInvoiceLinkCall) Title ¶
func (call *CreateInvoiceLinkCall) Title(title string) *CreateInvoiceLinkCall
Title Product name, 1-32 characters
type CreateNewStickerSetCall ¶
type CreateNewStickerSetCall struct {
CallNoResult
}
CreateNewStickerSetCall reprenesents a call to the createNewStickerSet method. 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
func NewCreateNewStickerSetCall ¶
func NewCreateNewStickerSetCall(userID UserID, name string, title string, stickers []InputSticker, stickerFormat string) *CreateNewStickerSetCall
NewCreateNewStickerSetCall constructs a new CreateNewStickerSetCall with required parameters. userID - User identifier of created sticker set owner name - Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters. title - Sticker set title, 1-64 characters stickers - A JSON-serialized list of 1-50 initial stickers to be added to the sticker set stickerFormat - Format of stickers in the set, must be one of “static”, “animated”, “video”
func (*CreateNewStickerSetCall) Name ¶
func (call *CreateNewStickerSetCall) Name(name string) *CreateNewStickerSetCall
Name Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters.
func (*CreateNewStickerSetCall) NeedsRepainting ¶ added in v0.8.0
func (call *CreateNewStickerSetCall) NeedsRepainting(needsRepainting bool) *CreateNewStickerSetCall
NeedsRepainting Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only
func (*CreateNewStickerSetCall) StickerFormat ¶ added in v0.8.0
func (call *CreateNewStickerSetCall) StickerFormat(stickerFormat string) *CreateNewStickerSetCall
StickerFormat Format of stickers in the set, must be one of “static”, “animated”, “video”
func (*CreateNewStickerSetCall) StickerType ¶ added in v0.5.0
func (call *CreateNewStickerSetCall) StickerType(stickerType StickerType) *CreateNewStickerSetCall
StickerType Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.
func (*CreateNewStickerSetCall) Stickers ¶ added in v0.8.0
func (call *CreateNewStickerSetCall) Stickers(stickers []InputSticker) *CreateNewStickerSetCall
Stickers A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
func (*CreateNewStickerSetCall) Title ¶
func (call *CreateNewStickerSetCall) Title(title string) *CreateNewStickerSetCall
Title Sticker set title, 1-64 characters
func (*CreateNewStickerSetCall) UserID ¶ added in v0.0.5
func (call *CreateNewStickerSetCall) UserID(userID UserID) *CreateNewStickerSetCall
UserID User identifier of created sticker set owner
type DeclineChatJoinRequestCall ¶
type DeclineChatJoinRequestCall struct {
CallNoResult
}
DeclineChatJoinRequestCall reprenesents a call to the declineChatJoinRequest method. Use this method to decline a chat join request The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right
func NewDeclineChatJoinRequestCall ¶
func NewDeclineChatJoinRequestCall(chatID PeerID, userID UserID) *DeclineChatJoinRequestCall
NewDeclineChatJoinRequestCall constructs a new DeclineChatJoinRequestCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) userID - Unique identifier of the target user
func (*DeclineChatJoinRequestCall) ChatID ¶ added in v0.0.5
func (call *DeclineChatJoinRequestCall) ChatID(chatID PeerID) *DeclineChatJoinRequestCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*DeclineChatJoinRequestCall) UserID ¶ added in v0.0.5
func (call *DeclineChatJoinRequestCall) UserID(userID UserID) *DeclineChatJoinRequestCall
UserID Unique identifier of the target user
type DeleteChatPhotoCall ¶
type DeleteChatPhotoCall struct {
CallNoResult
}
DeleteChatPhotoCall reprenesents a call to the deleteChatPhoto method. 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 administrator rights
func NewDeleteChatPhotoCall ¶
func NewDeleteChatPhotoCall(chatID PeerID) *DeleteChatPhotoCall
NewDeleteChatPhotoCall constructs a new DeleteChatPhotoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*DeleteChatPhotoCall) ChatID ¶ added in v0.0.5
func (call *DeleteChatPhotoCall) ChatID(chatID PeerID) *DeleteChatPhotoCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type DeleteChatStickerSetCall ¶
type DeleteChatStickerSetCall struct {
CallNoResult
}
DeleteChatStickerSetCall reprenesents a call to the deleteChatStickerSet method. 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 administrator rights Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method
func NewDeleteChatStickerSetCall ¶
func NewDeleteChatStickerSetCall(chatID PeerID) *DeleteChatStickerSetCall
NewDeleteChatStickerSetCall constructs a new DeleteChatStickerSetCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*DeleteChatStickerSetCall) ChatID ¶ added in v0.0.5
func (call *DeleteChatStickerSetCall) ChatID(chatID PeerID) *DeleteChatStickerSetCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type DeleteForumTopicCall ¶ added in v0.6.0
type DeleteForumTopicCall struct {
CallNoResult
}
DeleteForumTopicCall reprenesents a call to the deleteForumTopic method. Use this method to delete a forum topic along with all its messages in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights
func NewDeleteForumTopicCall ¶ added in v0.6.0
func NewDeleteForumTopicCall(chatID PeerID, messageThreadID int) *DeleteForumTopicCall
NewDeleteForumTopicCall constructs a new DeleteForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) messageThreadID - Unique identifier for the target message thread of the forum topic
func (*DeleteForumTopicCall) ChatID ¶ added in v0.6.0
func (call *DeleteForumTopicCall) ChatID(chatID PeerID) *DeleteForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*DeleteForumTopicCall) MessageThreadID ¶ added in v0.6.0
func (call *DeleteForumTopicCall) MessageThreadID(messageThreadID int) *DeleteForumTopicCall
MessageThreadID Unique identifier for the target message thread of the forum topic
type DeleteMessageCall ¶
type DeleteMessageCall struct {
CallNoResult
}
DeleteMessageCall reprenesents a call to the deleteMessage method.
func NewDeleteMessageCall ¶
func NewDeleteMessageCall(chatID PeerID, messageID int) *DeleteMessageCall
NewDeleteMessageCall constructs a new DeleteMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Identifier of the message to delete
func (*DeleteMessageCall) ChatID ¶ added in v0.0.5
func (call *DeleteMessageCall) ChatID(chatID PeerID) *DeleteMessageCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*DeleteMessageCall) MessageID ¶ added in v0.0.5
func (call *DeleteMessageCall) MessageID(messageID int) *DeleteMessageCall
MessageID Identifier of the message to delete
type DeleteMyCommandsCall ¶
type DeleteMyCommandsCall struct {
CallNoResult
}
DeleteMyCommandsCall reprenesents a call to the deleteMyCommands method. Use this method to delete the list of the bot's commands for the given scope and user language After deletion, higher level commands will be shown to affected users
func NewDeleteMyCommandsCall ¶
func NewDeleteMyCommandsCall() *DeleteMyCommandsCall
NewDeleteMyCommandsCall constructs a new DeleteMyCommandsCall with required parameters.
func (*DeleteMyCommandsCall) LanguageCode ¶
func (call *DeleteMyCommandsCall) LanguageCode(languageCode string) *DeleteMyCommandsCall
LanguageCode A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
func (*DeleteMyCommandsCall) Scope ¶
func (call *DeleteMyCommandsCall) Scope(scope BotCommandScope) *DeleteMyCommandsCall
Scope A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
type DeleteStickerFromSetCall ¶
type DeleteStickerFromSetCall struct {
CallNoResult
}
DeleteStickerFromSetCall reprenesents a call to the deleteStickerFromSet method. Use this method to delete a sticker from a set created by the bot
func NewDeleteStickerFromSetCall ¶
func NewDeleteStickerFromSetCall(sticker string) *DeleteStickerFromSetCall
NewDeleteStickerFromSetCall constructs a new DeleteStickerFromSetCall with required parameters. sticker - File identifier of the sticker
func (*DeleteStickerFromSetCall) Sticker ¶
func (call *DeleteStickerFromSetCall) Sticker(sticker string) *DeleteStickerFromSetCall
Sticker File identifier of the sticker
type DeleteStickerSetCall ¶ added in v0.8.0
type DeleteStickerSetCall struct {
CallNoResult
}
DeleteStickerSetCall reprenesents a call to the deleteStickerSet method. Use this method to delete a sticker set that was created by the bot
func NewDeleteStickerSetCall ¶ added in v0.8.0
func NewDeleteStickerSetCall(name string) *DeleteStickerSetCall
NewDeleteStickerSetCall constructs a new DeleteStickerSetCall with required parameters. name - Sticker set name
func (*DeleteStickerSetCall) Name ¶ added in v0.8.0
func (call *DeleteStickerSetCall) Name(name string) *DeleteStickerSetCall
Name Sticker set name
type DeleteWebhookCall ¶
type DeleteWebhookCall struct {
CallNoResult
}
DeleteWebhookCall reprenesents a call to the deleteWebhook method. Use this method to remove webhook integration if you decide to switch back to getUpdates
func NewDeleteWebhookCall ¶
func NewDeleteWebhookCall() *DeleteWebhookCall
NewDeleteWebhookCall constructs a new DeleteWebhookCall with required parameters.
func (*DeleteWebhookCall) DropPendingUpdates ¶
func (call *DeleteWebhookCall) DropPendingUpdates(dropPendingUpdates bool) *DeleteWebhookCall
DropPendingUpdates Pass True to drop all pending updates
type Dice ¶
type Dice struct { // Emoji on which the dice throw animation is based Emoji string `json:"emoji"` // Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji Value int `json:"value"` }
Dice this object represents an animated emoji that displays a random value.
type Document ¶
type Document struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Optional. Document thumbnail as defined by sender Thumbnail *PhotoSize `json:"thumbnail,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 in bytes. FileSize int64 `json:"file_size,omitempty"` }
Document this object represents a general file (as opposed to photos, voice messages and audio files).
type EditChatInviteLinkCall ¶
type EditChatInviteLinkCall struct { Call[ChatInviteLink] }
EditChatInviteLinkCall reprenesents a call to the editChatInviteLink method. Use this method to edit a non-primary invite link created by the bot The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Returns the edited invite link as a ChatInviteLink object.
func NewEditChatInviteLinkCall ¶
func NewEditChatInviteLinkCall(chatID PeerID, inviteLink string) *EditChatInviteLinkCall
NewEditChatInviteLinkCall constructs a new EditChatInviteLinkCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) inviteLink - The invite link to edit
func (*EditChatInviteLinkCall) ChatID ¶ added in v0.0.5
func (call *EditChatInviteLinkCall) ChatID(chatID PeerID) *EditChatInviteLinkCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*EditChatInviteLinkCall) CreatesJoinRequest ¶
func (call *EditChatInviteLinkCall) CreatesJoinRequest(createsJoinRequest bool) *EditChatInviteLinkCall
CreatesJoinRequest True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
func (*EditChatInviteLinkCall) ExpireDate ¶
func (call *EditChatInviteLinkCall) ExpireDate(expireDate int) *EditChatInviteLinkCall
ExpireDate Point in time (Unix timestamp) when the link will expire
func (*EditChatInviteLinkCall) InviteLink ¶
func (call *EditChatInviteLinkCall) InviteLink(inviteLink string) *EditChatInviteLinkCall
InviteLink The invite link to edit
func (*EditChatInviteLinkCall) MemberLimit ¶
func (call *EditChatInviteLinkCall) MemberLimit(memberLimit int) *EditChatInviteLinkCall
MemberLimit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
func (*EditChatInviteLinkCall) Name ¶
func (call *EditChatInviteLinkCall) Name(name string) *EditChatInviteLinkCall
Name Invite link name; 0-32 characters
type EditForumTopicCall ¶ added in v0.6.0
type EditForumTopicCall struct {
CallNoResult
}
EditForumTopicCall reprenesents a call to the editForumTopic method. Use this method to edit name and icon of a topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic
func NewEditForumTopicCall ¶ added in v0.6.0
func NewEditForumTopicCall(chatID PeerID, messageThreadID int) *EditForumTopicCall
NewEditForumTopicCall constructs a new EditForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) messageThreadID - Unique identifier for the target message thread of the forum topic
func (*EditForumTopicCall) ChatID ¶ added in v0.6.0
func (call *EditForumTopicCall) ChatID(chatID PeerID) *EditForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*EditForumTopicCall) IconCustomEmojiID ¶ added in v0.6.0
func (call *EditForumTopicCall) IconCustomEmojiID(iconCustomEmojiID string) *EditForumTopicCall
IconCustomEmojiID New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept
func (*EditForumTopicCall) MessageThreadID ¶ added in v0.6.0
func (call *EditForumTopicCall) MessageThreadID(messageThreadID int) *EditForumTopicCall
MessageThreadID Unique identifier for the target message thread of the forum topic
func (*EditForumTopicCall) Name ¶ added in v0.6.0
func (call *EditForumTopicCall) Name(name string) *EditForumTopicCall
Name New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
type EditGeneralForumTopicCall ¶ added in v0.6.0
type EditGeneralForumTopicCall struct {
CallNoResult
}
EditGeneralForumTopicCall reprenesents a call to the editGeneralForumTopic method. Use this method to edit the name of the 'General' topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights
func NewEditGeneralForumTopicCall ¶ added in v0.6.0
func NewEditGeneralForumTopicCall(chatID PeerID, name string) *EditGeneralForumTopicCall
NewEditGeneralForumTopicCall constructs a new EditGeneralForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) name - New topic name, 1-128 characters
func (*EditGeneralForumTopicCall) ChatID ¶ added in v0.6.0
func (call *EditGeneralForumTopicCall) ChatID(chatID PeerID) *EditGeneralForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*EditGeneralForumTopicCall) Name ¶ added in v0.6.0
func (call *EditGeneralForumTopicCall) Name(name string) *EditGeneralForumTopicCall
Name New topic name, 1-128 characters
type EditMessageCaptionCall ¶
EditMessageCaptionCall reprenesents a call to the editMessageCaption method. 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.
func NewEditMessageCaptionCall ¶
func NewEditMessageCaptionCall(chatID PeerID, messageID int, caption string) *EditMessageCaptionCall
NewEditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit caption - New caption of the message, 0-1024 characters after entities parsing
func NewEditMessageCaptionInlineCall ¶ added in v0.0.3
func NewEditMessageCaptionInlineCall(inlineMessageID string, caption string) *EditMessageCaptionCall
NewEditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message caption - New caption of the message, 0-1024 characters after entities parsing
func (*EditMessageCaptionCall) Caption ¶
func (call *EditMessageCaptionCall) Caption(caption string) *EditMessageCaptionCall
Caption New caption of the message, 0-1024 characters after entities parsing
func (*EditMessageCaptionCall) CaptionEntities ¶
func (call *EditMessageCaptionCall) CaptionEntities(captionEntities []MessageEntity) *EditMessageCaptionCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*EditMessageCaptionCall) ChatID ¶ added in v0.0.5
func (call *EditMessageCaptionCall) ChatID(chatID PeerID) *EditMessageCaptionCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*EditMessageCaptionCall) InlineMessageID ¶ added in v0.0.5
func (call *EditMessageCaptionCall) InlineMessageID(inlineMessageID string) *EditMessageCaptionCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageCaptionCall) MessageID ¶ added in v0.0.5
func (call *EditMessageCaptionCall) MessageID(messageID int) *EditMessageCaptionCall
MessageID Required if inline_message_id is not specified. Identifier of the message to edit
func (*EditMessageCaptionCall) ParseMode ¶
func (call *EditMessageCaptionCall) ParseMode(parseMode ParseMode) *EditMessageCaptionCall
ParseMode Mode for parsing entities in the message caption. See formatting options for more details.
func (*EditMessageCaptionCall) ReplyMarkup ¶
func (call *EditMessageCaptionCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageCaptionCall
ReplyMarkup A JSON-serialized object for an inline keyboard.
type EditMessageLiveLocationCall ¶
EditMessageLiveLocationCall reprenesents a call to the editMessageLiveLocation method. 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.
func NewEditMessageLiveLocationCall ¶
func NewEditMessageLiveLocationCall(chatID PeerID, messageID int) *EditMessageLiveLocationCall
NewEditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit
func NewEditMessageLiveLocationInlineCall ¶
func NewEditMessageLiveLocationInlineCall(inlineMessageID string) *EditMessageLiveLocationCall
NewEditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageLiveLocationCall) ChatID ¶ added in v0.0.5
func (call *EditMessageLiveLocationCall) ChatID(chatID PeerID) *EditMessageLiveLocationCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*EditMessageLiveLocationCall) Heading ¶
func (call *EditMessageLiveLocationCall) Heading(heading int) *EditMessageLiveLocationCall
Heading Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
func (*EditMessageLiveLocationCall) HorizontalAccuracy ¶
func (call *EditMessageLiveLocationCall) HorizontalAccuracy(horizontalAccuracy float64) *EditMessageLiveLocationCall
HorizontalAccuracy The radius of uncertainty for the location, measured in meters; 0-1500
func (*EditMessageLiveLocationCall) InlineMessageID ¶ added in v0.0.5
func (call *EditMessageLiveLocationCall) InlineMessageID(inlineMessageID string) *EditMessageLiveLocationCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageLiveLocationCall) Latitude ¶
func (call *EditMessageLiveLocationCall) Latitude(latitude float64) *EditMessageLiveLocationCall
Latitude Latitude of new location
func (*EditMessageLiveLocationCall) Longitude ¶
func (call *EditMessageLiveLocationCall) Longitude(longitude float64) *EditMessageLiveLocationCall
Longitude Longitude of new location
func (*EditMessageLiveLocationCall) MessageID ¶ added in v0.0.5
func (call *EditMessageLiveLocationCall) MessageID(messageID int) *EditMessageLiveLocationCall
MessageID Required if inline_message_id is not specified. Identifier of the message to edit
func (*EditMessageLiveLocationCall) ProximityAlertRadius ¶
func (call *EditMessageLiveLocationCall) ProximityAlertRadius(proximityAlertRadius int) *EditMessageLiveLocationCall
ProximityAlertRadius The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
func (*EditMessageLiveLocationCall) ReplyMarkup ¶
func (call *EditMessageLiveLocationCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageLiveLocationCall
ReplyMarkup A JSON-serialized object for a new inline keyboard.
type EditMessageMediaCall ¶
EditMessageMediaCall reprenesents a call to the editMessageMedia method. 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 is not an inline message, the edited Message is returned, otherwise True is returned.
func NewEditMessageMediaCall ¶
func NewEditMessageMediaCall(media InputMedia) *EditMessageMediaCall
NewEditMessageMediaCall constructs a new EditMessageMediaCall with required parameters. media - A JSON-serialized object for a new media content of the message
func (*EditMessageMediaCall) ChatID ¶ added in v0.0.5
func (call *EditMessageMediaCall) ChatID(chatID PeerID) *EditMessageMediaCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*EditMessageMediaCall) InlineMessageID ¶ added in v0.0.5
func (call *EditMessageMediaCall) InlineMessageID(inlineMessageID string) *EditMessageMediaCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageMediaCall) Media ¶
func (call *EditMessageMediaCall) Media(media InputMedia) *EditMessageMediaCall
Media A JSON-serialized object for a new media content of the message
func (*EditMessageMediaCall) MessageID ¶ added in v0.0.5
func (call *EditMessageMediaCall) MessageID(messageID int) *EditMessageMediaCall
MessageID Required if inline_message_id is not specified. Identifier of the message to edit
func (*EditMessageMediaCall) ReplyMarkup ¶
func (call *EditMessageMediaCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageMediaCall
ReplyMarkup A JSON-serialized object for a new inline keyboard.
type EditMessageReplyMarkupCall ¶
EditMessageReplyMarkupCall reprenesents a call to the editMessageReplyMarkup method. 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.
func NewEditMessageReplyMarkupCall ¶
func NewEditMessageReplyMarkupCall(chatID PeerID, messageID int) *EditMessageReplyMarkupCall
NewEditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit
func NewEditMessageReplyMarkupInlineCall ¶ added in v0.0.3
func NewEditMessageReplyMarkupInlineCall(inlineMessageID string) *EditMessageReplyMarkupCall
NewEditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageReplyMarkupCall) ChatID ¶ added in v0.0.5
func (call *EditMessageReplyMarkupCall) ChatID(chatID PeerID) *EditMessageReplyMarkupCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*EditMessageReplyMarkupCall) InlineMessageID ¶ added in v0.0.5
func (call *EditMessageReplyMarkupCall) InlineMessageID(inlineMessageID string) *EditMessageReplyMarkupCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageReplyMarkupCall) MessageID ¶ added in v0.0.5
func (call *EditMessageReplyMarkupCall) MessageID(messageID int) *EditMessageReplyMarkupCall
MessageID Required if inline_message_id is not specified. Identifier of the message to edit
func (*EditMessageReplyMarkupCall) ReplyMarkup ¶
func (call *EditMessageReplyMarkupCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageReplyMarkupCall
ReplyMarkup A JSON-serialized object for an inline keyboard.
type EditMessageTextCall ¶
EditMessageTextCall reprenesents a call to the editMessageText method. 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.
func NewEditMessageTextCall ¶
func NewEditMessageTextCall(chatID PeerID, messageID int, text string) *EditMessageTextCall
NewEditMessageTextCall constructs a new EditMessageTextCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit text - New text of the message, 1-4096 characters after entities parsing
func NewEditMessageTextInlineCall ¶ added in v0.0.3
func NewEditMessageTextInlineCall(inlineMessageID string, text string) *EditMessageTextCall
NewEditMessageTextCall constructs a new EditMessageTextCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message text - New text of the message, 1-4096 characters after entities parsing
func (*EditMessageTextCall) ChatID ¶ added in v0.0.5
func (call *EditMessageTextCall) ChatID(chatID PeerID) *EditMessageTextCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*EditMessageTextCall) DisableWebPagePreview ¶
func (call *EditMessageTextCall) DisableWebPagePreview(disableWebPagePreview bool) *EditMessageTextCall
DisableWebPagePreview Disables link previews for links in this message
func (*EditMessageTextCall) Entities ¶
func (call *EditMessageTextCall) Entities(entities []MessageEntity) *EditMessageTextCall
Entities A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
func (*EditMessageTextCall) InlineMessageID ¶ added in v0.0.5
func (call *EditMessageTextCall) InlineMessageID(inlineMessageID string) *EditMessageTextCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*EditMessageTextCall) MessageID ¶ added in v0.0.5
func (call *EditMessageTextCall) MessageID(messageID int) *EditMessageTextCall
MessageID Required if inline_message_id is not specified. Identifier of the message to edit
func (*EditMessageTextCall) ParseMode ¶
func (call *EditMessageTextCall) ParseMode(parseMode ParseMode) *EditMessageTextCall
ParseMode Mode for parsing entities in the message text. See formatting options for more details.
func (*EditMessageTextCall) ReplyMarkup ¶
func (call *EditMessageTextCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageTextCall
ReplyMarkup A JSON-serialized object for an inline keyboard.
func (*EditMessageTextCall) Text ¶
func (call *EditMessageTextCall) Text(text string) *EditMessageTextCall
Text New text of the message, 1-4096 characters after entities parsing
type Encoder ¶
type Encoder interface { // Writes string argument k to encoder. WriteString(k string, v string) error // Write files argument k to encoder. WriteFile(k string, file InputFile) error }
Encoder represents request encoder.
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"` // Base64-encoded data hash for data authentication Hash string `json:"hash"` // Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption Secret string `json:"secret"` }
EncryptedCredentials describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
type EncryptedPassportElement ¶
type EncryptedPassportElement struct { // 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"` // 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"` }
EncryptedPassportElement describes documents or other Telegram Passport elements shared with the bot by the user.
type Error ¶ added in v0.0.5
type Error struct { Code int `json:"code"` Message string `json:"message"` Parameters *ResponseParameters `json:"parameters"` }
Error is Telegram Bot API error structure.
type ExportChatInviteLinkCall ¶
ExportChatInviteLinkCall reprenesents a call to the exportChatInviteLink method. Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Returns the new invite link as String on success.
func NewExportChatInviteLinkCall ¶
func NewExportChatInviteLinkCall(chatID PeerID) *ExportChatInviteLinkCall
NewExportChatInviteLinkCall constructs a new ExportChatInviteLinkCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*ExportChatInviteLinkCall) ChatID ¶ added in v0.0.5
func (call *ExportChatInviteLinkCall) ChatID(chatID PeerID) *ExportChatInviteLinkCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type File ¶
type File struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Optional. File size in bytes. 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"` }
File 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.
type FileArg ¶
type FileArg struct { // Send already uploaded file by its file_id. FileID FileID // Send remote file by URL. URL string // Upload file Upload InputFile // contains filtered or unexported fields }
FileArg it's union type for different ways of sending files.
func NewFileArgID ¶ added in v0.1.1
NewFileArgID creates a new FileArg for sending a file by file_id.
func NewFileArgURL ¶ added in v0.1.1
NewFileArgURL creates a new FileArg for sending a file by URL.
func NewFileArgUpload ¶ added in v0.1.1
NewFileArgUpload creates a new FileArg for uploading a file by content.
func (FileArg) MarshalJSON ¶ added in v0.0.5
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"` // Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters InputFieldPlaceholder string `json:"input_field_placeholder,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"` }
ForceReply upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
func NewForceReply ¶ added in v0.0.2
func NewForceReply() *ForceReply
NewForceReply creates a new ForceReply.
func (*ForceReply) WithInputFieldPlaceholder ¶ added in v0.0.2
func (markup *ForceReply) WithInputFieldPlaceholder(placeholder string) *ForceReply
WithInputFieldPlaceholder sets the placeholder to be shown in the input field when the reply is active; 1-64 characters
func (*ForceReply) WithSelective ¶ added in v0.0.2
func (markup *ForceReply) WithSelective() *ForceReply
WithSelective set it if you want to force reply for specific users only.
type ForumTopic ¶ added in v0.6.0
type ForumTopic struct { // Unique identifier of the forum topic MessageThreadID int `json:"message_thread_id"` // Name of the topic Name string `json:"name"` // Color of the topic icon in RGB format IconColor int `json:"icon_color"` // Optional. Unique identifier of the custom emoji shown as the topic icon IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` }
ForumTopic this object represents a forum topic.
type ForumTopicClosed ¶ added in v0.6.0
type ForumTopicClosed struct { // Optional. New name of the topic, if it was edited Name string `json:"name,omitempty"` // Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` }
ForumTopicClosed this object represents a service message about a forum topic closed in the chat. Currently holds no information.
type ForumTopicCreated ¶ added in v0.6.0
type ForumTopicCreated struct { // Name of the topic Name string `json:"name"` // Color of the topic icon in RGB format IconColor int `json:"icon_color"` // Optional. Unique identifier of the custom emoji shown as the topic icon IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` }
ForumTopicCreated this object represents a service message about a new forum topic created in the chat.
type ForumTopicEdited ¶ added in v0.6.0
type ForumTopicEdited struct { // Optional. New name of the topic, if it was edited Name string `json:"name,omitempty"` // Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` }
ForumTopicEdited this object represents a service message about an edited forum topic.
type ForumTopicReopened ¶ added in v0.6.0
type ForumTopicReopened struct { // Identifier of the request RequestID int `json:"request_id"` // Identifier of the shared user. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. UserID int64 `json:"user_id"` }
ForumTopicReopened this object represents a service message about a forum topic reopened in the chat. Currently holds no information.
type ForwardMessageCall ¶
ForwardMessageCall reprenesents a call to the forwardMessage method. Use this method to forward messages of any kind Service messages can't be forwarded On success, the sent Message is returned.
func NewForwardMessageCall ¶
func NewForwardMessageCall(chatID PeerID, fromChatID PeerID, messageID int) *ForwardMessageCall
NewForwardMessageCall constructs a new ForwardMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) fromChatID - Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) messageID - Message identifier in the chat specified in from_chat_id
func (*ForwardMessageCall) ChatID ¶ added in v0.0.5
func (call *ForwardMessageCall) ChatID(chatID PeerID) *ForwardMessageCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*ForwardMessageCall) DisableNotification ¶
func (call *ForwardMessageCall) DisableNotification(disableNotification bool) *ForwardMessageCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*ForwardMessageCall) FromChatID ¶ added in v0.0.5
func (call *ForwardMessageCall) FromChatID(fromChatID PeerID) *ForwardMessageCall
FromChatID Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
func (*ForwardMessageCall) MessageID ¶ added in v0.0.5
func (call *ForwardMessageCall) MessageID(messageID int) *ForwardMessageCall
MessageID Message identifier in the chat specified in from_chat_id
func (*ForwardMessageCall) MessageThreadID ¶ added in v0.6.0
func (call *ForwardMessageCall) MessageThreadID(messageThreadID int) *ForwardMessageCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*ForwardMessageCall) ProtectContent ¶
func (call *ForwardMessageCall) ProtectContent(protectContent bool) *ForwardMessageCall
ProtectContent Protects the contents of the forwarded message from forwarding and saving
type Game ¶
type Game struct { // Title of the game Title string `json:"title"` // Description of the game Description string `json:"description"` // Photo that will be displayed in the game message in chats. Photo []PhotoSize `json:"photo"` // 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"` }
Game this object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
type GameHighScore ¶
type GameHighScore struct { // Position in high score table for the game Position int `json:"position"` // User User User `json:"user"` // Score Score int `json:"score"` }
GameHighScore this object represents one row of the high scores table for a game.
type GeneralForumTopicHidden ¶ added in v0.6.0
type GeneralForumTopicHidden struct { // Identifier of the request RequestID int `json:"request_id"` // Identifier of the shared user. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. UserID int64 `json:"user_id"` }
GeneralForumTopicHidden this object represents a service message about General forum topic hidden in the chat. Currently holds no information.
type GeneralForumTopicUnhidden ¶ added in v0.6.0
type GeneralForumTopicUnhidden struct { int `json:"request_id"` UserID int64 `json:"user_id"` }RequestID
GeneralForumTopicUnhidden this object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
type GetChatAdministratorsCall ¶
type GetChatAdministratorsCall struct { Call[[]ChatMember] }
GetChatAdministratorsCall reprenesents a call to the getChatAdministrators method. Use this method to get a list of administrators in a chat, which aren't bots Returns an Array of ChatMember objects.
func NewGetChatAdministratorsCall ¶
func NewGetChatAdministratorsCall(chatID PeerID) *GetChatAdministratorsCall
NewGetChatAdministratorsCall constructs a new GetChatAdministratorsCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
func (*GetChatAdministratorsCall) ChatID ¶ added in v0.0.5
func (call *GetChatAdministratorsCall) ChatID(chatID PeerID) *GetChatAdministratorsCall
ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type GetChatCall ¶
GetChatCall reprenesents a call to the getChat method. Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.) Returns a Chat object on success.
func NewGetChatCall ¶
func NewGetChatCall(chatID PeerID) *GetChatCall
NewGetChatCall constructs a new GetChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
func (*GetChatCall) ChatID ¶ added in v0.0.5
func (call *GetChatCall) ChatID(chatID PeerID) *GetChatCall
ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type GetChatMemberCall ¶
type GetChatMemberCall struct { Call[ChatMember] }
GetChatMemberCall reprenesents a call to the getChatMember method. Use this method to get information about a member of a chat The method is only guaranteed to work for other users if the bot is an administrator in the chat Returns a ChatMember object on success.
func NewGetChatMemberCall ¶
func NewGetChatMemberCall(chatID PeerID, userID UserID) *GetChatMemberCall
NewGetChatMemberCall constructs a new GetChatMemberCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) userID - Unique identifier of the target user
func (*GetChatMemberCall) ChatID ¶ added in v0.0.5
func (call *GetChatMemberCall) ChatID(chatID PeerID) *GetChatMemberCall
ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
func (*GetChatMemberCall) UserID ¶ added in v0.0.5
func (call *GetChatMemberCall) UserID(userID UserID) *GetChatMemberCall
UserID Unique identifier of the target user
type GetChatMemberCountCall ¶
GetChatMemberCountCall reprenesents a call to the getChatMemberCount method. Use this method to get the number of members in a chat Returns Int on success.
func NewGetChatMemberCountCall ¶
func NewGetChatMemberCountCall(chatID PeerID) *GetChatMemberCountCall
NewGetChatMemberCountCall constructs a new GetChatMemberCountCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
func (*GetChatMemberCountCall) ChatID ¶ added in v0.0.5
func (call *GetChatMemberCountCall) ChatID(chatID PeerID) *GetChatMemberCountCall
ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type GetChatMenuButtonCall ¶
type GetChatMenuButtonCall struct { Call[MenuButtonOneOf] }
GetChatMenuButtonCall reprenesents a call to the getChatMenuButton method. Use this method to get the current value of the bot's menu button in a private chat, or the default menu button Returns MenuButton on success.
func NewGetChatMenuButtonCall ¶
func NewGetChatMenuButtonCall() *GetChatMenuButtonCall
NewGetChatMenuButtonCall constructs a new GetChatMenuButtonCall with required parameters.
func (*GetChatMenuButtonCall) ChatID ¶ added in v0.0.5
func (call *GetChatMenuButtonCall) ChatID(chatID ChatID) *GetChatMenuButtonCall
ChatID Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
type GetCustomEmojiStickersCall ¶ added in v0.5.0
GetCustomEmojiStickersCall reprenesents a call to the getCustomEmojiStickers method. Use this method to get information about custom emoji stickers by their identifiers Returns an Array of Sticker objects.
func NewGetCustomEmojiStickersCall ¶ added in v0.5.0
func NewGetCustomEmojiStickersCall(customEmojiIds []string) *GetCustomEmojiStickersCall
NewGetCustomEmojiStickersCall constructs a new GetCustomEmojiStickersCall with required parameters. customEmojiIds - List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
func (*GetCustomEmojiStickersCall) CustomEmojiIds ¶ added in v0.5.0
func (call *GetCustomEmojiStickersCall) CustomEmojiIds(customEmojiIds []string) *GetCustomEmojiStickersCall
CustomEmojiIds List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
type GetFileCall ¶
GetFileCall reprenesents a call to the getFile method. Use this method to get basic information about a file and prepare it for downloading For the moment, bots can download files of up to 20MB in size On success, a File object is returned The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response It is guaranteed that the link will be valid for at least 1 hour When the link expires, a new one can be requested by calling getFile again.
func NewGetFileCall ¶
func NewGetFileCall(fileID FileID) *GetFileCall
NewGetFileCall constructs a new GetFileCall with required parameters. fileID - File identifier to get information about
func (*GetFileCall) FileID ¶ added in v0.0.5
func (call *GetFileCall) FileID(fileID FileID) *GetFileCall
FileID File identifier to get information about
type GetForumTopicIconStickersCall ¶ added in v0.6.0
GetForumTopicIconStickersCall reprenesents a call to the getForumTopicIconStickers method. Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user Requires no parameters Returns an Array of Sticker objects.
func NewGetForumTopicIconStickersCall ¶ added in v0.6.0
func NewGetForumTopicIconStickersCall() *GetForumTopicIconStickersCall
NewGetForumTopicIconStickersCall constructs a new GetForumTopicIconStickersCall with required parameters.
type GetGameHighScoresCall ¶
type GetGameHighScoresCall struct { Call[[]GameHighScore] }
GetGameHighScoresCall reprenesents a call to the getGameHighScores method. 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 Returns an Array of GameHighScore objects. This method will currently return scores for the target user, plus two of their closest neighbors on each side Will also return the top three users if the user and their neighbors are not among them Please note that this behavior is subject to change.
func NewGetGameHighScoresCall ¶
func NewGetGameHighScoresCall(userID UserID) *GetGameHighScoresCall
NewGetGameHighScoresCall constructs a new GetGameHighScoresCall with required parameters. userID - Target user id
func (*GetGameHighScoresCall) ChatID ¶ added in v0.0.5
func (call *GetGameHighScoresCall) ChatID(chatID ChatID) *GetGameHighScoresCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat
func (*GetGameHighScoresCall) InlineMessageID ¶ added in v0.0.5
func (call *GetGameHighScoresCall) InlineMessageID(inlineMessageID string) *GetGameHighScoresCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*GetGameHighScoresCall) MessageID ¶ added in v0.0.5
func (call *GetGameHighScoresCall) MessageID(messageID int) *GetGameHighScoresCall
MessageID Required if inline_message_id is not specified. Identifier of the sent message
func (*GetGameHighScoresCall) UserID ¶ added in v0.0.5
func (call *GetGameHighScoresCall) UserID(userID UserID) *GetGameHighScoresCall
UserID Target user id
type GetMeCall ¶
GetMeCall reprenesents a call to the getMe method. A simple method for testing your bot's authentication token Requires no parameters Returns basic information about the bot in form of a User object.
func NewGetMeCall ¶
func NewGetMeCall() *GetMeCall
NewGetMeCall constructs a new GetMeCall with required parameters.
type GetMyCommandsCall ¶
type GetMyCommandsCall struct { Call[[]BotCommand] }
GetMyCommandsCall reprenesents a call to the getMyCommands method. Use this method to get the current list of the bot's commands for the given scope and user language Returns an Array of BotCommand objects If commands aren't set, an empty list is returned.
func NewGetMyCommandsCall ¶
func NewGetMyCommandsCall() *GetMyCommandsCall
NewGetMyCommandsCall constructs a new GetMyCommandsCall with required parameters.
func (*GetMyCommandsCall) LanguageCode ¶
func (call *GetMyCommandsCall) LanguageCode(languageCode string) *GetMyCommandsCall
LanguageCode A two-letter ISO 639-1 language code or an empty string
func (*GetMyCommandsCall) Scope ¶
func (call *GetMyCommandsCall) Scope(scope BotCommandScope) *GetMyCommandsCall
Scope A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
type GetMyDefaultAdministratorRightsCall ¶
type GetMyDefaultAdministratorRightsCall struct { Call[ChatAdministratorRights] }
GetMyDefaultAdministratorRightsCall reprenesents a call to the getMyDefaultAdministratorRights method. Use this method to get the current default administrator rights of the bot Returns ChatAdministratorRights on success.
func NewGetMyDefaultAdministratorRightsCall ¶
func NewGetMyDefaultAdministratorRightsCall() *GetMyDefaultAdministratorRightsCall
NewGetMyDefaultAdministratorRightsCall constructs a new GetMyDefaultAdministratorRightsCall with required parameters.
func (*GetMyDefaultAdministratorRightsCall) ForChannels ¶
func (call *GetMyDefaultAdministratorRightsCall) ForChannels(forChannels bool) *GetMyDefaultAdministratorRightsCall
ForChannels Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.
type GetMyDescriptionCall ¶ added in v0.8.0
type GetMyDescriptionCall struct { Call[BotDescription] }
GetMyDescriptionCall reprenesents a call to the getMyDescription method. Use this method to get the current bot description for the given user language Returns BotDescription on success.
func NewGetMyDescriptionCall ¶ added in v0.8.0
func NewGetMyDescriptionCall() *GetMyDescriptionCall
NewGetMyDescriptionCall constructs a new GetMyDescriptionCall with required parameters.
func (*GetMyDescriptionCall) LanguageCode ¶ added in v0.8.0
func (call *GetMyDescriptionCall) LanguageCode(languageCode string) *GetMyDescriptionCall
LanguageCode A two-letter ISO 639-1 language code or an empty string
type GetMyNameCall ¶ added in v0.9.0
GetMyNameCall reprenesents a call to the getMyName method. Use this method to get the current bot name for the given user language Returns BotName on success.
func NewGetMyNameCall ¶ added in v0.9.0
func NewGetMyNameCall() *GetMyNameCall
NewGetMyNameCall constructs a new GetMyNameCall with required parameters.
func (*GetMyNameCall) LanguageCode ¶ added in v0.9.0
func (call *GetMyNameCall) LanguageCode(languageCode string) *GetMyNameCall
LanguageCode A two-letter ISO 639-1 language code or an empty string
type GetMyShortDescriptionCall ¶ added in v0.8.0
type GetMyShortDescriptionCall struct { Call[BotShortDescription] }
GetMyShortDescriptionCall reprenesents a call to the getMyShortDescription method. Use this method to get the current bot short description for the given user language Returns BotShortDescription on success.
func NewGetMyShortDescriptionCall ¶ added in v0.8.0
func NewGetMyShortDescriptionCall() *GetMyShortDescriptionCall
NewGetMyShortDescriptionCall constructs a new GetMyShortDescriptionCall with required parameters.
func (*GetMyShortDescriptionCall) LanguageCode ¶ added in v0.8.0
func (call *GetMyShortDescriptionCall) LanguageCode(languageCode string) *GetMyShortDescriptionCall
LanguageCode A two-letter ISO 639-1 language code or an empty string
type GetStickerSetCall ¶
type GetStickerSetCall struct { Call[StickerSet] }
GetStickerSetCall reprenesents a call to the getStickerSet method. Use this method to get a sticker set On success, a StickerSet object is returned.
func NewGetStickerSetCall ¶
func NewGetStickerSetCall(name string) *GetStickerSetCall
NewGetStickerSetCall constructs a new GetStickerSetCall with required parameters. name - Name of the sticker set
func (*GetStickerSetCall) Name ¶
func (call *GetStickerSetCall) Name(name string) *GetStickerSetCall
Name Name of the sticker set
type GetUpdatesCall ¶
GetUpdatesCall reprenesents a call to the getUpdates method. Use this method to receive incoming updates using long polling (wiki) Returns an Array of Update objects.
func NewGetUpdatesCall ¶
func NewGetUpdatesCall() *GetUpdatesCall
NewGetUpdatesCall constructs a new GetUpdatesCall with required parameters.
func (*GetUpdatesCall) AllowedUpdates ¶
func (call *GetUpdatesCall) AllowedUpdates(allowedUpdates []UpdateType) *GetUpdatesCall
AllowedUpdates 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 update types except chat_member (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.
func (*GetUpdatesCall) Limit ¶
func (call *GetUpdatesCall) Limit(limit int) *GetUpdatesCall
Limit Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
func (*GetUpdatesCall) Offset ¶
func (call *GetUpdatesCall) Offset(offset int) *GetUpdatesCall
Offset 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 be forgotten.
func (*GetUpdatesCall) Timeout ¶
func (call *GetUpdatesCall) Timeout(timeout int) *GetUpdatesCall
Timeout 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.
type GetUserProfilePhotosCall ¶
type GetUserProfilePhotosCall struct { Call[UserProfilePhotos] }
GetUserProfilePhotosCall reprenesents a call to the getUserProfilePhotos method. Use this method to get a list of profile pictures for a user Returns a UserProfilePhotos object.
func NewGetUserProfilePhotosCall ¶
func NewGetUserProfilePhotosCall(userID UserID) *GetUserProfilePhotosCall
NewGetUserProfilePhotosCall constructs a new GetUserProfilePhotosCall with required parameters. userID - Unique identifier of the target user
func (*GetUserProfilePhotosCall) Limit ¶
func (call *GetUserProfilePhotosCall) Limit(limit int) *GetUserProfilePhotosCall
Limit Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
func (*GetUserProfilePhotosCall) Offset ¶
func (call *GetUserProfilePhotosCall) Offset(offset int) *GetUserProfilePhotosCall
Offset Sequential number of the first photo to be returned. By default, all photos are returned.
func (*GetUserProfilePhotosCall) UserID ¶ added in v0.0.5
func (call *GetUserProfilePhotosCall) UserID(userID UserID) *GetUserProfilePhotosCall
UserID Unique identifier of the target user
type GetWebhookInfoCall ¶
type GetWebhookInfoCall struct { Call[WebhookInfo] }
GetWebhookInfoCall reprenesents a call to the getWebhookInfo method. Use this method to get current webhook status Requires no parameters On success, returns a WebhookInfo object If the bot is using getUpdates, will return an object with the url field empty.
func NewGetWebhookInfoCall ¶
func NewGetWebhookInfoCall() *GetWebhookInfoCall
NewGetWebhookInfoCall constructs a new GetWebhookInfoCall with required parameters.
type HideGeneralForumTopicCall ¶ added in v0.6.0
type HideGeneralForumTopicCall struct {
CallNoResult
}
HideGeneralForumTopicCall reprenesents a call to the hideGeneralForumTopic method. Use this method to hide the 'General' topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights The topic will be automatically closed if it was open
func NewHideGeneralForumTopicCall ¶ added in v0.6.0
func NewHideGeneralForumTopicCall(chatID PeerID) *HideGeneralForumTopicCall
NewHideGeneralForumTopicCall constructs a new HideGeneralForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*HideGeneralForumTopicCall) ChatID ¶ added in v0.6.0
func (call *HideGeneralForumTopicCall) ChatID(chatID PeerID) *HideGeneralForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type InlineKeyboardButton ¶
type InlineKeyboardButton struct { // Label text on the button Text string `json:"text"` // Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. URL string `json:"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. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. WebApp *WebAppInfo `json:"web_app,omitempty"` // Optional. An HTTPS 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. 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. May 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. May 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. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_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 and can only be used in invoice messages. Pay bool `json:"pay,omitempty"` }
InlineKeyboardButton this object represents one button of an inline keyboard. You must use exactly one of the optional fields.
func NewInlineKeyboardButtonCallback ¶ added in v0.0.2
func NewInlineKeyboardButtonCallback(text string, query string) InlineKeyboardButton
NewInlineKeyboardButtonCallback creates a new InlineKeyboardButton with specified callback data. Query should have length 1-64 bytes.
func NewInlineKeyboardButtonCallbackGame ¶ added in v0.0.2
func NewInlineKeyboardButtonCallbackGame(text string) InlineKeyboardButton
NewInlineKeyboardButtonCallbackGame represents the button which open a game.
func NewInlineKeyboardButtonLoginURL ¶ added in v0.0.2
func NewInlineKeyboardButtonLoginURL(text string, loginURL LoginURL) InlineKeyboardButton
InlineKeyboardMarkup represents button that open web page with auth data.
func NewInlineKeyboardButtonPay ¶ added in v0.0.2
func NewInlineKeyboardButtonPay(text string) InlineKeyboardButton
NewInlineKeyboardButtonPay represents a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages
func NewInlineKeyboardButtonSwitchInlineQuery ¶ added in v0.0.2
func NewInlineKeyboardButtonSwitchInlineQuery(text string, query string) InlineKeyboardButton
NewInlineKeyboardButtonSwitchInlineQuery represents button that
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.
func NewInlineKeyboardButtonSwitchInlineQueryCurrentChat ¶ added in v0.0.2
func NewInlineKeyboardButtonSwitchInlineQueryCurrentChat(text string, query string) InlineKeyboardButton
NewInlineKeyboardButtonSwitchInlineQueryCurrentChat represents button that will insert the bot's username and the specified inline query in the current chat's input field
func NewInlineKeyboardButtonURL ¶ added in v0.0.2
func NewInlineKeyboardButtonURL(text string, url string) InlineKeyboardButton
NewInlineButtonURL create inline button with http(s):// or tg:// URL to be opened when the button is pressed.
func NewInlineKeyboardButtonWebApp ¶ added in v0.0.2
func NewInlineKeyboardButtonWebApp(text string, webApp WebAppInfo) InlineKeyboardButton
NewInlineKeyboardButtonWebApp creates a button that open a web app.
type InlineKeyboardMarkup ¶
type InlineKeyboardMarkup struct { // Array of button rows, each represented by an Array of InlineKeyboardButton objects InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"` }
InlineKeyboardMarkup this object represents an inline keyboard that appears right next to the message it belongs to.
func NewInlineKeyboardMarkup ¶ added in v0.0.2
func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup
NewInlineKeyboardMarkup creates a new InlineKeyboardMarkup.
func (InlineKeyboardMarkup) Ptr ¶ added in v0.0.3
func (markup InlineKeyboardMarkup) Ptr() *InlineKeyboardMarkup
type InlineQuery ¶
type InlineQuery struct { // Unique identifier for this query ID string `json:"id"` // Sender From User `json:"from"` // Text of the query (up to 256 characters) Query string `json:"query"` // Offset of the results to be returned, can be controlled by the bot Offset string `json:"offset"` // Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat ChatType ChatType `json:"chat_type,omitempty"` // Optional. Sender location, only for bots that request user location Location *Location `json:"location,omitempty"` }
InlineQuery this object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
type InlineQueryResult ¶
InlineQueryResult it's a generic interface for all inline query results.
Known implementations:
- InlineQueryResultCachedAudio
- InlineQueryResultCachedDocument
- InlineQueryResultCachedGIF
- InlineQueryResultCachedMPEG4GIF
- InlineQueryResultCachedPhoto
- InlineQueryResultCachedSticker
- InlineQueryResultCachedVideo
- InlineQueryResultCachedVoice
- InlineQueryResultAudio
- InlineQueryResultDocument
- InlineQueryResultGIF
- InlineQueryResultMPEG4GIF
- InlineQueryResultPhoto
- InlineQueryResultVideo
- InlineQueryResultVoice
- InlineQueryResultArticle
- InlineQueryResultContact
- InlineQueryResultGame
- InlineQueryResultLocation
- InlineQueryResultVenue
type InlineQueryResultArticle ¶
type InlineQueryResultArticle struct { // Type of the result, must be article Type string `json:"type"` // Unique identifier for this result, 1-64 Bytes ID string `json:"id"` // Title of the result Title string `json:"title"` // Content of the message to be sent InputMessageContent InputMessageContent `json:"input_message_content"` // 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 ThumbnailURL string `json:"thumbnail_url,omitempty"` // Optional. Thumbnail width ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail height ThumbnailHeight int `json:"thumbnail_height,omitempty"` }
InlineQueryResultArticle represents a link to an article or web page.
func (InlineQueryResultArticle) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultArticle) MarshalJSON() ([]byte, error)
type InlineQueryResultAudio ¶
type InlineQueryResultAudio struct { // Type of the result, must be audio Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid URL for the audio file AudioURL string `json:"audio_url"` // Title Title string `json:"title"` // 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 ParseMode `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 int `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"` }
InlineQueryResultAudio represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
func (InlineQueryResultAudio) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultAudio) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedAudio ¶
type InlineQueryResultCachedAudio struct { // Type of the result, must be audio Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier for the audio file AudioFileID string `json:"audio_file_id"` // 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 ParseMode `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"` }
InlineQueryResultCachedAudio represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
func (InlineQueryResultCachedAudio) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedDocument ¶
type InlineQueryResultCachedDocument struct { // Type of the result, must be document Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // Title for the result Title string `json:"title"` // A valid file identifier for the file DocumentFileID string `json:"document_file_id"` // 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 ParseMode `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"` }
InlineQueryResultCachedDocument represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.
func (InlineQueryResultCachedDocument) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultCachedDocument) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedGIF ¶ added in v0.0.5
type InlineQueryResultCachedGIF struct { // Type of the result, must be gif Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier for the GIF file GIFFileID string `json:"gif_file_id"` // 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 ParseMode `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"` }
InlineQueryResultCachedGIF represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.
func (InlineQueryResultCachedGIF) MarshalJSON ¶ added in v0.0.5
func (result InlineQueryResultCachedGIF) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedMPEG4GIF ¶ added in v0.0.5
type InlineQueryResultCachedMPEG4GIF struct { // Type of the result, must be mpeg4_gif Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier for the MPEG4 file MPEG4FileID string `json:"mpeg4_file_id"` // 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 ParseMode `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"` }
InlineQueryResultCachedMPEG4GIF represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
func (InlineQueryResultCachedMPEG4GIF) MarshalJSON ¶ added in v0.0.5
func (result InlineQueryResultCachedMPEG4GIF) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedPhoto ¶
type InlineQueryResultCachedPhoto struct { // Type of the result, must be photo Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier of the photo PhotoFileID string `json:"photo_file_id"` // 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 ParseMode `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"` }
InlineQueryResultCachedPhoto represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
func (InlineQueryResultCachedPhoto) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedSticker ¶
type InlineQueryResultCachedSticker struct { // Type of the result, must be sticker Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier of the sticker StickerFileID string `json:"sticker_file_id"` // 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"` }
InlineQueryResultCachedSticker represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.
func (InlineQueryResultCachedSticker) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultCachedSticker) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedVideo ¶
type InlineQueryResultCachedVideo struct { // Type of the result, must be video Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier for the video file VideoFileID string `json:"video_file_id"` // Title for the result Title string `json:"title"` // 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 ParseMode `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"` }
InlineQueryResultCachedVideo represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
func (InlineQueryResultCachedVideo) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultCachedVideo) MarshalJSON() ([]byte, error)
type InlineQueryResultCachedVoice ¶
type InlineQueryResultCachedVoice struct { // Type of the result, must be voice Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid file identifier for the voice message VoiceFileID string `json:"voice_file_id"` // Voice message title Title string `json:"title"` // 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 ParseMode `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"` }
InlineQueryResultCachedVoice represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.
func (InlineQueryResultCachedVoice) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultCachedVoice) MarshalJSON() ([]byte, error)
type InlineQueryResultContact ¶
type InlineQueryResultContact struct { // Type of the result, must be contact Type string `json:"type"` // Unique identifier for this result, 1-64 Bytes ID string `json:"id"` // Contact's phone number PhoneNumber string `json:"phone_number"` // Contact's first name FirstName string `json:"first_name"` // 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 ThumbnailURL string `json:"thumbnail_url,omitempty"` // Optional. Thumbnail width ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail height ThumbnailHeight int `json:"thumbnail_height,omitempty"` }
InlineQueryResultContact represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
func (InlineQueryResultContact) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultContact) MarshalJSON() ([]byte, error)
type InlineQueryResultDocument ¶
type InlineQueryResultDocument struct { // Type of the result, must be document Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // Title for the result Title string `json:"title"` // 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 ParseMode `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"` // MIME type of the content of the file, either “application/pdf” or “application/zip” MIMEType string `json:"mime_type"` // 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 ThumbnailURL string `json:"thumbnail_url,omitempty"` // Optional. Thumbnail width ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail height ThumbnailHeight int `json:"thumbnail_height,omitempty"` }
InlineQueryResultDocument represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
func (InlineQueryResultDocument) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultDocument) MarshalJSON() ([]byte, error)
type InlineQueryResultGIF ¶ added in v0.0.5
type InlineQueryResultGIF struct { // Type of the result, must be gif Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid URL for the GIF file. File size must not exceed 1MB GIFURL string `json:"gif_url"` // Optional. Width of the GIF GIFWidth int `json:"gif_width,omitempty"` // Optional. Height of the GIF GIFHeight int `json:"gif_height,omitempty"` // Optional. Duration of the GIF in seconds GIFDuration int `json:"gif_duration,omitempty"` // URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result ThumbnailURL string `json:"thumbnail_url"` // Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” ThumbnailMIMEType string `json:"thumbnail_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 ParseMode `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"` }
InlineQueryResultGIF represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
func (InlineQueryResultGIF) MarshalJSON ¶ added in v0.0.5
func (result InlineQueryResultGIF) MarshalJSON() ([]byte, error)
type InlineQueryResultGame ¶
type InlineQueryResultGame struct { // Type of the result, must be game Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // Short name of the game GameShortName string `json:"game_short_name"` // Optional. Inline keyboard attached to the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
InlineQueryResultGame represents a Game.
func (InlineQueryResultGame) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultGame) MarshalJSON() ([]byte, error)
type InlineQueryResultLocation ¶
type InlineQueryResultLocation struct { // Type of the result, must be location Type string `json:"type"` // Unique identifier for this result, 1-64 Bytes ID string `json:"id"` // Location latitude in degrees Latitude float64 `json:"latitude"` // Location longitude in degrees Longitude float64 `json:"longitude"` // Location title Title string `json:"title"` // 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 int `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 int `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 int `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 ThumbnailURL string `json:"thumbnail_url,omitempty"` // Optional. Thumbnail width ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail height ThumbnailHeight int `json:"thumbnail_height,omitempty"` }
InlineQueryResultLocation represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
func (InlineQueryResultLocation) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultLocation) MarshalJSON() ([]byte, error)
type InlineQueryResultMPEG4GIF ¶ added in v0.0.5
type InlineQueryResultMPEG4GIF struct { // Type of the result, must be mpeg4_gif Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid URL for the MPEG4 file. File size must not exceed 1MB MPEG4URL string `json:"mpeg4_url"` // Optional. Video width MPEG4Width int `json:"mpeg4_width,omitempty"` // Optional. Video height MPEG4Height int `json:"mpeg4_height,omitempty"` // Optional. Video duration in seconds MPEG4Duration int `json:"mpeg4_duration,omitempty"` // URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result ThumbnailURL string `json:"thumbnail_url"` // Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” ThumbnailMIMEType string `json:"thumbnail_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 ParseMode `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"` }
InlineQueryResultMPEG4GIF represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
func (InlineQueryResultMPEG4GIF) MarshalJSON ¶ added in v0.0.5
func (result InlineQueryResultMPEG4GIF) MarshalJSON() ([]byte, error)
type InlineQueryResultPhoto ¶
type InlineQueryResultPhoto struct { // Type of the result, must be photo Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB PhotoURL string `json:"photo_url"` // URL of the thumbnail for the photo ThumbnailURL string `json:"thumbnail_url"` // Optional. Width of the photo PhotoWidth int `json:"photo_width,omitempty"` // Optional. Height of the photo PhotoHeight int `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 ParseMode `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"` }
InlineQueryResultPhoto represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
func (InlineQueryResultPhoto) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultPhoto) MarshalJSON() ([]byte, error)
type InlineQueryResultVenue ¶
type InlineQueryResultVenue struct { // Type of the result, must be venue Type string `json:"type"` // Unique identifier for this result, 1-64 Bytes ID string `json:"id"` // Latitude of the venue location in degrees Latitude float64 `json:"latitude"` // Longitude of the venue location in degrees Longitude float64 `json:"longitude"` // Title of the venue Title string `json:"title"` // Address of the venue Address string `json:"address"` // 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 ThumbnailURL string `json:"thumbnail_url,omitempty"` // Optional. Thumbnail width ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail height ThumbnailHeight int `json:"thumbnail_height,omitempty"` }
InlineQueryResultVenue represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.
func (InlineQueryResultVenue) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultVenue) MarshalJSON() ([]byte, error)
type InlineQueryResultVideo ¶
type InlineQueryResultVideo struct { // Type of the result, must be video Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid URL for the embedded video player or video file VideoURL string `json:"video_url"` // MIME type of the content of the video URL, “text/html” or “video/mp4” MIMEType string `json:"mime_type"` // URL of the thumbnail (JPEG only) for the video ThumbnailURL string `json:"thumbnail_url"` // Title for the result Title string `json:"title"` // 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 ParseMode `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 int `json:"video_width,omitempty"` // Optional. Video height VideoHeight int `json:"video_height,omitempty"` // Optional. Video duration in seconds VideoDuration int `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"` }
InlineQueryResultVideo represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
func (InlineQueryResultVideo) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultVideo) MarshalJSON() ([]byte, error)
type InlineQueryResultVoice ¶
type InlineQueryResultVoice struct { // Type of the result, must be voice Type string `json:"type"` // Unique identifier for this result, 1-64 bytes ID string `json:"id"` // A valid URL for the voice recording VoiceURL string `json:"voice_url"` // Recording title Title string `json:"title"` // 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 ParseMode `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 int `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"` }
InlineQueryResultVoice represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.
func (InlineQueryResultVoice) MarshalJSON ¶ added in v0.0.3
func (result InlineQueryResultVoice) MarshalJSON() ([]byte, error)
type InlineQueryResultsButton ¶ added in v0.9.0
type InlineQueryResultsButton struct { // Label text on the button Text string `json:"text"` // Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App. WebApp *WebAppInfo `json:"web_app,omitempty"` // Optional. Deep-linking parameter for the /start message sent to the bot when a user presses the 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. StartParameter string `json:"start_parameter,omitempty"` }
InlineQueryResultsButton this object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
type InputContactMessageContent ¶
type InputContactMessageContent struct { // Contact's phone number PhoneNumber string `json:"phone_number"` // Contact's first name FirstName string `json:"first_name"` // 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"` }
InputContactMessageContent represents the content of a contact message to be sent as the result of an inline query.
type InputFile ¶
type InputFile struct { // Name of file Name string // Body of file Body io.Reader // contains filtered or unexported fields }
InputFile represents the file that should be uploaded to the telegram.
func NewInputFile ¶
NewInputFile creates new InputFile with given name and body.
func NewInputFileBytes ¶
NewInputFileFromBytes creates new InputFile with given name and bytes slice.
Example:
file := NewInputFileBytes("test.txt", []byte("test, test, test..."))
func NewInputFileFS ¶ added in v0.2.0
NewInputFileFS creates the InputFile from provided FS and file path.
Usage:
//go:embed assets/* var assets embed.FS file, err := NewInputFileFS(assets, "images/test.png") if err != nil { return err } defer file.Close()
func NewInputFileLocal ¶
NewInputFileLocal creates the InputFile from provided local file path. This method just open file by provided path. So, you should close it AFTER send.
Example:
file, err := NewInputFileLocal("test.png") if err != nil { return err } defer close()
func (*InputFile) MarshalJSON ¶ added in v0.0.5
type InputInvoiceMessageContent ¶
type InputInvoiceMessageContent struct { // Product name, 1-32 characters Title string `json:"title"` // Product description, 1-255 characters Description string `json:"description"` // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. Payload string `json:"payload"` // Payment provider token, obtained via @BotFather ProviderToken string `json:"provider_token"` // Three-letter ISO 4217 currency code, see more on currencies Currency string `json:"currency"` // Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) Prices []LabeledPrice `json:"prices"` // Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0 MaxTipAmount int `json:"max_tip_amount,omitempty"` // Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"` // Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. ProviderData string `json:"provider_data,omitempty"` // Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. PhotoURL string `json:"photo_url,omitempty"` // Optional. Photo size in bytes PhotoSize int `json:"photo_size,omitempty"` // Optional. Photo width PhotoWidth int `json:"photo_width,omitempty"` // Optional. Photo height PhotoHeight int `json:"photo_height,omitempty"` // Optional. Pass True if you require the user's full name to complete the order NeedName bool `json:"need_name,omitempty"` // Optional. Pass True if you require the user's phone number to complete the order NeedPhoneNumber bool `json:"need_phone_number,omitempty"` // Optional. Pass True if you require the user's email address to complete the order NeedEmail bool `json:"need_email,omitempty"` // Optional. Pass True if you require the user's shipping address to complete the order NeedShippingAddress bool `json:"need_shipping_address,omitempty"` // Optional. Pass True if the user's phone number should be sent to provider SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` // Optional. Pass True if the user's email address should be sent to provider SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` // Optional. Pass True if the final price depends on the shipping method IsFlexible bool `json:"is_flexible,omitempty"` }
InputInvoiceMessageContent represents the content of an invoice message to be sent as the result of an inline query.
type InputLocationMessageContent ¶
type InputLocationMessageContent struct { // Latitude of the location in degrees Latitude float64 `json:"latitude"` // Longitude of the location in degrees Longitude float64 `json:"longitude"` // 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 int `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 int `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 int `json:"proximity_alert_radius,omitempty"` }
InputLocationMessageContent represents the content of a location message to be sent as the result of an inline query.
type InputMedia ¶
type InputMedia interface {
// contains filtered or unexported methods
}
InputMedia generic interface for InputMedia*.
Known implementations:
type InputMediaAnimation ¶
type InputMediaAnimation struct { // Type of the result, must be animation Type string `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » Media FileArg `json:"media"` // 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 information on Sending Files » Thumbnail *InputFile `json:"thumbnail,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 ParseMode `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 int `json:"width,omitempty"` // Optional. Animation height Height int `json:"height,omitempty"` // Optional. Animation duration in seconds Duration int `json:"duration,omitempty"` // Optional. Pass True if the animation needs to be covered with a spoiler animation HasSpoiler bool `json:"has_spoiler,omitempty"` }
InputMediaAnimation represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
func (*InputMediaAnimation) MarshalJSON ¶ added in v0.0.5
func (media *InputMediaAnimation) MarshalJSON() ([]byte, error)
type InputMediaAudio ¶
type InputMediaAudio struct { // Type of the result, must be audio Type string `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » Media FileArg `json:"media"` // 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 information on Sending Files » Thumbnail *InputFile `json:"thumbnail,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 ParseMode `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 int `json:"duration,omitempty"` // Optional. Performer of the audio Performer string `json:"performer,omitempty"` // Optional. Title of the audio Title string `json:"title,omitempty"` }
InputMediaAudio represents an audio file to be treated as music to be sent.
func (*InputMediaAudio) MarshalJSON ¶ added in v0.0.5
func (media *InputMediaAudio) MarshalJSON() ([]byte, error)
type InputMediaDocument ¶
type InputMediaDocument struct { // Type of the result, must be document Type string `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » Media FileArg `json:"media"` // 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 information on Sending Files » Thumbnail *InputFile `json:"thumbnail,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 ParseMode `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"` }
InputMediaDocument represents a general file to be sent.
func (*InputMediaDocument) MarshalJSON ¶ added in v0.0.5
func (media *InputMediaDocument) MarshalJSON() ([]byte, error)
type InputMediaPhoto ¶
type InputMediaPhoto struct { // Type of the result, must be photo Type string `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » Media FileArg `json:"media"` // 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 ParseMode `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. Pass True if the photo needs to be covered with a spoiler animation HasSpoiler bool `json:"has_spoiler,omitempty"` }
InputMediaPhoto represents a photo to be sent.
func (*InputMediaPhoto) MarshalJSON ¶ added in v0.0.5
func (media *InputMediaPhoto) MarshalJSON() ([]byte, error)
type InputMediaVideo ¶
type InputMediaVideo struct { // Type of the result, must be video Type string `json:"type"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files » Media FileArg `json:"media"` // 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 information on Sending Files » Thumbnail *InputFile `json:"thumbnail,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 ParseMode `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 int `json:"width,omitempty"` // Optional. Video height Height int `json:"height,omitempty"` // Optional. Video duration in seconds Duration int `json:"duration,omitempty"` // Optional. Pass True if the uploaded video is suitable for streaming SupportsStreaming bool `json:"supports_streaming,omitempty"` // Optional. Pass True if the video needs to be covered with a spoiler animation HasSpoiler bool `json:"has_spoiler,omitempty"` }
InputMediaVideo represents a video to be sent.
func (*InputMediaVideo) MarshalJSON ¶ added in v0.0.5
func (media *InputMediaVideo) MarshalJSON() ([]byte, error)
type InputMessageContent ¶
type InputMessageContent interface {
// contains filtered or unexported methods
}
InputMessageContent it's generic interface for all types of input message content.
Known implementations:
type InputSticker ¶ added in v0.8.0
type InputSticker struct { // The added sticker. 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, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files » Sticker FileArg `json:"sticker"` // List of 1-20 emoji associated with the sticker EmojiList []string `json:"emoji_list"` // Optional. Position where the mask should be placed on faces. For “mask” stickers only. MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only. Keywords []string `json:"keywords,omitempty"` }
InputSticker this object describes a sticker to be added to a sticker set.
type InputTextMessageContent ¶
type InputTextMessageContent struct { // Text of the message to be sent, 1-4096 characters MessageText string `json:"message_text"` // Optional. Mode for parsing entities in the message text. See formatting options for more details. ParseMode ParseMode `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"` }
InputTextMessageContent represents the content of a text message to be sent as the result of an inline query.
type InputVenueMessageContent ¶
type InputVenueMessageContent struct { // Latitude of the venue in degrees Latitude float64 `json:"latitude"` // Longitude of the venue in degrees Longitude float64 `json:"longitude"` // Name of the venue Title string `json:"title"` // Address of the venue Address string `json:"address"` // 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"` }
InputVenueMessageContent represents the content of a venue message to be sent as the result of an inline query.
type Invoice ¶
type Invoice struct { // Product name Title string `json:"title"` // Product description Description string `json:"description"` // Unique bot deep-linking parameter that can be used to generate this invoice StartParameter string `json:"start_parameter"` // Three-letter ISO 4217 currency code Currency string `json:"currency"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int `json:"total_amount"` }
Invoice this object contains basic information about an 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"` // Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only. RequestUser *KeyboardButtonRequestUser `json:"request_user,omitempty"` // Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only. RequestChat *KeyboardButtonRequestChat `json:"request_chat,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"` // Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. WebApp *WebAppInfo `json:"web_app,omitempty"` }
KeyboardButton this object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.
func NewKeyboardButton ¶ added in v0.0.2
func NewKeyboardButton(text string) KeyboardButton
NewKeyboardButton creates a plain reply keyboard button.
func NewKeyboardButtonRequestContact ¶ added in v0.0.2
func NewKeyboardButtonRequestContact(text string) KeyboardButton
NewKeyboardButtonRequestContact creates a reply keyboard button that request a contact from user. Available in private chats only.
func NewKeyboardButtonRequestLocation ¶ added in v0.0.2
func NewKeyboardButtonRequestLocation(text string) KeyboardButton
NewKeyboardButtonRequestLocation creates a reply keyboard button that request a location from user. Available in private chats only.
func NewKeyboardButtonRequestPoll ¶ added in v0.0.2
func NewKeyboardButtonRequestPoll(text string, poll KeyboardButtonPollType) KeyboardButton
NewKeyboardButtonRequestPoll creates a reply keyboard button that request a poll from user. Available in private chats only.
func NewKeyboardButtonWebApp ¶ added in v0.0.2
func NewKeyboardButtonWebApp(text string, webApp WebAppInfo) KeyboardButton
NewKeyboardButtonWebApp create a reply keyboard button that open a web app.
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"` }
KeyboardButtonPollType this object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
type KeyboardButtonRequestChat ¶ added in v0.6.0
type KeyboardButtonRequestChat struct { // Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message RequestID int `json:"request_id"` // Pass True to request a channel chat, pass False to request a group or a supergroup chat. ChatIsChannel bool `json:"chat_is_channel"` // Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. ChatIsForum bool `json:"chat_is_forum,omitempty"` // Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied. ChatHasUsername bool `json:"chat_has_username,omitempty"` // Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. ChatIsCreated bool `json:"chat_is_created,omitempty"` // Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied. UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights,omitempty"` // Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied. BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights,omitempty"` // Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. BotIsMember bool `json:"bot_is_member,omitempty"` }
KeyboardButtonRequestChat this object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. More about requesting chats »
type KeyboardButtonRequestUser ¶ added in v0.6.0
type KeyboardButtonRequestUser struct { // Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message RequestID int `json:"request_id"` // Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied. UserIsBot bool `json:"user_is_bot,omitempty"` // Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied. UserIsPremium bool `json:"user_is_premium,omitempty"` }
KeyboardButtonRequestUser this object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. More about requesting users »
type LabeledPrice ¶
type LabeledPrice struct { // Portion label Label string `json:"label"` // Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Amount int `json:"amount"` }
LabeledPrice this object represents a portion of the price for goods or services.
type LeaveChatCall ¶
type LeaveChatCall struct {
CallNoResult
}
LeaveChatCall reprenesents a call to the leaveChat method. Use this method for your bot to leave a group, supergroup or channel
func NewLeaveChatCall ¶
func NewLeaveChatCall(chatID PeerID) *LeaveChatCall
NewLeaveChatCall constructs a new LeaveChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
func (*LeaveChatCall) ChatID ¶ added in v0.0.5
func (call *LeaveChatCall) ChatID(chatID PeerID) *LeaveChatCall
ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type Location ¶
type Location struct { // Longitude as defined by sender Longitude float64 `json:"longitude"` // Latitude as defined by sender Latitude float64 `json:"latitude"` // 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 int `json:"live_period,omitempty"` // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. Heading int `json:"heading,omitempty"` // Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` }
Location this object represents a point on the map.
type LogOutCall ¶
type LogOutCall struct {
CallNoResult
}
LogOutCall reprenesents a call to the logOut method. 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 Requires no parameters.
func NewLogOutCall ¶
func NewLogOutCall() *LogOutCall
NewLogOutCall constructs a new LogOutCall with required parameters.
type LoginURL ¶ added in v0.0.5
type LoginURL struct { // An HTTPS 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"` // 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"` }
LoginURL 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:
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"` // 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"` // 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"` // Mask scaling coefficient. For example, 2.0 means double size. Scale float64 `json:"scale"` }
MaskPosition this object describes the position on faces where a mask should be placed by default.
type MenuButton ¶
MenuButton it's generic interface for all types of menu button.
Known implementations:
- MenuButtonDefault
- MenuButtonCommands
- [MenubuttonWebApp]
type MenuButtonCommands ¶
type MenuButtonCommands struct { // Type of the button, must be commands Type string `json:"type"` }
MenuButtonCommands represents a menu button, which opens the bot's list of commands.
func (MenuButtonCommands) MarshalJSON ¶ added in v0.0.5
func (button MenuButtonCommands) MarshalJSON() ([]byte, error)
type MenuButtonDefault ¶
type MenuButtonDefault struct { // Type of the button, must be default Type string `json:"type"` }
MenuButtonDefault describes that no specific value for the menu button was set.
func (MenuButtonDefault) MarshalJSON ¶ added in v0.0.5
func (button MenuButtonDefault) MarshalJSON() ([]byte, error)
type MenuButtonOneOf ¶ added in v0.9.1
type MenuButtonOneOf struct { Default *MenuButtonDefault Commands *MenuButtonCommands WebApp *MenuButtonWebApp }
MenuButtonOneOf contains one of MenuButton implementations. It's used for proper JSON marshaling.
func (*MenuButtonOneOf) UnmarshalJSON ¶ added in v0.9.1
func (button *MenuButtonOneOf) UnmarshalJSON(v []byte) error
type MenuButtonWebApp ¶
type MenuButtonWebApp struct { // Type of the button, must be web_app Type string `json:"type"` // Text on the button Text string `json:"text"` // Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. WebApp WebAppInfo `json:"web_app"` }
MenuButtonWebApp represents a menu button, which launches a Web App.
func (MenuButtonWebApp) MarshalJSON ¶ added in v0.0.5
func (button MenuButtonWebApp) MarshalJSON() ([]byte, error)
type Message ¶
type Message struct { // Unique message identifier inside this chat ID int `json:"message_id"` // Optional. Unique identifier of a message thread to which the message belongs; for supergroups only MessageThreadID int `json:"message_thread_id,omitempty"` // Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. From *User `json:"from,omitempty"` // Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. SenderChat *Chat `json:"sender_chat,omitempty"` // Date the message was sent in Unix time Date int `json:"date"` // Conversation the message belongs to Chat Chat `json:"chat"` // 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 int `json:"forward_from_message_id,omitempty"` // Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender 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. True, if the message is sent to a forum topic IsTopicMessage bool `json:"is_topic_message,omitempty"` // Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group IsAutomaticForward bool `json:"is_automatic_forward,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. True, if the message can't be forwarded HasProtectedContent bool `json:"has_protected_content,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 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 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. True, if the message media is covered by a spoiler animation HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"` // Optional. Message is a shared contact, information about the contact Contact *Contact `json:"contact,omitempty"` // Optional. Message is a dice with random value 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. Service message: auto-delete timer settings changed in the chat MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` // Optional. The group has been migrated to a supergroup with the specified identifier. MigrateToChatID ChatID `json:"migrate_to_chat_id,omitempty"` // Optional. The supergroup has been migrated from a group with the specified identifier. MigrateFromChatID ChatID `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"` UserShared *UserShared `json:"user_shared,omitempty"` ChatShared *ChatShared `json:"chat_shared,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. Service message: the user allowed the bot added to the attachment menu to write messages WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,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. Service message: forum topic created ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"` // Optional. Service message: forum topic edited ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"` // Optional. Service message: forum topic closed ForumTopicClosed *ForumTopicClosed `json:"forum_topic_closed,omitempty"` // Optional. Service message: forum topic reopened ForumTopicReopened *ForumTopicReopened `json:"forum_topic_reopened,omitempty"` // Optional. Service message: the 'General' forum topic hidden GeneralForumTopicHidden *GeneralForumTopicHidden `json:"general_forum_topic_hidden,omitempty"` GeneralForumTopicUnhidden *GeneralForumTopicUnhidden `json:"general_forum_topic_unhidden,omitempty"` // Optional. Service message: video chat scheduled VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` // Optional. Service message: video chat started VideoChatStarted *VideoChatStarted `json:"video_chat_started,omitempty"` // Optional. Service message: video chat ended VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"` // Optional. Service message: new participants invited to a video chat VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"` // Optional. Service message: data sent by a Web App WebAppData *WebAppData `json:"web_app_data,omitempty"` // Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` }
Message this object represents a message.
func (*Message) Type ¶ added in v0.0.6
func (msg *Message) Type() MessageType
type MessageAutoDeleteTimerChanged ¶
type MessageAutoDeleteTimerChanged struct { // New auto-delete time for messages in the chat; in seconds MessageAutoDeleteTime int `json:"message_auto_delete_time"` }
MessageAutoDeleteTimerChanged this object represents a service message about a change in auto-delete timer settings.
type MessageEntity ¶
type MessageEntity struct { // Type of the entity. Currently, 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), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) Type MessageEntityType `json:"type"` // Offset in UTF-16 code units to the start of the entity Offset int `json:"offset"` // Length of the entity in UTF-16 code units Length int `json:"length"` // 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"` // Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker CustomEmojiID string `json:"custom_emoji_id,omitempty"` }
MessageEntity this object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
func (MessageEntity) Extract ¶ added in v0.1.1
func (me MessageEntity) Extract(text string) string
Extract entitie value from plain text.
type MessageEntityType ¶ added in v0.1.1
type MessageEntityType int
MessageEntityType it's type for describe content of MessageEntity.
const ( MessageEntityTypeUnknown MessageEntityType = iota // @username MessageEntityTypeMention // #hashtag MessageEntityTypeHashtag // $USD MessageEntityTypeCashtag // /start@jobs_bot MessageEntityTypeBotCommand // https://telegram.org MessageEntityTypeURL // do-not-reply@telegram.org MessageEntityTypeEmail // +1-212-555-0123 MessageEntityTypePhoneNumber // <strong>bold</strong> MessageEntityTypeBold // <i>italic</i> MessageEntityTypeItalic // <u>underline</u> MessageEntityTypeUnderline // <strike>strike</strike> MessageEntityTypeStrikethrough // <tg-spoiler>spoiler</tg-spoiler> MessageEntityTypeSpoiler // <code>code</code> MessageEntityTypeCode // <pre>pre</pre> MessageEntityTypePre // <a href="https://telegram.org">link</a> MessageEntityTypeTextLink // for users without usernames MessageEntityTypeTextMention // for inline custom emoji sticker MessageEntityCustomEmoji )
func (MessageEntityType) MarshalText ¶ added in v0.1.1
func (met MessageEntityType) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (MessageEntityType) String ¶ added in v0.1.1
func (met MessageEntityType) String() string
String returns string representation of MessageEntityType.
func (*MessageEntityType) UnmarshalText ¶ added in v0.1.1
func (met *MessageEntityType) UnmarshalText(v []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type MessageID ¶
type MessageID struct { // Unique message identifier MessageID int `json:"message_id"` }
MessageID this object represents a unique message identifier.
type MessageType ¶ added in v0.0.6
type MessageType int
MessageType it's type for describe content of Message.
const ( MessageTypeUnknown MessageType = iota MessageTypeText MessageTypeAnimation MessageTypeAudio MessageTypeDocument MessageTypePhoto MessageTypeSticker MessageTypeVideo MessageTypeVideoNote MessageTypeVoice MessageTypeContact MessageTypeDice MessageTypeGame MessageTypePoll MessageTypeVenue MessageTypeLocation MessageTypeNewChatMembers MessageTypeLeftChatMember MessageTypeNewChatTitle MessageTypeNewChatPhoto MessageTypeDeleteChatPhoto MessageTypeGroupChatCreated MessageTypeSupergroupChatCreated MessageTypeChannelChatCreated MessageTypeMessageAutoDeleteTimerChanged MessageTypeMigrateToChatID MessageTypeMigrateFromChatID MessageTypePinnedMessage MessageTypeInvoice MessageTypeSuccessfulPayment MessageTypeConnectedWebsite MessageTypePassportData MessageTypeProximityAlertTriggered MessageTypeVideoChatScheduled MessageTypeVideoChatStarted MessageTypeVideoChatEnded MessageTypeVideoChatParticipantsInvited MessageTypeWebAppData )
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"` }
OrderInfo this object represents information about an order.
type ParseMode ¶
type ParseMode interface { encoding.TextMarshaler fmt.Stringer // Change separator for next calls Sep(v string) ParseMode // Text joins the given strings with new line seprator Text(v ...string) string // Line joins the given strings with space seprator Line(v ...string) string // Bold Bold(v ...string) string // Italic Italic(v ...string) string // Underline Underline(v ...string) string // Deleted (Striketrough) Strike(v ...string) string // Spoiler Spoiler(v ...string) string // Link Link(title, url string) string // Code Code(v ...string) string // Preformated text Pre(v ...string) string // Escape Escape(v string) string }
var ( // HTML is ParseMode that uses HTML tags HTML ParseMode = parseMode{ // contains filtered or unexported fields } // MD is ParseMode that uses Markdown tags. // Warning: this is legacy mode, use MarkdownV2 (MD2) instead. MD ParseMode = parseMode{ // contains filtered or unexported fields } // MD2 is ParseMode that uses MarkdownV2 tags. MD2 ParseMode = parseMode{ // contains filtered or unexported fields } )
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"` // Encrypted credentials required to decrypt the data Credentials EncryptedCredentials `json:"credentials"` }
PassportData describes Telegram Passport data shared with the bot by the user.
type PassportElementError ¶
type PassportElementError struct { // Error source, must be data Source string `json:"source"` // 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"` // Name of the data field which has the error FieldName string `json:"field_name"` // Base64-encoded data hash DataHash string `json:"data_hash"` // Error message Message string `json:"message"` }
PassportElementError this object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:
type PassportElementErrorDataField ¶
type PassportElementErrorDataField struct { // Error source, must be data Source string `json:"source"` // 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"` // Name of the data field which has the error FieldName string `json:"field_name"` // Base64-encoded data hash DataHash string `json:"data_hash"` // Error message Message string `json:"message"` }
PassportElementErrorDataField represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
type PassportElementErrorFile ¶
type PassportElementErrorFile struct { // Error source, must be file Source string `json:"source"` // 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"` // Base64-encoded file hash FileHash string `json:"file_hash"` // Error message Message string `json:"message"` }
PassportElementErrorFile represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
type PassportElementErrorFiles ¶
type PassportElementErrorFiles struct { // Error source, must be files Source string `json:"source"` // 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"` // List of base64-encoded file hashes FileHashes []string `json:"file_hashes"` // Error message Message string `json:"message"` }
PassportElementErrorFiles represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
type PassportElementErrorFrontSide ¶
type PassportElementErrorFrontSide struct { // Error source, must be front_side Source string `json:"source"` // 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"` // Base64-encoded hash of the file with the front side of the document FileHash string `json:"file_hash"` // Error message Message string `json:"message"` }
PassportElementErrorFrontSide represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.
type PassportElementErrorReverseSide ¶
type PassportElementErrorReverseSide struct { // Error source, must be reverse_side Source string `json:"source"` // The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” Type string `json:"type"` // Base64-encoded hash of the file with the reverse side of the document FileHash string `json:"file_hash"` // Error message Message string `json:"message"` }
PassportElementErrorReverseSide represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
type PassportElementErrorSelfie ¶
type PassportElementErrorSelfie struct { // Error source, must be selfie Source string `json:"source"` // 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"` // Base64-encoded hash of the file with the selfie FileHash string `json:"file_hash"` // Error message Message string `json:"message"` }
PassportElementErrorSelfie represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
type PassportElementErrorTranslationFile ¶
type PassportElementErrorTranslationFile struct { // Error source, must be translation_file Source string `json:"source"` // 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"` // Base64-encoded file hash FileHash string `json:"file_hash"` // Error message Message string `json:"message"` }
PassportElementErrorTranslationFile represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
type PassportElementErrorTranslationFiles ¶
type PassportElementErrorTranslationFiles struct { // Error source, must be translation_files Source string `json:"source"` // 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"` // List of base64-encoded file hashes FileHashes []string `json:"file_hashes"` // Error message Message string `json:"message"` }
PassportElementErrorTranslationFiles represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
type PassportElementErrorUnspecified ¶
type PassportElementErrorUnspecified struct { // Error source, must be unspecified Source string `json:"source"` // Type of element of the user's Telegram Passport which has the issue Type string `json:"type"` // Base64-encoded element hash ElementHash string `json:"element_hash"` // Error message Message string `json:"message"` }
PassportElementErrorUnspecified represents an issue in an unspecified place. The error is considered resolved when new data is added.
type PassportFile ¶
type PassportFile struct { // Identifier for this file, which can be used to download or reuse the file FileID string `json:"file_id"` // 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"` // File size in bytes FileSize int `json:"file_size"` // Unix time when the file was uploaded FileDate int `json:"file_date"` }
PassportFile 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.
type PeerID ¶
type PeerID interface {
PeerID() string
}
PeerID represents generic Telegram peer.
Known implementations:
type PhotoSize ¶
type PhotoSize struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Photo width Width int `json:"width"` // Photo height Height int `json:"height"` // Optional. File size in bytes FileSize int `json:"file_size,omitempty"` }
PhotoSize this object represents one size of a photo or a file / sticker thumbnail.
type PinChatMessageCall ¶
type PinChatMessageCall struct {
CallNoResult
}
PinChatMessageCall reprenesents a call to the pinChatMessage method. 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' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel
func NewPinChatMessageCall ¶
func NewPinChatMessageCall(chatID PeerID, messageID int) *PinChatMessageCall
NewPinChatMessageCall constructs a new PinChatMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Identifier of a message to pin
func (*PinChatMessageCall) ChatID ¶ added in v0.0.5
func (call *PinChatMessageCall) ChatID(chatID PeerID) *PinChatMessageCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*PinChatMessageCall) DisableNotification ¶
func (call *PinChatMessageCall) DisableNotification(disableNotification bool) *PinChatMessageCall
DisableNotification 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.
func (*PinChatMessageCall) MessageID ¶ added in v0.0.5
func (call *PinChatMessageCall) MessageID(messageID int) *PinChatMessageCall
MessageID Identifier of a message to pin
type Poll ¶
type Poll struct { // Unique poll identifier ID string `json:"id"` // Poll question, 1-300 characters Question string `json:"question"` // List of poll options Options []PollOption `json:"options"` // Total number of users that voted in the poll TotalVoterCount int `json:"total_voter_count"` // True, if the poll is closed IsClosed bool `json:"is_closed"` // True, if the poll is anonymous IsAnonymous bool `json:"is_anonymous"` // Poll type, currently can be “regular” or “quiz” Type string `json:"type"` // True, if the poll allows multiple answers AllowsMultipleAnswers bool `json:"allows_multiple_answers"` // 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 int `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 int `json:"open_period,omitempty"` // Optional. Point in time (Unix timestamp) when the poll will be automatically closed CloseDate int `json:"close_date,omitempty"` }
Poll this object contains information about a poll.
type PollAnswer ¶
type PollAnswer struct { // Unique poll identifier PollID string `json:"poll_id"` // The user, who changed the answer to the poll User User `json:"user"` // 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. OptionaIDs []int `json:"option_ids"` }
PollAnswer this object represents an answer of a user in a non-anonymous poll.
type PollOption ¶
type PollOption struct { // Option text, 1-100 characters Text string `json:"text"` // Number of users that voted for this option VoterCount int `json:"voter_count"` }
PollOption this object contains information about one answer option in a poll.
type PreCheckoutQuery ¶
type PreCheckoutQuery struct { // Unique query identifier ID string `json:"id"` // User who sent the query From User `json:"from"` // Three-letter ISO 4217 currency code Currency string `json:"currency"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int `json:"total_amount"` // Bot specified invoice payload InvoicePayload string `json:"invoice_payload"` // Optional. Identifier of the shipping option chosen by the user ShippingOptionID string `json:"shipping_option_id,omitempty"` // Optional. Order information provided by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` }
PreCheckoutQuery this object contains information about an incoming pre-checkout query.
type PromoteChatMemberCall ¶
type PromoteChatMemberCall struct {
CallNoResult
}
PromoteChatMemberCall reprenesents a call to the promoteChatMember method. 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 administrator rights Pass False for all boolean parameters to demote a user
func NewPromoteChatMemberCall ¶
func NewPromoteChatMemberCall(chatID PeerID, userID UserID) *PromoteChatMemberCall
NewPromoteChatMemberCall constructs a new PromoteChatMemberCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) userID - Unique identifier of the target user
func (*PromoteChatMemberCall) CanChangeInfo ¶
func (call *PromoteChatMemberCall) CanChangeInfo(canChangeInfo bool) *PromoteChatMemberCall
CanChangeInfo Pass True if the administrator can change chat title, photo and other settings
func (*PromoteChatMemberCall) CanDeleteMessages ¶
func (call *PromoteChatMemberCall) CanDeleteMessages(canDeleteMessages bool) *PromoteChatMemberCall
CanDeleteMessages Pass True if the administrator can delete messages of other users
func (*PromoteChatMemberCall) CanEditMessages ¶
func (call *PromoteChatMemberCall) CanEditMessages(canEditMessages bool) *PromoteChatMemberCall
CanEditMessages Pass True if the administrator can edit messages of other users and can pin messages, channels only
func (*PromoteChatMemberCall) CanInviteUsers ¶
func (call *PromoteChatMemberCall) CanInviteUsers(canInviteUsers bool) *PromoteChatMemberCall
CanInviteUsers Pass True if the administrator can invite new users to the chat
func (*PromoteChatMemberCall) CanManageChat ¶
func (call *PromoteChatMemberCall) CanManageChat(canManageChat bool) *PromoteChatMemberCall
CanManageChat Pass True if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
func (*PromoteChatMemberCall) CanManageTopics ¶ added in v0.6.0
func (call *PromoteChatMemberCall) CanManageTopics(canManageTopics bool) *PromoteChatMemberCall
CanManageTopics Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only
func (*PromoteChatMemberCall) CanManageVideoChats ¶
func (call *PromoteChatMemberCall) CanManageVideoChats(canManageVideoChats bool) *PromoteChatMemberCall
CanManageVideoChats Pass True if the administrator can manage video chats
func (*PromoteChatMemberCall) CanPinMessages ¶
func (call *PromoteChatMemberCall) CanPinMessages(canPinMessages bool) *PromoteChatMemberCall
CanPinMessages Pass True if the administrator can pin messages, supergroups only
func (*PromoteChatMemberCall) CanPostMessages ¶
func (call *PromoteChatMemberCall) CanPostMessages(canPostMessages bool) *PromoteChatMemberCall
CanPostMessages Pass True if the administrator can create channel posts, channels only
func (*PromoteChatMemberCall) CanPromoteMembers ¶
func (call *PromoteChatMemberCall) CanPromoteMembers(canPromoteMembers bool) *PromoteChatMemberCall
CanPromoteMembers Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by him)
func (*PromoteChatMemberCall) CanRestrictMembers ¶
func (call *PromoteChatMemberCall) CanRestrictMembers(canRestrictMembers bool) *PromoteChatMemberCall
CanRestrictMembers Pass True if the administrator can restrict, ban or unban chat members
func (*PromoteChatMemberCall) ChatID ¶ added in v0.0.5
func (call *PromoteChatMemberCall) ChatID(chatID PeerID) *PromoteChatMemberCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*PromoteChatMemberCall) IsAnonymous ¶
func (call *PromoteChatMemberCall) IsAnonymous(isAnonymous bool) *PromoteChatMemberCall
IsAnonymous Pass True if the administrator's presence in the chat is hidden
func (*PromoteChatMemberCall) UserID ¶ added in v0.0.5
func (call *PromoteChatMemberCall) UserID(userID UserID) *PromoteChatMemberCall
UserID Unique identifier of the target user
type ProximityAlertTriggered ¶
type ProximityAlertTriggered struct { // User that triggered the alert Traveler User `json:"traveler"` // User that set the alert Watcher User `json:"watcher"` // The distance between the users Distance int `json:"distance"` }
ProximityAlertTriggered this object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
type ReopenForumTopicCall ¶ added in v0.6.0
type ReopenForumTopicCall struct {
CallNoResult
}
ReopenForumTopicCall reprenesents a call to the reopenForumTopic method. Use this method to reopen a closed topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic
func NewReopenForumTopicCall ¶ added in v0.6.0
func NewReopenForumTopicCall(chatID PeerID, messageThreadID int) *ReopenForumTopicCall
NewReopenForumTopicCall constructs a new ReopenForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) messageThreadID - Unique identifier for the target message thread of the forum topic
func (*ReopenForumTopicCall) ChatID ¶ added in v0.6.0
func (call *ReopenForumTopicCall) ChatID(chatID PeerID) *ReopenForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*ReopenForumTopicCall) MessageThreadID ¶ added in v0.6.0
func (call *ReopenForumTopicCall) MessageThreadID(messageThreadID int) *ReopenForumTopicCall
MessageThreadID Unique identifier for the target message thread of the forum topic
type ReopenGeneralForumTopicCall ¶ added in v0.6.0
type ReopenGeneralForumTopicCall struct {
CallNoResult
}
ReopenGeneralForumTopicCall reprenesents a call to the reopenGeneralForumTopic method. Use this method to reopen a closed 'General' topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights The topic will be automatically unhidden if it was hidden
func NewReopenGeneralForumTopicCall ¶ added in v0.6.0
func NewReopenGeneralForumTopicCall(chatID PeerID) *ReopenGeneralForumTopicCall
NewReopenGeneralForumTopicCall constructs a new ReopenGeneralForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*ReopenGeneralForumTopicCall) ChatID ¶ added in v0.6.0
func (call *ReopenGeneralForumTopicCall) ChatID(chatID PeerID) *ReopenGeneralForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct { // Array of button rows, each represented by an Array of KeyboardButton objects Keyboard [][]KeyboardButton `json:"keyboard"` // Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. IsPersistent bool `json:"is_persistent,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. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters InputFieldPlaceholder string `json:"input_field_placeholder,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"` }
ReplyKeyboardMarkup this object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
func NewReplyKeyboardMarkup ¶ added in v0.0.2
func NewReplyKeyboardMarkup(rows ...[]KeyboardButton) *ReplyKeyboardMarkup
NewReplyKeyboardMarkup creates a new ReplyKeyboardMarkup.
func (*ReplyKeyboardMarkup) WithInputFieldPlaceholder ¶ added in v0.0.2
func (markup *ReplyKeyboardMarkup) WithInputFieldPlaceholder(placeholder string) *ReplyKeyboardMarkup
WithInputFieldPlaceholder sets the placeholder to be shown in the input field when the keyboard is active; 1-64 characters
func (*ReplyKeyboardMarkup) WithOneTimeKeyboardMarkup ¶ added in v0.0.2
func (markup *ReplyKeyboardMarkup) WithOneTimeKeyboardMarkup() *ReplyKeyboardMarkup
WithOneTimeKeyboard 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.
func (*ReplyKeyboardMarkup) WithResizeKeyboardMarkup ¶ added in v0.0.2
func (markup *ReplyKeyboardMarkup) WithResizeKeyboardMarkup() *ReplyKeyboardMarkup
WithResizeKeyboard 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.
func (*ReplyKeyboardMarkup) WithSelective ¶ added in v0.0.2
func (markup *ReplyKeyboardMarkup) WithSelective() *ReplyKeyboardMarkup
Use this parameter if you want to show the keyboard to specific users only.
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"` // 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"` }
ReplyKeyboardRemove upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).
func NewReplyKeyboardRemove ¶ added in v0.0.2
func NewReplyKeyboardRemove() *ReplyKeyboardRemove
NewReplyKeyboardRemove creates a new ReplyKeyboardRemove.
func (*ReplyKeyboardRemove) WithSelective ¶ added in v0.0.2
func (markup *ReplyKeyboardRemove) WithSelective() *ReplyKeyboardRemove
WithSelective set it if you want to remove the keyboard for specific users only.
type ReplyMarkup ¶
type ReplyMarkup interface {
// contains filtered or unexported methods
}
ReplyMarkup generic for keyboards.
Known implementations:
type Request ¶
type Request struct { Method string // contains filtered or unexported fields }
Request is Telegram Bot API request structure.
func NewRequest ¶
func (*Request) InputMedia ¶ added in v0.0.5
func (r *Request) InputMedia(im InputMedia) *Request
func (*Request) InputMediaSlice ¶ added in v0.0.5
func (r *Request) InputMediaSlice(name string, im []InputMedia) *Request
func (*Request) MarshalJSON ¶ added in v0.4.1
type Response ¶
type Response struct { // If equals true, the request was successful // and the result of the query can be found in the 'result' field Ok bool `json:"ok"` // A human-readable description of the result. // Empty if Ok is true. // Contains error message if Ok is false. Description string `json:"description"` // Optional. The result of the request Result json.RawMessage `json:"result"` // Optional. ErrorCode is the error code returned by Telegram Bot API. ErrorCode int `json:"error_code"` // Optional. Parameters *ResponseParameters `json:"parameters"` // HTTP response status code. StatusCode int `json:"-"` }
Response is Telegram Bot API response structure.
type ResponseParameters ¶
type ResponseParameters struct { // Optional. The group has been migrated to a supergroup with the specified 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 int `json:"retry_after,omitempty"` }
ResponseParameters describes why a request was unsuccessful.
type RestrictChatMemberCall ¶
type RestrictChatMemberCall struct {
CallNoResult
}
RestrictChatMemberCall reprenesents a call to the restrictChatMember method. 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 administrator rights Pass True for all permissions to lift restrictions from a user
func NewRestrictChatMemberCall ¶
func NewRestrictChatMemberCall(chatID PeerID, userID UserID, permissions ChatPermissions) *RestrictChatMemberCall
NewRestrictChatMemberCall constructs a new RestrictChatMemberCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) userID - Unique identifier of the target user permissions - A JSON-serialized object for new user permissions
func (*RestrictChatMemberCall) ChatID ¶ added in v0.0.5
func (call *RestrictChatMemberCall) ChatID(chatID PeerID) *RestrictChatMemberCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*RestrictChatMemberCall) Permissions ¶
func (call *RestrictChatMemberCall) Permissions(permissions ChatPermissions) *RestrictChatMemberCall
Permissions A JSON-serialized object for new user permissions
func (*RestrictChatMemberCall) UntilDate ¶
func (call *RestrictChatMemberCall) UntilDate(untilDate int) *RestrictChatMemberCall
UntilDate 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
func (*RestrictChatMemberCall) UseIndependentChatPermissions ¶ added in v0.6.0
func (call *RestrictChatMemberCall) UseIndependentChatPermissions(useIndependentChatPermissions bool) *RestrictChatMemberCall
UseIndependentChatPermissions Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
func (*RestrictChatMemberCall) UserID ¶ added in v0.0.5
func (call *RestrictChatMemberCall) UserID(userID UserID) *RestrictChatMemberCall
UserID Unique identifier of the target user
type RevokeChatInviteLinkCall ¶
type RevokeChatInviteLinkCall struct { Call[ChatInviteLink] }
RevokeChatInviteLinkCall reprenesents a call to the revokeChatInviteLink method. Use this method to revoke an invite link created by the bot If the primary link is revoked, a new link is automatically generated The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Returns the revoked invite link as ChatInviteLink object.
func NewRevokeChatInviteLinkCall ¶
func NewRevokeChatInviteLinkCall(chatID PeerID, inviteLink string) *RevokeChatInviteLinkCall
NewRevokeChatInviteLinkCall constructs a new RevokeChatInviteLinkCall with required parameters. chatID - Unique identifier of the target chat or username of the target channel (in the format @channelusername) inviteLink - The invite link to revoke
func (*RevokeChatInviteLinkCall) ChatID ¶ added in v0.0.5
func (call *RevokeChatInviteLinkCall) ChatID(chatID PeerID) *RevokeChatInviteLinkCall
ChatID Unique identifier of the target chat or username of the target channel (in the format @channelusername)
func (*RevokeChatInviteLinkCall) InviteLink ¶
func (call *RevokeChatInviteLinkCall) InviteLink(inviteLink string) *RevokeChatInviteLinkCall
InviteLink The invite link to revoke
type SendAnimationCall ¶
SendAnimationCall reprenesents a call to the sendAnimation method. Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound) On success, the sent Message is returned Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func NewSendAnimationCall ¶
func NewSendAnimationCall(chatID PeerID, animation FileArg) *SendAnimationCall
NewSendAnimationCall constructs a new SendAnimationCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) animation - Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »
func (*SendAnimationCall) AllowSendingWithoutReply ¶
func (call *SendAnimationCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendAnimationCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendAnimationCall) Animation ¶
func (call *SendAnimationCall) Animation(animation FileArg) *SendAnimationCall
Animation Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »
func (*SendAnimationCall) Caption ¶
func (call *SendAnimationCall) Caption(caption string) *SendAnimationCall
Caption Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
func (*SendAnimationCall) CaptionEntities ¶
func (call *SendAnimationCall) CaptionEntities(captionEntities []MessageEntity) *SendAnimationCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*SendAnimationCall) ChatID ¶ added in v0.0.5
func (call *SendAnimationCall) ChatID(chatID PeerID) *SendAnimationCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendAnimationCall) DisableNotification ¶
func (call *SendAnimationCall) DisableNotification(disableNotification bool) *SendAnimationCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendAnimationCall) Duration ¶
func (call *SendAnimationCall) Duration(duration int) *SendAnimationCall
Duration Duration of sent animation in seconds
func (*SendAnimationCall) HasSpoiler ¶ added in v0.6.0
func (call *SendAnimationCall) HasSpoiler(hasSpoiler bool) *SendAnimationCall
HasSpoiler Pass True if the animation needs to be covered with a spoiler animation
func (*SendAnimationCall) Height ¶
func (call *SendAnimationCall) Height(height int) *SendAnimationCall
Height Animation height
func (*SendAnimationCall) MessageThreadID ¶ added in v0.6.0
func (call *SendAnimationCall) MessageThreadID(messageThreadID int) *SendAnimationCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendAnimationCall) ParseMode ¶
func (call *SendAnimationCall) ParseMode(parseMode ParseMode) *SendAnimationCall
ParseMode Mode for parsing entities in the animation caption. See formatting options for more details.
func (*SendAnimationCall) ProtectContent ¶
func (call *SendAnimationCall) ProtectContent(protectContent bool) *SendAnimationCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendAnimationCall) ReplyMarkup ¶
func (call *SendAnimationCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendAnimationCall
ReplyMarkup 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.
func (*SendAnimationCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendAnimationCall) ReplyToMessageID(replyToMessageID int) *SendAnimationCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendAnimationCall) Thumbnail ¶ added in v0.8.0
func (call *SendAnimationCall) Thumbnail(thumbnail FileArg) *SendAnimationCall
Thumbnail 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 information on Sending Files »
func (*SendAnimationCall) Width ¶
func (call *SendAnimationCall) Width(width int) *SendAnimationCall
Width Animation width
type SendAudioCall ¶
SendAudioCall reprenesents a call to the sendAudio method. 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.
func NewSendAudioCall ¶
func NewSendAudioCall(chatID PeerID, audio FileArg) *SendAudioCall
NewSendAudioCall constructs a new SendAudioCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) audio - Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
func (*SendAudioCall) AllowSendingWithoutReply ¶
func (call *SendAudioCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendAudioCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendAudioCall) Audio ¶
func (call *SendAudioCall) Audio(audio FileArg) *SendAudioCall
Audio Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
func (*SendAudioCall) Caption ¶
func (call *SendAudioCall) Caption(caption string) *SendAudioCall
Caption Audio caption, 0-1024 characters after entities parsing
func (*SendAudioCall) CaptionEntities ¶
func (call *SendAudioCall) CaptionEntities(captionEntities []MessageEntity) *SendAudioCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*SendAudioCall) ChatID ¶ added in v0.0.5
func (call *SendAudioCall) ChatID(chatID PeerID) *SendAudioCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendAudioCall) DisableNotification ¶
func (call *SendAudioCall) DisableNotification(disableNotification bool) *SendAudioCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendAudioCall) Duration ¶
func (call *SendAudioCall) Duration(duration int) *SendAudioCall
Duration Duration of the audio in seconds
func (*SendAudioCall) MessageThreadID ¶ added in v0.6.0
func (call *SendAudioCall) MessageThreadID(messageThreadID int) *SendAudioCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendAudioCall) ParseMode ¶
func (call *SendAudioCall) ParseMode(parseMode ParseMode) *SendAudioCall
ParseMode Mode for parsing entities in the audio caption. See formatting options for more details.
func (*SendAudioCall) Performer ¶
func (call *SendAudioCall) Performer(performer string) *SendAudioCall
Performer Performer
func (*SendAudioCall) ProtectContent ¶
func (call *SendAudioCall) ProtectContent(protectContent bool) *SendAudioCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendAudioCall) ReplyMarkup ¶
func (call *SendAudioCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendAudioCall
ReplyMarkup 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.
func (*SendAudioCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendAudioCall) ReplyToMessageID(replyToMessageID int) *SendAudioCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendAudioCall) Thumbnail ¶ added in v0.8.0
func (call *SendAudioCall) Thumbnail(thumbnail FileArg) *SendAudioCall
Thumbnail 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 information on Sending Files »
func (*SendAudioCall) Title ¶
func (call *SendAudioCall) Title(title string) *SendAudioCall
Title Track name
type SendChatActionCall ¶
type SendChatActionCall struct {
CallNoResult
}
SendChatActionCall reprenesents a call to the sendChatAction method. 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) Example: The ImageBot needs some time to process a request and upload the image Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo The user will see a “sending photo” status for the bot. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
func NewSendChatActionCall ¶
func NewSendChatActionCall(chatID PeerID, action ChatAction) *SendChatActionCall
NewSendChatActionCall constructs a new SendChatActionCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) action - Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
func (*SendChatActionCall) Action ¶
func (call *SendChatActionCall) Action(action ChatAction) *SendChatActionCall
Action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
func (*SendChatActionCall) ChatID ¶ added in v0.0.5
func (call *SendChatActionCall) ChatID(chatID PeerID) *SendChatActionCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendChatActionCall) MessageThreadID ¶ added in v0.6.0
func (call *SendChatActionCall) MessageThreadID(messageThreadID int) *SendChatActionCall
MessageThreadID Unique identifier for the target message thread; supergroups only
type SendContactCall ¶
SendContactCall reprenesents a call to the sendContact method. Use this method to send phone contacts On success, the sent Message is returned.
func NewSendContactCall ¶
func NewSendContactCall(chatID PeerID, phoneNumber string, firstName string) *SendContactCall
NewSendContactCall constructs a new SendContactCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) phoneNumber - Contact's phone number firstName - Contact's first name
func (*SendContactCall) AllowSendingWithoutReply ¶
func (call *SendContactCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendContactCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendContactCall) ChatID ¶ added in v0.0.5
func (call *SendContactCall) ChatID(chatID PeerID) *SendContactCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendContactCall) DisableNotification ¶
func (call *SendContactCall) DisableNotification(disableNotification bool) *SendContactCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendContactCall) FirstName ¶
func (call *SendContactCall) FirstName(firstName string) *SendContactCall
FirstName Contact's first name
func (*SendContactCall) LastName ¶
func (call *SendContactCall) LastName(lastName string) *SendContactCall
LastName Contact's last name
func (*SendContactCall) MessageThreadID ¶ added in v0.6.0
func (call *SendContactCall) MessageThreadID(messageThreadID int) *SendContactCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendContactCall) PhoneNumber ¶
func (call *SendContactCall) PhoneNumber(phoneNumber string) *SendContactCall
PhoneNumber Contact's phone number
func (*SendContactCall) ProtectContent ¶
func (call *SendContactCall) ProtectContent(protectContent bool) *SendContactCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendContactCall) ReplyMarkup ¶
func (call *SendContactCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendContactCall
ReplyMarkup 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.
func (*SendContactCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendContactCall) ReplyToMessageID(replyToMessageID int) *SendContactCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendContactCall) Vcard ¶
func (call *SendContactCall) Vcard(vcard string) *SendContactCall
Vcard Additional data about the contact in the form of a vCard, 0-2048 bytes
type SendDiceCall ¶
SendDiceCall reprenesents a call to the sendDice method. Use this method to send an animated emoji that will display a random value On success, the sent Message is returned.
func NewSendDiceCall ¶
func NewSendDiceCall(chatID PeerID) *SendDiceCall
NewSendDiceCall constructs a new SendDiceCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendDiceCall) AllowSendingWithoutReply ¶
func (call *SendDiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendDiceCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendDiceCall) ChatID ¶ added in v0.0.5
func (call *SendDiceCall) ChatID(chatID PeerID) *SendDiceCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendDiceCall) DisableNotification ¶
func (call *SendDiceCall) DisableNotification(disableNotification bool) *SendDiceCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendDiceCall) Emoji ¶
func (call *SendDiceCall) Emoji(emoji string) *SendDiceCall
Emoji 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 “”
func (*SendDiceCall) MessageThreadID ¶ added in v0.6.0
func (call *SendDiceCall) MessageThreadID(messageThreadID int) *SendDiceCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendDiceCall) ProtectContent ¶
func (call *SendDiceCall) ProtectContent(protectContent bool) *SendDiceCall
ProtectContent Protects the contents of the sent message from forwarding
func (*SendDiceCall) ReplyMarkup ¶
func (call *SendDiceCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendDiceCall
ReplyMarkup 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.
func (*SendDiceCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendDiceCall) ReplyToMessageID(replyToMessageID int) *SendDiceCall
ReplyToMessageID If the message is a reply, ID of the original message
type SendDocumentCall ¶
SendDocumentCall reprenesents a call to the sendDocument method. Use this method to send general files On success, the sent Message is returned Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func NewSendDocumentCall ¶
func NewSendDocumentCall(chatID PeerID, document FileArg) *SendDocumentCall
NewSendDocumentCall constructs a new SendDocumentCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) document - File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
func (*SendDocumentCall) AllowSendingWithoutReply ¶
func (call *SendDocumentCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendDocumentCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendDocumentCall) Caption ¶
func (call *SendDocumentCall) Caption(caption string) *SendDocumentCall
Caption Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
func (*SendDocumentCall) CaptionEntities ¶
func (call *SendDocumentCall) CaptionEntities(captionEntities []MessageEntity) *SendDocumentCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*SendDocumentCall) ChatID ¶ added in v0.0.5
func (call *SendDocumentCall) ChatID(chatID PeerID) *SendDocumentCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendDocumentCall) DisableContentTypeDetection ¶
func (call *SendDocumentCall) DisableContentTypeDetection(disableContentTypeDetection bool) *SendDocumentCall
DisableContentTypeDetection Disables automatic server-side content type detection for files uploaded using multipart/form-data
func (*SendDocumentCall) DisableNotification ¶
func (call *SendDocumentCall) DisableNotification(disableNotification bool) *SendDocumentCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendDocumentCall) Document ¶
func (call *SendDocumentCall) Document(document FileArg) *SendDocumentCall
Document File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
func (*SendDocumentCall) MessageThreadID ¶ added in v0.6.0
func (call *SendDocumentCall) MessageThreadID(messageThreadID int) *SendDocumentCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendDocumentCall) ParseMode ¶
func (call *SendDocumentCall) ParseMode(parseMode ParseMode) *SendDocumentCall
ParseMode Mode for parsing entities in the document caption. See formatting options for more details.
func (*SendDocumentCall) ProtectContent ¶
func (call *SendDocumentCall) ProtectContent(protectContent bool) *SendDocumentCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendDocumentCall) ReplyMarkup ¶
func (call *SendDocumentCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendDocumentCall
ReplyMarkup 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.
func (*SendDocumentCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendDocumentCall) ReplyToMessageID(replyToMessageID int) *SendDocumentCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendDocumentCall) Thumbnail ¶ added in v0.8.0
func (call *SendDocumentCall) Thumbnail(thumbnail FileArg) *SendDocumentCall
Thumbnail 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 information on Sending Files »
type SendGameCall ¶
SendGameCall reprenesents a call to the sendGame method. Use this method to send a game On success, the sent Message is returned.
func NewSendGameCall ¶
func NewSendGameCall(chatID ChatID, gameShortName string) *SendGameCall
NewSendGameCall constructs a new SendGameCall with required parameters. chatID - Unique identifier for the target chat gameShortName - Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.
func (*SendGameCall) AllowSendingWithoutReply ¶
func (call *SendGameCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendGameCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendGameCall) ChatID ¶ added in v0.0.5
func (call *SendGameCall) ChatID(chatID ChatID) *SendGameCall
ChatID Unique identifier for the target chat
func (*SendGameCall) DisableNotification ¶
func (call *SendGameCall) DisableNotification(disableNotification bool) *SendGameCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendGameCall) GameShortName ¶
func (call *SendGameCall) GameShortName(gameShortName string) *SendGameCall
GameShortName Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.
func (*SendGameCall) MessageThreadID ¶ added in v0.6.0
func (call *SendGameCall) MessageThreadID(messageThreadID int) *SendGameCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendGameCall) ProtectContent ¶
func (call *SendGameCall) ProtectContent(protectContent bool) *SendGameCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendGameCall) ReplyMarkup ¶
func (call *SendGameCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *SendGameCall
ReplyMarkup 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.
func (*SendGameCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendGameCall) ReplyToMessageID(replyToMessageID int) *SendGameCall
ReplyToMessageID If the message is a reply, ID of the original message
type SendInvoiceCall ¶
SendInvoiceCall reprenesents a call to the sendInvoice method. Use this method to send invoices On success, the sent Message is returned.
func NewSendInvoiceCall ¶
func NewSendInvoiceCall(chatID PeerID, title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *SendInvoiceCall
NewSendInvoiceCall constructs a new SendInvoiceCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) title - Product name, 1-32 characters description - Product description, 1-255 characters payload - Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. providerToken - Payment provider token, obtained via @BotFather currency - Three-letter ISO 4217 currency code, see more on currencies prices - Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
func (*SendInvoiceCall) AllowSendingWithoutReply ¶
func (call *SendInvoiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendInvoiceCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendInvoiceCall) ChatID ¶ added in v0.0.5
func (call *SendInvoiceCall) ChatID(chatID PeerID) *SendInvoiceCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendInvoiceCall) Currency ¶
func (call *SendInvoiceCall) Currency(currency string) *SendInvoiceCall
Currency Three-letter ISO 4217 currency code, see more on currencies
func (*SendInvoiceCall) Description ¶
func (call *SendInvoiceCall) Description(description string) *SendInvoiceCall
Description Product description, 1-255 characters
func (*SendInvoiceCall) DisableNotification ¶
func (call *SendInvoiceCall) DisableNotification(disableNotification bool) *SendInvoiceCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendInvoiceCall) IsFlexible ¶
func (call *SendInvoiceCall) IsFlexible(isFlexible bool) *SendInvoiceCall
IsFlexible Pass True if the final price depends on the shipping method
func (*SendInvoiceCall) MaxTipAmount ¶
func (call *SendInvoiceCall) MaxTipAmount(maxTipAmount int) *SendInvoiceCall
MaxTipAmount The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0
func (*SendInvoiceCall) MessageThreadID ¶ added in v0.6.0
func (call *SendInvoiceCall) MessageThreadID(messageThreadID int) *SendInvoiceCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendInvoiceCall) NeedEmail ¶
func (call *SendInvoiceCall) NeedEmail(needEmail bool) *SendInvoiceCall
NeedEmail Pass True if you require the user's email address to complete the order
func (*SendInvoiceCall) NeedName ¶
func (call *SendInvoiceCall) NeedName(needName bool) *SendInvoiceCall
NeedName Pass True if you require the user's full name to complete the order
func (*SendInvoiceCall) NeedPhoneNumber ¶
func (call *SendInvoiceCall) NeedPhoneNumber(needPhoneNumber bool) *SendInvoiceCall
NeedPhoneNumber Pass True if you require the user's phone number to complete the order
func (*SendInvoiceCall) NeedShippingAddress ¶
func (call *SendInvoiceCall) NeedShippingAddress(needShippingAddress bool) *SendInvoiceCall
NeedShippingAddress Pass True if you require the user's shipping address to complete the order
func (*SendInvoiceCall) Payload ¶
func (call *SendInvoiceCall) Payload(payload string) *SendInvoiceCall
Payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
func (*SendInvoiceCall) PhotoHeight ¶
func (call *SendInvoiceCall) PhotoHeight(photoHeight int) *SendInvoiceCall
PhotoHeight Photo height
func (*SendInvoiceCall) PhotoSize ¶
func (call *SendInvoiceCall) PhotoSize(photoSize int) *SendInvoiceCall
PhotoSize Photo size in bytes
func (*SendInvoiceCall) PhotoURL ¶ added in v0.0.5
func (call *SendInvoiceCall) PhotoURL(photoURL string) *SendInvoiceCall
PhotoURL 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.
func (*SendInvoiceCall) PhotoWidth ¶
func (call *SendInvoiceCall) PhotoWidth(photoWidth int) *SendInvoiceCall
PhotoWidth Photo width
func (*SendInvoiceCall) Prices ¶
func (call *SendInvoiceCall) Prices(prices []LabeledPrice) *SendInvoiceCall
Prices Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
func (*SendInvoiceCall) ProtectContent ¶
func (call *SendInvoiceCall) ProtectContent(protectContent bool) *SendInvoiceCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendInvoiceCall) ProviderData ¶
func (call *SendInvoiceCall) ProviderData(providerData string) *SendInvoiceCall
ProviderData 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.
func (*SendInvoiceCall) ProviderToken ¶
func (call *SendInvoiceCall) ProviderToken(providerToken string) *SendInvoiceCall
ProviderToken Payment provider token, obtained via @BotFather
func (*SendInvoiceCall) ReplyMarkup ¶
func (call *SendInvoiceCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *SendInvoiceCall
ReplyMarkup 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.
func (*SendInvoiceCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendInvoiceCall) ReplyToMessageID(replyToMessageID int) *SendInvoiceCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendInvoiceCall) SendEmailToProvider ¶
func (call *SendInvoiceCall) SendEmailToProvider(sendEmailToProvider bool) *SendInvoiceCall
SendEmailToProvider Pass True if the user's email address should be sent to provider
func (*SendInvoiceCall) SendPhoneNumberToProvider ¶
func (call *SendInvoiceCall) SendPhoneNumberToProvider(sendPhoneNumberToProvider bool) *SendInvoiceCall
SendPhoneNumberToProvider Pass True if the user's phone number should be sent to provider
func (*SendInvoiceCall) StartParameter ¶
func (call *SendInvoiceCall) StartParameter(startParameter string) *SendInvoiceCall
StartParameter Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
func (*SendInvoiceCall) SuggestedTipAmounts ¶
func (call *SendInvoiceCall) SuggestedTipAmounts(suggestedTipAmounts []int) *SendInvoiceCall
SuggestedTipAmounts A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
func (*SendInvoiceCall) Title ¶
func (call *SendInvoiceCall) Title(title string) *SendInvoiceCall
Title Product name, 1-32 characters
type SendLocationCall ¶
SendLocationCall reprenesents a call to the sendLocation method. Use this method to send point on the map On success, the sent Message is returned.
func NewSendLocationCall ¶
func NewSendLocationCall(chatID PeerID, latitude float64, longitude float64) *SendLocationCall
NewSendLocationCall constructs a new SendLocationCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) latitude - Latitude of the location longitude - Longitude of the location
func (*SendLocationCall) AllowSendingWithoutReply ¶
func (call *SendLocationCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendLocationCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendLocationCall) ChatID ¶ added in v0.0.5
func (call *SendLocationCall) ChatID(chatID PeerID) *SendLocationCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendLocationCall) DisableNotification ¶
func (call *SendLocationCall) DisableNotification(disableNotification bool) *SendLocationCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendLocationCall) Heading ¶
func (call *SendLocationCall) Heading(heading int) *SendLocationCall
Heading For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
func (*SendLocationCall) HorizontalAccuracy ¶
func (call *SendLocationCall) HorizontalAccuracy(horizontalAccuracy float64) *SendLocationCall
HorizontalAccuracy The radius of uncertainty for the location, measured in meters; 0-1500
func (*SendLocationCall) Latitude ¶
func (call *SendLocationCall) Latitude(latitude float64) *SendLocationCall
Latitude Latitude of the location
func (*SendLocationCall) LivePeriod ¶
func (call *SendLocationCall) LivePeriod(livePeriod int) *SendLocationCall
LivePeriod Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
func (*SendLocationCall) Longitude ¶
func (call *SendLocationCall) Longitude(longitude float64) *SendLocationCall
Longitude Longitude of the location
func (*SendLocationCall) MessageThreadID ¶ added in v0.6.0
func (call *SendLocationCall) MessageThreadID(messageThreadID int) *SendLocationCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendLocationCall) ProtectContent ¶
func (call *SendLocationCall) ProtectContent(protectContent bool) *SendLocationCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendLocationCall) ProximityAlertRadius ¶
func (call *SendLocationCall) ProximityAlertRadius(proximityAlertRadius int) *SendLocationCall
ProximityAlertRadius For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
func (*SendLocationCall) ReplyMarkup ¶
func (call *SendLocationCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendLocationCall
ReplyMarkup 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.
func (*SendLocationCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendLocationCall) ReplyToMessageID(replyToMessageID int) *SendLocationCall
ReplyToMessageID If the message is a reply, ID of the original message
type SendMediaGroupCall ¶ added in v0.0.5
SendMediaGroupCall reprenesents a call to the sendMediaGroup method. 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.
func NewSendMediaGroupCall ¶ added in v0.0.5
func NewSendMediaGroupCall(chatID PeerID, media []InputMedia) *SendMediaGroupCall
NewSendMediaGroupCall constructs a new SendMediaGroupCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) media - A JSON-serialized array describing messages to be sent, must include 2-10 items
func (*SendMediaGroupCall) AllowSendingWithoutReply ¶ added in v0.0.5
func (call *SendMediaGroupCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendMediaGroupCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendMediaGroupCall) ChatID ¶ added in v0.0.5
func (call *SendMediaGroupCall) ChatID(chatID PeerID) *SendMediaGroupCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendMediaGroupCall) DisableNotification ¶ added in v0.0.5
func (call *SendMediaGroupCall) DisableNotification(disableNotification bool) *SendMediaGroupCall
DisableNotification Sends messages silently. Users will receive a notification with no sound.
func (*SendMediaGroupCall) Media ¶ added in v0.0.5
func (call *SendMediaGroupCall) Media(media []InputMedia) *SendMediaGroupCall
Media A JSON-serialized array describing messages to be sent, must include 2-10 items
func (*SendMediaGroupCall) MessageThreadID ¶ added in v0.6.0
func (call *SendMediaGroupCall) MessageThreadID(messageThreadID int) *SendMediaGroupCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendMediaGroupCall) ProtectContent ¶ added in v0.0.5
func (call *SendMediaGroupCall) ProtectContent(protectContent bool) *SendMediaGroupCall
ProtectContent Protects the contents of the sent messages from forwarding and saving
func (*SendMediaGroupCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendMediaGroupCall) ReplyToMessageID(replyToMessageID int) *SendMediaGroupCall
ReplyToMessageID If the messages are a reply, ID of the original message
type SendMessageCall ¶
SendMessageCall reprenesents a call to the sendMessage method. Use this method to send text messages On success, the sent Message is returned.
func NewSendMessageCall ¶
func NewSendMessageCall(chatID PeerID, text string) *SendMessageCall
NewSendMessageCall constructs a new SendMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) text - Text of the message to be sent, 1-4096 characters after entities parsing
func (*SendMessageCall) AllowSendingWithoutReply ¶
func (call *SendMessageCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendMessageCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendMessageCall) ChatID ¶ added in v0.0.5
func (call *SendMessageCall) ChatID(chatID PeerID) *SendMessageCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendMessageCall) DisableNotification ¶
func (call *SendMessageCall) DisableNotification(disableNotification bool) *SendMessageCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendMessageCall) DisableWebPagePreview ¶
func (call *SendMessageCall) DisableWebPagePreview(disableWebPagePreview bool) *SendMessageCall
DisableWebPagePreview Disables link previews for links in this message
func (*SendMessageCall) Entities ¶
func (call *SendMessageCall) Entities(entities []MessageEntity) *SendMessageCall
Entities A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
func (*SendMessageCall) MessageThreadID ¶ added in v0.6.0
func (call *SendMessageCall) MessageThreadID(messageThreadID int) *SendMessageCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendMessageCall) ParseMode ¶
func (call *SendMessageCall) ParseMode(parseMode ParseMode) *SendMessageCall
ParseMode Mode for parsing entities in the message text. See formatting options for more details.
func (*SendMessageCall) ProtectContent ¶
func (call *SendMessageCall) ProtectContent(protectContent bool) *SendMessageCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendMessageCall) ReplyMarkup ¶
func (call *SendMessageCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendMessageCall
ReplyMarkup 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.
func (*SendMessageCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendMessageCall) ReplyToMessageID(replyToMessageID int) *SendMessageCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendMessageCall) Text ¶
func (call *SendMessageCall) Text(text string) *SendMessageCall
Text Text of the message to be sent, 1-4096 characters after entities parsing
type SendPhotoCall ¶
SendPhotoCall reprenesents a call to the sendPhoto method. Use this method to send photos On success, the sent Message is returned.
func NewSendPhotoCall ¶
func NewSendPhotoCall(chatID PeerID, photo FileArg) *SendPhotoCall
NewSendPhotoCall constructs a new SendPhotoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) photo - Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »
func (*SendPhotoCall) AllowSendingWithoutReply ¶
func (call *SendPhotoCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendPhotoCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendPhotoCall) Caption ¶
func (call *SendPhotoCall) Caption(caption string) *SendPhotoCall
Caption Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
func (*SendPhotoCall) CaptionEntities ¶
func (call *SendPhotoCall) CaptionEntities(captionEntities []MessageEntity) *SendPhotoCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*SendPhotoCall) ChatID ¶ added in v0.0.5
func (call *SendPhotoCall) ChatID(chatID PeerID) *SendPhotoCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendPhotoCall) DisableNotification ¶
func (call *SendPhotoCall) DisableNotification(disableNotification bool) *SendPhotoCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendPhotoCall) HasSpoiler ¶ added in v0.6.0
func (call *SendPhotoCall) HasSpoiler(hasSpoiler bool) *SendPhotoCall
HasSpoiler Pass True if the photo needs to be covered with a spoiler animation
func (*SendPhotoCall) MessageThreadID ¶ added in v0.6.0
func (call *SendPhotoCall) MessageThreadID(messageThreadID int) *SendPhotoCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendPhotoCall) ParseMode ¶
func (call *SendPhotoCall) ParseMode(parseMode ParseMode) *SendPhotoCall
ParseMode Mode for parsing entities in the photo caption. See formatting options for more details.
func (*SendPhotoCall) Photo ¶
func (call *SendPhotoCall) Photo(photo FileArg) *SendPhotoCall
Photo Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »
func (*SendPhotoCall) ProtectContent ¶
func (call *SendPhotoCall) ProtectContent(protectContent bool) *SendPhotoCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendPhotoCall) ReplyMarkup ¶
func (call *SendPhotoCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendPhotoCall
ReplyMarkup 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.
func (*SendPhotoCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendPhotoCall) ReplyToMessageID(replyToMessageID int) *SendPhotoCall
ReplyToMessageID If the message is a reply, ID of the original message
type SendPollCall ¶
SendPollCall reprenesents a call to the sendPoll method. Use this method to send a native poll On success, the sent Message is returned.
func NewSendPollCall ¶
func NewSendPollCall(chatID PeerID, question string, options []string) *SendPollCall
NewSendPollCall constructs a new SendPollCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) question - Poll question, 1-300 characters options - A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
func (*SendPollCall) AllowSendingWithoutReply ¶
func (call *SendPollCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendPollCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendPollCall) AllowsMultipleAnswers ¶
func (call *SendPollCall) AllowsMultipleAnswers(allowsMultipleAnswers bool) *SendPollCall
AllowsMultipleAnswers True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
func (*SendPollCall) ChatID ¶ added in v0.0.5
func (call *SendPollCall) ChatID(chatID PeerID) *SendPollCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendPollCall) CloseDate ¶
func (call *SendPollCall) CloseDate(closeDate int) *SendPollCall
CloseDate 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.
func (*SendPollCall) CorrectOptionID ¶ added in v0.0.5
func (call *SendPollCall) CorrectOptionID(correctOptionID int) *SendPollCall
CorrectOptionID 0-based identifier of the correct answer option, required for polls in quiz mode
func (*SendPollCall) DisableNotification ¶
func (call *SendPollCall) DisableNotification(disableNotification bool) *SendPollCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendPollCall) Explanation ¶
func (call *SendPollCall) Explanation(explanation string) *SendPollCall
Explanation 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
func (*SendPollCall) ExplanationEntities ¶
func (call *SendPollCall) ExplanationEntities(explanationEntities []MessageEntity) *SendPollCall
ExplanationEntities A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode
func (*SendPollCall) ExplanationParseMode ¶
func (call *SendPollCall) ExplanationParseMode(explanationParseMode string) *SendPollCall
ExplanationParseMode Mode for parsing entities in the explanation. See formatting options for more details.
func (*SendPollCall) IsAnonymous ¶
func (call *SendPollCall) IsAnonymous(isAnonymous bool) *SendPollCall
IsAnonymous True, if the poll needs to be anonymous, defaults to True
func (*SendPollCall) IsClosed ¶
func (call *SendPollCall) IsClosed(isClosed bool) *SendPollCall
IsClosed Pass True if the poll needs to be immediately closed. This can be useful for poll preview.
func (*SendPollCall) MessageThreadID ¶ added in v0.6.0
func (call *SendPollCall) MessageThreadID(messageThreadID int) *SendPollCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendPollCall) OpenPeriod ¶
func (call *SendPollCall) OpenPeriod(openPeriod int) *SendPollCall
OpenPeriod Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
func (*SendPollCall) Options ¶
func (call *SendPollCall) Options(options []string) *SendPollCall
Options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
func (*SendPollCall) ProtectContent ¶
func (call *SendPollCall) ProtectContent(protectContent bool) *SendPollCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendPollCall) Question ¶
func (call *SendPollCall) Question(question string) *SendPollCall
Question Poll question, 1-300 characters
func (*SendPollCall) ReplyMarkup ¶
func (call *SendPollCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendPollCall
ReplyMarkup 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.
func (*SendPollCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendPollCall) ReplyToMessageID(replyToMessageID int) *SendPollCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendPollCall) Type ¶
func (call *SendPollCall) Type(typ string) *SendPollCall
Type Poll type, “quiz” or “regular”, defaults to “regular”
type SendStickerCall ¶
SendStickerCall reprenesents a call to the sendSticker method. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers On success, the sent Message is returned.
func NewSendStickerCall ¶
func NewSendStickerCall(chatID PeerID, sticker FileArg) *SendStickerCall
NewSendStickerCall constructs a new SendStickerCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) sticker - Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files ». Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.
func (*SendStickerCall) AllowSendingWithoutReply ¶
func (call *SendStickerCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendStickerCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendStickerCall) ChatID ¶ added in v0.0.5
func (call *SendStickerCall) ChatID(chatID PeerID) *SendStickerCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendStickerCall) DisableNotification ¶
func (call *SendStickerCall) DisableNotification(disableNotification bool) *SendStickerCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendStickerCall) Emoji ¶ added in v0.8.0
func (call *SendStickerCall) Emoji(emoji string) *SendStickerCall
Emoji Emoji associated with the sticker; only for just uploaded stickers
func (*SendStickerCall) MessageThreadID ¶ added in v0.6.0
func (call *SendStickerCall) MessageThreadID(messageThreadID int) *SendStickerCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendStickerCall) ProtectContent ¶
func (call *SendStickerCall) ProtectContent(protectContent bool) *SendStickerCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendStickerCall) ReplyMarkup ¶
func (call *SendStickerCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendStickerCall
ReplyMarkup 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.
func (*SendStickerCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendStickerCall) ReplyToMessageID(replyToMessageID int) *SendStickerCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendStickerCall) Sticker ¶
func (call *SendStickerCall) Sticker(sticker FileArg) *SendStickerCall
Sticker Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. More information on Sending Files ». Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL.
type SendVenueCall ¶
SendVenueCall reprenesents a call to the sendVenue method. Use this method to send information about a venue On success, the sent Message is returned.
func NewSendVenueCall ¶
func NewSendVenueCall(chatID PeerID, latitude float64, longitude float64, title string, address string) *SendVenueCall
NewSendVenueCall constructs a new SendVenueCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) latitude - Latitude of the venue longitude - Longitude of the venue title - Name of the venue address - Address of the venue
func (*SendVenueCall) Address ¶
func (call *SendVenueCall) Address(address string) *SendVenueCall
Address Address of the venue
func (*SendVenueCall) AllowSendingWithoutReply ¶
func (call *SendVenueCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVenueCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendVenueCall) ChatID ¶ added in v0.0.5
func (call *SendVenueCall) ChatID(chatID PeerID) *SendVenueCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendVenueCall) DisableNotification ¶
func (call *SendVenueCall) DisableNotification(disableNotification bool) *SendVenueCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendVenueCall) FoursquareID ¶ added in v0.0.5
func (call *SendVenueCall) FoursquareID(foursquareID string) *SendVenueCall
FoursquareID Foursquare identifier of the venue
func (*SendVenueCall) FoursquareType ¶
func (call *SendVenueCall) FoursquareType(foursquareType string) *SendVenueCall
FoursquareType Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
func (*SendVenueCall) GooglePlaceID ¶ added in v0.0.5
func (call *SendVenueCall) GooglePlaceID(googlePlaceID string) *SendVenueCall
GooglePlaceID Google Places identifier of the venue
func (*SendVenueCall) GooglePlaceType ¶
func (call *SendVenueCall) GooglePlaceType(googlePlaceType string) *SendVenueCall
GooglePlaceType Google Places type of the venue. (See supported types.)
func (*SendVenueCall) Latitude ¶
func (call *SendVenueCall) Latitude(latitude float64) *SendVenueCall
Latitude Latitude of the venue
func (*SendVenueCall) Longitude ¶
func (call *SendVenueCall) Longitude(longitude float64) *SendVenueCall
Longitude Longitude of the venue
func (*SendVenueCall) MessageThreadID ¶ added in v0.6.0
func (call *SendVenueCall) MessageThreadID(messageThreadID int) *SendVenueCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendVenueCall) ProtectContent ¶
func (call *SendVenueCall) ProtectContent(protectContent bool) *SendVenueCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendVenueCall) ReplyMarkup ¶
func (call *SendVenueCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVenueCall
ReplyMarkup 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.
func (*SendVenueCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendVenueCall) ReplyToMessageID(replyToMessageID int) *SendVenueCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendVenueCall) Title ¶
func (call *SendVenueCall) Title(title string) *SendVenueCall
Title Name of the venue
type SendVideoCall ¶
SendVideoCall reprenesents a call to the sendVideo method. Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document) On success, the sent Message is returned Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
func NewSendVideoCall ¶
func NewSendVideoCall(chatID PeerID, video FileArg) *SendVideoCall
NewSendVideoCall constructs a new SendVideoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) video - Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »
func (*SendVideoCall) AllowSendingWithoutReply ¶
func (call *SendVideoCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVideoCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendVideoCall) Caption ¶
func (call *SendVideoCall) Caption(caption string) *SendVideoCall
Caption Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
func (*SendVideoCall) CaptionEntities ¶
func (call *SendVideoCall) CaptionEntities(captionEntities []MessageEntity) *SendVideoCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*SendVideoCall) ChatID ¶ added in v0.0.5
func (call *SendVideoCall) ChatID(chatID PeerID) *SendVideoCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendVideoCall) DisableNotification ¶
func (call *SendVideoCall) DisableNotification(disableNotification bool) *SendVideoCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendVideoCall) Duration ¶
func (call *SendVideoCall) Duration(duration int) *SendVideoCall
Duration Duration of sent video in seconds
func (*SendVideoCall) HasSpoiler ¶ added in v0.6.0
func (call *SendVideoCall) HasSpoiler(hasSpoiler bool) *SendVideoCall
HasSpoiler Pass True if the video needs to be covered with a spoiler animation
func (*SendVideoCall) Height ¶
func (call *SendVideoCall) Height(height int) *SendVideoCall
Height Video height
func (*SendVideoCall) MessageThreadID ¶ added in v0.6.0
func (call *SendVideoCall) MessageThreadID(messageThreadID int) *SendVideoCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendVideoCall) ParseMode ¶
func (call *SendVideoCall) ParseMode(parseMode ParseMode) *SendVideoCall
ParseMode Mode for parsing entities in the video caption. See formatting options for more details.
func (*SendVideoCall) ProtectContent ¶
func (call *SendVideoCall) ProtectContent(protectContent bool) *SendVideoCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendVideoCall) ReplyMarkup ¶
func (call *SendVideoCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVideoCall
ReplyMarkup 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.
func (*SendVideoCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendVideoCall) ReplyToMessageID(replyToMessageID int) *SendVideoCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendVideoCall) SupportsStreaming ¶
func (call *SendVideoCall) SupportsStreaming(supportsStreaming bool) *SendVideoCall
SupportsStreaming Pass True if the uploaded video is suitable for streaming
func (*SendVideoCall) Thumbnail ¶ added in v0.8.0
func (call *SendVideoCall) Thumbnail(thumbnail FileArg) *SendVideoCall
Thumbnail 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 information on Sending Files »
func (*SendVideoCall) Video ¶
func (call *SendVideoCall) Video(video FileArg) *SendVideoCall
Video Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »
func (*SendVideoCall) Width ¶
func (call *SendVideoCall) Width(width int) *SendVideoCall
Width Video width
type SendVideoNoteCall ¶
SendVideoNoteCall reprenesents a call to the sendVideoNote method. As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long Use this method to send video messages On success, the sent Message is returned.
func NewSendVideoNoteCall ¶
func NewSendVideoNoteCall(chatID PeerID, videoNote FileArg) *SendVideoNoteCall
NewSendVideoNoteCall constructs a new SendVideoNoteCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) videoNote - 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 information on Sending Files ». Sending video notes by a URL is currently unsupported
func (*SendVideoNoteCall) AllowSendingWithoutReply ¶
func (call *SendVideoNoteCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVideoNoteCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendVideoNoteCall) ChatID ¶ added in v0.0.5
func (call *SendVideoNoteCall) ChatID(chatID PeerID) *SendVideoNoteCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendVideoNoteCall) DisableNotification ¶
func (call *SendVideoNoteCall) DisableNotification(disableNotification bool) *SendVideoNoteCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendVideoNoteCall) Duration ¶
func (call *SendVideoNoteCall) Duration(duration int) *SendVideoNoteCall
Duration Duration of sent video in seconds
func (*SendVideoNoteCall) Length ¶
func (call *SendVideoNoteCall) Length(length int) *SendVideoNoteCall
Length Video width and height, i.e. diameter of the video message
func (*SendVideoNoteCall) MessageThreadID ¶ added in v0.6.0
func (call *SendVideoNoteCall) MessageThreadID(messageThreadID int) *SendVideoNoteCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendVideoNoteCall) ProtectContent ¶
func (call *SendVideoNoteCall) ProtectContent(protectContent bool) *SendVideoNoteCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendVideoNoteCall) ReplyMarkup ¶
func (call *SendVideoNoteCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVideoNoteCall
ReplyMarkup 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.
func (*SendVideoNoteCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendVideoNoteCall) ReplyToMessageID(replyToMessageID int) *SendVideoNoteCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendVideoNoteCall) Thumbnail ¶ added in v0.8.0
func (call *SendVideoNoteCall) Thumbnail(thumbnail FileArg) *SendVideoNoteCall
Thumbnail 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 information on Sending Files »
func (*SendVideoNoteCall) VideoNote ¶
func (call *SendVideoNoteCall) VideoNote(videoNote FileArg) *SendVideoNoteCall
VideoNote 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 information on Sending Files ». Sending video notes by a URL is currently unsupported
type SendVoiceCall ¶
SendVoiceCall reprenesents a call to the sendVoice method. Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document) On success, the sent Message is returned Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func NewSendVoiceCall ¶
func NewSendVoiceCall(chatID PeerID, voice FileArg) *SendVoiceCall
NewSendVoiceCall constructs a new SendVoiceCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) voice - Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
func (*SendVoiceCall) AllowSendingWithoutReply ¶
func (call *SendVoiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVoiceCall
AllowSendingWithoutReply Pass True if the message should be sent even if the specified replied-to message is not found
func (*SendVoiceCall) Caption ¶
func (call *SendVoiceCall) Caption(caption string) *SendVoiceCall
Caption Voice message caption, 0-1024 characters after entities parsing
func (*SendVoiceCall) CaptionEntities ¶
func (call *SendVoiceCall) CaptionEntities(captionEntities []MessageEntity) *SendVoiceCall
CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func (*SendVoiceCall) ChatID ¶ added in v0.0.5
func (call *SendVoiceCall) ChatID(chatID PeerID) *SendVoiceCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SendVoiceCall) DisableNotification ¶
func (call *SendVoiceCall) DisableNotification(disableNotification bool) *SendVoiceCall
DisableNotification Sends the message silently. Users will receive a notification with no sound.
func (*SendVoiceCall) Duration ¶
func (call *SendVoiceCall) Duration(duration int) *SendVoiceCall
Duration Duration of the voice message in seconds
func (*SendVoiceCall) MessageThreadID ¶ added in v0.6.0
func (call *SendVoiceCall) MessageThreadID(messageThreadID int) *SendVoiceCall
MessageThreadID Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
func (*SendVoiceCall) ParseMode ¶
func (call *SendVoiceCall) ParseMode(parseMode ParseMode) *SendVoiceCall
ParseMode Mode for parsing entities in the voice message caption. See formatting options for more details.
func (*SendVoiceCall) ProtectContent ¶
func (call *SendVoiceCall) ProtectContent(protectContent bool) *SendVoiceCall
ProtectContent Protects the contents of the sent message from forwarding and saving
func (*SendVoiceCall) ReplyMarkup ¶
func (call *SendVoiceCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVoiceCall
ReplyMarkup 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.
func (*SendVoiceCall) ReplyToMessageID ¶ added in v0.0.5
func (call *SendVoiceCall) ReplyToMessageID(replyToMessageID int) *SendVoiceCall
ReplyToMessageID If the message is a reply, ID of the original message
func (*SendVoiceCall) Voice ¶
func (call *SendVoiceCall) Voice(voice FileArg) *SendVoiceCall
Voice Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
type SentWebAppMessage ¶
type SentWebAppMessage struct { // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. InlineMessageID string `json:"inline_message_id,omitempty"` }
SentWebAppMessage describes an inline message sent by a Web App on behalf of a user.
type SetChatAdministratorCustomTitleCall ¶
type SetChatAdministratorCustomTitleCall struct {
CallNoResult
}
SetChatAdministratorCustomTitleCall reprenesents a call to the setChatAdministratorCustomTitle method. Use this method to set a custom title for an administrator in a supergroup promoted by the bot
func NewSetChatAdministratorCustomTitleCall ¶
func NewSetChatAdministratorCustomTitleCall(chatID PeerID, userID UserID, customTitle string) *SetChatAdministratorCustomTitleCall
NewSetChatAdministratorCustomTitleCall constructs a new SetChatAdministratorCustomTitleCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) userID - Unique identifier of the target user customTitle - New custom title for the administrator; 0-16 characters, emoji are not allowed
func (*SetChatAdministratorCustomTitleCall) ChatID ¶ added in v0.0.5
func (call *SetChatAdministratorCustomTitleCall) ChatID(chatID PeerID) *SetChatAdministratorCustomTitleCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*SetChatAdministratorCustomTitleCall) CustomTitle ¶
func (call *SetChatAdministratorCustomTitleCall) CustomTitle(customTitle string) *SetChatAdministratorCustomTitleCall
CustomTitle New custom title for the administrator; 0-16 characters, emoji are not allowed
func (*SetChatAdministratorCustomTitleCall) UserID ¶ added in v0.0.5
func (call *SetChatAdministratorCustomTitleCall) UserID(userID UserID) *SetChatAdministratorCustomTitleCall
UserID Unique identifier of the target user
type SetChatDescriptionCall ¶
type SetChatDescriptionCall struct {
CallNoResult
}
SetChatDescriptionCall reprenesents a call to the setChatDescription method. 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 administrator rights
func NewSetChatDescriptionCall ¶
func NewSetChatDescriptionCall(chatID PeerID) *SetChatDescriptionCall
NewSetChatDescriptionCall constructs a new SetChatDescriptionCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SetChatDescriptionCall) ChatID ¶ added in v0.0.5
func (call *SetChatDescriptionCall) ChatID(chatID PeerID) *SetChatDescriptionCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SetChatDescriptionCall) Description ¶
func (call *SetChatDescriptionCall) Description(description string) *SetChatDescriptionCall
Description New chat description, 0-255 characters
type SetChatMenuButtonCall ¶
type SetChatMenuButtonCall struct {
CallNoResult
}
SetChatMenuButtonCall reprenesents a call to the setChatMenuButton method. Use this method to change the bot's menu button in a private chat, or the default menu button
func NewSetChatMenuButtonCall ¶
func NewSetChatMenuButtonCall() *SetChatMenuButtonCall
NewSetChatMenuButtonCall constructs a new SetChatMenuButtonCall with required parameters.
func (*SetChatMenuButtonCall) ChatID ¶ added in v0.0.5
func (call *SetChatMenuButtonCall) ChatID(chatID ChatID) *SetChatMenuButtonCall
ChatID Unique identifier for the target private chat. If not specified, default bot's menu button will be changed
func (*SetChatMenuButtonCall) MenuButton ¶
func (call *SetChatMenuButtonCall) MenuButton(menuButton MenuButton) *SetChatMenuButtonCall
MenuButton A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault
type SetChatPermissionsCall ¶
type SetChatPermissionsCall struct {
CallNoResult
}
SetChatPermissionsCall reprenesents a call to the setChatPermissions method. 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 administrator rights
func NewSetChatPermissionsCall ¶
func NewSetChatPermissionsCall(chatID PeerID, permissions ChatPermissions) *SetChatPermissionsCall
NewSetChatPermissionsCall constructs a new SetChatPermissionsCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) permissions - A JSON-serialized object for new default chat permissions
func (*SetChatPermissionsCall) ChatID ¶ added in v0.0.5
func (call *SetChatPermissionsCall) ChatID(chatID PeerID) *SetChatPermissionsCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*SetChatPermissionsCall) Permissions ¶
func (call *SetChatPermissionsCall) Permissions(permissions ChatPermissions) *SetChatPermissionsCall
Permissions A JSON-serialized object for new default chat permissions
func (*SetChatPermissionsCall) UseIndependentChatPermissions ¶ added in v0.6.0
func (call *SetChatPermissionsCall) UseIndependentChatPermissions(useIndependentChatPermissions bool) *SetChatPermissionsCall
UseIndependentChatPermissions Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
type SetChatPhotoCall ¶
type SetChatPhotoCall struct {
CallNoResult
}
SetChatPhotoCall reprenesents a call to the setChatPhoto method. 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 administrator rights
func NewSetChatPhotoCall ¶
func NewSetChatPhotoCall(chatID PeerID, photo InputFile) *SetChatPhotoCall
NewSetChatPhotoCall constructs a new SetChatPhotoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) photo - New chat photo, uploaded using multipart/form-data
func (*SetChatPhotoCall) ChatID ¶ added in v0.0.5
func (call *SetChatPhotoCall) ChatID(chatID PeerID) *SetChatPhotoCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SetChatPhotoCall) Photo ¶
func (call *SetChatPhotoCall) Photo(photo InputFile) *SetChatPhotoCall
Photo New chat photo, uploaded using multipart/form-data
type SetChatStickerSetCall ¶
type SetChatStickerSetCall struct {
CallNoResult
}
SetChatStickerSetCall reprenesents a call to the setChatStickerSet method. 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 administrator rights Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method
func NewSetChatStickerSetCall ¶
func NewSetChatStickerSetCall(chatID PeerID, stickerSetName string) *SetChatStickerSetCall
NewSetChatStickerSetCall constructs a new SetChatStickerSetCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) stickerSetName - Name of the sticker set to be set as the group sticker set
func (*SetChatStickerSetCall) ChatID ¶ added in v0.0.5
func (call *SetChatStickerSetCall) ChatID(chatID PeerID) *SetChatStickerSetCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*SetChatStickerSetCall) StickerSetName ¶
func (call *SetChatStickerSetCall) StickerSetName(stickerSetName string) *SetChatStickerSetCall
StickerSetName Name of the sticker set to be set as the group sticker set
type SetChatTitleCall ¶
type SetChatTitleCall struct {
CallNoResult
}
SetChatTitleCall reprenesents a call to the setChatTitle method. 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 administrator rights
func NewSetChatTitleCall ¶
func NewSetChatTitleCall(chatID PeerID, title string) *SetChatTitleCall
NewSetChatTitleCall constructs a new SetChatTitleCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) title - New chat title, 1-128 characters
func (*SetChatTitleCall) ChatID ¶ added in v0.0.5
func (call *SetChatTitleCall) ChatID(chatID PeerID) *SetChatTitleCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*SetChatTitleCall) Title ¶
func (call *SetChatTitleCall) Title(title string) *SetChatTitleCall
Title New chat title, 1-128 characters
type SetCustomEmojiStickerSetThumbnailCall ¶ added in v0.8.0
type SetCustomEmojiStickerSetThumbnailCall struct {
CallNoResult
}
SetCustomEmojiStickerSetThumbnailCall reprenesents a call to the setCustomEmojiStickerSetThumbnail method. Use this method to set the thumbnail of a custom emoji sticker set
func NewSetCustomEmojiStickerSetThumbnailCall ¶ added in v0.8.0
func NewSetCustomEmojiStickerSetThumbnailCall(name string) *SetCustomEmojiStickerSetThumbnailCall
NewSetCustomEmojiStickerSetThumbnailCall constructs a new SetCustomEmojiStickerSetThumbnailCall with required parameters. name - Sticker set name
func (*SetCustomEmojiStickerSetThumbnailCall) CustomEmojiID ¶ added in v0.8.0
func (call *SetCustomEmojiStickerSetThumbnailCall) CustomEmojiID(customEmojiID string) *SetCustomEmojiStickerSetThumbnailCall
CustomEmojiID Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.
func (*SetCustomEmojiStickerSetThumbnailCall) Name ¶ added in v0.8.0
func (call *SetCustomEmojiStickerSetThumbnailCall) Name(name string) *SetCustomEmojiStickerSetThumbnailCall
Name Sticker set name
type SetGameScoreCall ¶
SetGameScoreCall reprenesents a call to the setGameScore method. Use this method to set the score of the specified user in a game message On success, if the message is not an inline message, the Message is returned, otherwise True is returned Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
func NewSetGameScoreCall ¶
func NewSetGameScoreCall(userID UserID, score int) *SetGameScoreCall
NewSetGameScoreCall constructs a new SetGameScoreCall with required parameters. userID - User identifier score - New score, must be non-negative
func (*SetGameScoreCall) ChatID ¶ added in v0.0.5
func (call *SetGameScoreCall) ChatID(chatID ChatID) *SetGameScoreCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat
func (*SetGameScoreCall) DisableEditMessage ¶
func (call *SetGameScoreCall) DisableEditMessage(disableEditMessage bool) *SetGameScoreCall
DisableEditMessage Pass True if the game message should not be automatically edited to include the current scoreboard
func (*SetGameScoreCall) Force ¶
func (call *SetGameScoreCall) Force(force bool) *SetGameScoreCall
Force Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
func (*SetGameScoreCall) InlineMessageID ¶ added in v0.0.5
func (call *SetGameScoreCall) InlineMessageID(inlineMessageID string) *SetGameScoreCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*SetGameScoreCall) MessageID ¶ added in v0.0.5
func (call *SetGameScoreCall) MessageID(messageID int) *SetGameScoreCall
MessageID Required if inline_message_id is not specified. Identifier of the sent message
func (*SetGameScoreCall) Score ¶
func (call *SetGameScoreCall) Score(score int) *SetGameScoreCall
Score New score, must be non-negative
func (*SetGameScoreCall) UserID ¶ added in v0.0.5
func (call *SetGameScoreCall) UserID(userID UserID) *SetGameScoreCall
UserID User identifier
type SetMyCommandsCall ¶
type SetMyCommandsCall struct {
CallNoResult
}
SetMyCommandsCall reprenesents a call to the setMyCommands method. Use this method to change the list of the bot's commands See this manual for more details about bot commands
func NewSetMyCommandsCall ¶
func NewSetMyCommandsCall(commands []BotCommand) *SetMyCommandsCall
NewSetMyCommandsCall constructs a new SetMyCommandsCall with required parameters. commands - 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.
func (*SetMyCommandsCall) Commands ¶
func (call *SetMyCommandsCall) Commands(commands []BotCommand) *SetMyCommandsCall
Commands 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.
func (*SetMyCommandsCall) LanguageCode ¶
func (call *SetMyCommandsCall) LanguageCode(languageCode string) *SetMyCommandsCall
LanguageCode A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
func (*SetMyCommandsCall) Scope ¶
func (call *SetMyCommandsCall) Scope(scope BotCommandScope) *SetMyCommandsCall
Scope A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
type SetMyDefaultAdministratorRightsCall ¶
type SetMyDefaultAdministratorRightsCall struct {
CallNoResult
}
SetMyDefaultAdministratorRightsCall reprenesents a call to the setMyDefaultAdministratorRights method. Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels These rights will be suggested to users, but they are free to modify the list before adding the bot
func NewSetMyDefaultAdministratorRightsCall ¶
func NewSetMyDefaultAdministratorRightsCall() *SetMyDefaultAdministratorRightsCall
NewSetMyDefaultAdministratorRightsCall constructs a new SetMyDefaultAdministratorRightsCall with required parameters.
func (*SetMyDefaultAdministratorRightsCall) ForChannels ¶
func (call *SetMyDefaultAdministratorRightsCall) ForChannels(forChannels bool) *SetMyDefaultAdministratorRightsCall
ForChannels Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
func (*SetMyDefaultAdministratorRightsCall) Rights ¶
func (call *SetMyDefaultAdministratorRightsCall) Rights(rights ChatAdministratorRights) *SetMyDefaultAdministratorRightsCall
Rights A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
type SetMyDescriptionCall ¶ added in v0.8.0
type SetMyDescriptionCall struct {
CallNoResult
}
SetMyDescriptionCall reprenesents a call to the setMyDescription method. Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty
func NewSetMyDescriptionCall ¶ added in v0.8.0
func NewSetMyDescriptionCall() *SetMyDescriptionCall
NewSetMyDescriptionCall constructs a new SetMyDescriptionCall with required parameters.
func (*SetMyDescriptionCall) Description ¶ added in v0.8.0
func (call *SetMyDescriptionCall) Description(description string) *SetMyDescriptionCall
Description New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
func (*SetMyDescriptionCall) LanguageCode ¶ added in v0.8.0
func (call *SetMyDescriptionCall) LanguageCode(languageCode string) *SetMyDescriptionCall
LanguageCode A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
type SetMyNameCall ¶ added in v0.9.0
type SetMyNameCall struct {
CallNoResult
}
SetMyNameCall reprenesents a call to the setMyName method. Use this method to change the bot's name
func NewSetMyNameCall ¶ added in v0.9.0
func NewSetMyNameCall() *SetMyNameCall
NewSetMyNameCall constructs a new SetMyNameCall with required parameters.
func (*SetMyNameCall) LanguageCode ¶ added in v0.9.0
func (call *SetMyNameCall) LanguageCode(languageCode string) *SetMyNameCall
LanguageCode A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
func (*SetMyNameCall) Name ¶ added in v0.9.0
func (call *SetMyNameCall) Name(name string) *SetMyNameCall
Name New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
type SetMyShortDescriptionCall ¶ added in v0.8.0
type SetMyShortDescriptionCall struct {
CallNoResult
}
SetMyShortDescriptionCall reprenesents a call to the setMyShortDescription method. Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot
func NewSetMyShortDescriptionCall ¶ added in v0.8.0
func NewSetMyShortDescriptionCall() *SetMyShortDescriptionCall
NewSetMyShortDescriptionCall constructs a new SetMyShortDescriptionCall with required parameters.
func (*SetMyShortDescriptionCall) LanguageCode ¶ added in v0.8.0
func (call *SetMyShortDescriptionCall) LanguageCode(languageCode string) *SetMyShortDescriptionCall
LanguageCode A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
func (*SetMyShortDescriptionCall) ShortDescription ¶ added in v0.8.0
func (call *SetMyShortDescriptionCall) ShortDescription(shortDescription string) *SetMyShortDescriptionCall
ShortDescription New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
type SetPassportDataErrorsCall ¶
type SetPassportDataErrorsCall struct {
CallNoResult
}
SetPassportDataErrorsCall reprenesents a call to the setPassportDataErrors method. 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) 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.
func NewSetPassportDataErrorsCall ¶
func NewSetPassportDataErrorsCall(userID UserID, errors []PassportElementError) *SetPassportDataErrorsCall
NewSetPassportDataErrorsCall constructs a new SetPassportDataErrorsCall with required parameters. userID - User identifier errors - A JSON-serialized array describing the errors
func (*SetPassportDataErrorsCall) Errors ¶
func (call *SetPassportDataErrorsCall) Errors(errors []PassportElementError) *SetPassportDataErrorsCall
Errors A JSON-serialized array describing the errors
func (*SetPassportDataErrorsCall) UserID ¶ added in v0.0.5
func (call *SetPassportDataErrorsCall) UserID(userID UserID) *SetPassportDataErrorsCall
UserID User identifier
type SetStickerEmojiListCall ¶ added in v0.8.0
type SetStickerEmojiListCall struct {
CallNoResult
}
SetStickerEmojiListCall reprenesents a call to the setStickerEmojiList method. Use this method to change the list of emoji assigned to a regular or custom emoji sticker The sticker must belong to a sticker set created by the bot
func NewSetStickerEmojiListCall ¶ added in v0.8.0
func NewSetStickerEmojiListCall(sticker string, emojiList []string) *SetStickerEmojiListCall
NewSetStickerEmojiListCall constructs a new SetStickerEmojiListCall with required parameters. sticker - File identifier of the sticker emojiList - A JSON-serialized list of 1-20 emoji associated with the sticker
func (*SetStickerEmojiListCall) EmojiList ¶ added in v0.8.0
func (call *SetStickerEmojiListCall) EmojiList(emojiList []string) *SetStickerEmojiListCall
EmojiList A JSON-serialized list of 1-20 emoji associated with the sticker
func (*SetStickerEmojiListCall) Sticker ¶ added in v0.8.0
func (call *SetStickerEmojiListCall) Sticker(sticker string) *SetStickerEmojiListCall
Sticker File identifier of the sticker
type SetStickerKeywordsCall ¶ added in v0.8.0
type SetStickerKeywordsCall struct {
CallNoResult
}
SetStickerKeywordsCall reprenesents a call to the setStickerKeywords method. Use this method to change search keywords assigned to a regular or custom emoji sticker The sticker must belong to a sticker set created by the bot
func NewSetStickerKeywordsCall ¶ added in v0.8.0
func NewSetStickerKeywordsCall(sticker string) *SetStickerKeywordsCall
NewSetStickerKeywordsCall constructs a new SetStickerKeywordsCall with required parameters. sticker - File identifier of the sticker
func (*SetStickerKeywordsCall) Keywords ¶ added in v0.8.0
func (call *SetStickerKeywordsCall) Keywords(keywords []string) *SetStickerKeywordsCall
Keywords A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters
func (*SetStickerKeywordsCall) Sticker ¶ added in v0.8.0
func (call *SetStickerKeywordsCall) Sticker(sticker string) *SetStickerKeywordsCall
Sticker File identifier of the sticker
type SetStickerMaskPositionCall ¶ added in v0.8.0
type SetStickerMaskPositionCall struct {
CallNoResult
}
SetStickerMaskPositionCall reprenesents a call to the setStickerMaskPosition method. Use this method to change the mask position of a mask sticker The sticker must belong to a sticker set that was created by the bot
func NewSetStickerMaskPositionCall ¶ added in v0.8.0
func NewSetStickerMaskPositionCall(sticker string) *SetStickerMaskPositionCall
NewSetStickerMaskPositionCall constructs a new SetStickerMaskPositionCall with required parameters. sticker - File identifier of the sticker
func (*SetStickerMaskPositionCall) MaskPosition ¶ added in v0.8.0
func (call *SetStickerMaskPositionCall) MaskPosition(maskPosition MaskPosition) *SetStickerMaskPositionCall
MaskPosition A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.
func (*SetStickerMaskPositionCall) Sticker ¶ added in v0.8.0
func (call *SetStickerMaskPositionCall) Sticker(sticker string) *SetStickerMaskPositionCall
Sticker File identifier of the sticker
type SetStickerPositionInSetCall ¶
type SetStickerPositionInSetCall struct {
CallNoResult
}
SetStickerPositionInSetCall reprenesents a call to the setStickerPositionInSet method. Use this method to move a sticker in a set created by the bot to a specific position
func NewSetStickerPositionInSetCall ¶
func NewSetStickerPositionInSetCall(sticker string, position int) *SetStickerPositionInSetCall
NewSetStickerPositionInSetCall constructs a new SetStickerPositionInSetCall with required parameters. sticker - File identifier of the sticker position - New sticker position in the set, zero-based
func (*SetStickerPositionInSetCall) Position ¶
func (call *SetStickerPositionInSetCall) Position(position int) *SetStickerPositionInSetCall
Position New sticker position in the set, zero-based
func (*SetStickerPositionInSetCall) Sticker ¶
func (call *SetStickerPositionInSetCall) Sticker(sticker string) *SetStickerPositionInSetCall
Sticker File identifier of the sticker
type SetStickerSetThumbnailCall ¶ added in v0.8.0
type SetStickerSetThumbnailCall struct {
CallNoResult
}
SetStickerSetThumbnailCall reprenesents a call to the setStickerSetThumbnail method. Use this method to set the thumbnail of a regular or mask sticker set The format of the thumbnail file must match the format of the stickers in the set
func NewSetStickerSetThumbnailCall ¶ added in v0.8.0
func NewSetStickerSetThumbnailCall(name string, userID UserID) *SetStickerSetThumbnailCall
NewSetStickerSetThumbnailCall constructs a new SetStickerSetThumbnailCall with required parameters. name - Sticker set name userID - User identifier of the sticker set owner
func (*SetStickerSetThumbnailCall) Name ¶ added in v0.8.0
func (call *SetStickerSetThumbnailCall) Name(name string) *SetStickerSetThumbnailCall
Name Sticker set name
func (*SetStickerSetThumbnailCall) Thumbnail ¶ added in v0.8.0
func (call *SetStickerSetThumbnailCall) Thumbnail(thumbnail FileArg) *SetStickerSetThumbnailCall
Thumbnail A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video 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 information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
func (*SetStickerSetThumbnailCall) UserID ¶ added in v0.8.0
func (call *SetStickerSetThumbnailCall) UserID(userID UserID) *SetStickerSetThumbnailCall
UserID User identifier of the sticker set owner
type SetStickerSetTitleCall ¶ added in v0.8.0
type SetStickerSetTitleCall struct {
CallNoResult
}
SetStickerSetTitleCall reprenesents a call to the setStickerSetTitle method. Use this method to set the title of a created sticker set
func NewSetStickerSetTitleCall ¶ added in v0.8.0
func NewSetStickerSetTitleCall(name string, title string) *SetStickerSetTitleCall
NewSetStickerSetTitleCall constructs a new SetStickerSetTitleCall with required parameters. name - Sticker set name title - Sticker set title, 1-64 characters
func (*SetStickerSetTitleCall) Name ¶ added in v0.8.0
func (call *SetStickerSetTitleCall) Name(name string) *SetStickerSetTitleCall
Name Sticker set name
func (*SetStickerSetTitleCall) Title ¶ added in v0.8.0
func (call *SetStickerSetTitleCall) Title(title string) *SetStickerSetTitleCall
Title Sticker set title, 1-64 characters
type SetWebhookCall ¶
type SetWebhookCall struct {
CallNoResult
}
SetWebhookCall reprenesents a call to the setWebhook method. 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 If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
func NewSetWebhookCall ¶
func NewSetWebhookCall(url string) *SetWebhookCall
NewSetWebhookCall constructs a new SetWebhookCall with required parameters. url - HTTPS URL to send updates to. Use an empty string to remove webhook integration
func (*SetWebhookCall) AllowedUpdates ¶
func (call *SetWebhookCall) AllowedUpdates(allowedUpdates []UpdateType) *SetWebhookCall
AllowedUpdates 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 update types except chat_member (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.
func (*SetWebhookCall) Certificate ¶
func (call *SetWebhookCall) Certificate(certificate InputFile) *SetWebhookCall
Certificate Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
func (*SetWebhookCall) DropPendingUpdates ¶
func (call *SetWebhookCall) DropPendingUpdates(dropPendingUpdates bool) *SetWebhookCall
DropPendingUpdates Pass True to drop all pending updates
func (*SetWebhookCall) IPAddress ¶ added in v0.0.5
func (call *SetWebhookCall) IPAddress(ipAddress string) *SetWebhookCall
IPAddress The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
func (*SetWebhookCall) MaxConnections ¶
func (call *SetWebhookCall) MaxConnections(maxConnections int) *SetWebhookCall
MaxConnections The 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.
func (*SetWebhookCall) SecretToken ¶
func (call *SetWebhookCall) SecretToken(secretToken string) *SetWebhookCall
SecretToken A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.
func (*SetWebhookCall) URL ¶ added in v0.0.5
func (call *SetWebhookCall) URL(url string) *SetWebhookCall
URL HTTPS URL to send updates to. Use an empty string to remove webhook integration
type ShippingAddress ¶
type ShippingAddress struct { // Two-letter ISO 3166-1 alpha-2 country code CountryCode string `json:"country_code"` // State, if applicable State string `json:"state"` // City City string `json:"city"` // First line for the address StreetLine1 string `json:"street_line1"` // Second line for the address StreetLine2 string `json:"street_line2"` // Address post code PostCode string `json:"post_code"` }
ShippingAddress this object represents a shipping address.
type ShippingOption ¶
type ShippingOption struct { // Shipping option identifier ID string `json:"id"` // Option title Title string `json:"title"` // List of price portions Prices []LabeledPrice `json:"prices"` }
ShippingOption this object represents one shipping option.
type ShippingQuery ¶
type ShippingQuery struct { // Unique query identifier ID string `json:"id"` // User who sent the query From User `json:"from"` // Bot specified invoice payload InvoicePayload string `json:"invoice_payload"` // User specified shipping address ShippingAddress ShippingAddress `json:"shipping_address"` }
ShippingQuery this object contains information about an incoming shipping query.
type Sticker ¶
type Sticker struct { // Identifier for this file, which can be used to download or reuse the file FileID string `json:"file_id"` // 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"` // Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. Type StickerType `json:"type"` // Sticker width Width int `json:"width"` // Sticker height Height int `json:"height"` // True, if the sticker is animated IsAnimated bool `json:"is_animated"` // True, if the sticker is a video sticker IsVideo bool `json:"is_video"` // Optional. Sticker thumbnail in the .WEBP or .JPG format Thumbnail *PhotoSize `json:"thumbnail,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 premium regular stickers, premium animation for the sticker PremiumAnimation *File `json:"premium_animation,omitempty"` // Optional. For mask stickers, the position where the mask should be placed MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Optional. For custom emoji stickers, unique identifier of the custom emoji CustomEmojiID string `json:"custom_emoji_id,omitempty"` // Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places NeedsRepainting bool `json:"needs_repainting,omitempty"` // Optional. File size in bytes FileSize int `json:"file_size,omitempty"` }
Sticker this object represents a sticker.
type StickerSet ¶
type StickerSet struct { // Sticker set name Name string `json:"name"` // Sticker set title Title string `json:"title"` // Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” StickerType StickerType `json:"sticker_type"` // True, if the sticker set contains animated stickers IsAnimated bool `json:"is_animated"` // True, if the sticker set contains video stickers IsVideo bool `json:"is_video"` // List of all set stickers Stickers []Sticker `json:"stickers"` // Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format Thumbnail *PhotoSize `json:"thumbnail,omitempty"` }
StickerSet this object represents a sticker set.
type StickerType ¶ added in v0.5.0
type StickerType int
StickerType it's type for describe content of Sticker.
const ( StickerTypeUnknown StickerType = iota StickerTypeRegular StickerTypeMask StickerTypeCustomEmoji )
func (StickerType) MarshalText ¶ added in v0.5.0
func (sticker StickerType) MarshalText() ([]byte, error)
func (StickerType) String ¶ added in v0.5.0
func (sticker StickerType) String() string
func (*StickerType) UnmarshalText ¶ added in v0.5.0
func (sticker *StickerType) UnmarshalText(v []byte) error
type StopMessageLiveLocationCall ¶
StopMessageLiveLocationCall reprenesents a call to the stopMessageLiveLocation method. Use this method to stop updating a live location message before live_period expires On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
func NewStopMessageLiveLocationCall ¶
func NewStopMessageLiveLocationCall(chatID PeerID, messageID int) *StopMessageLiveLocationCall
NewStopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message with live location to stop
func NewStopMessageLiveLocationInlineCall ¶
func NewStopMessageLiveLocationInlineCall(inlineMessageID string) *StopMessageLiveLocationCall
NewStopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message
func (*StopMessageLiveLocationCall) ChatID ¶ added in v0.0.5
func (call *StopMessageLiveLocationCall) ChatID(chatID PeerID) *StopMessageLiveLocationCall
ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*StopMessageLiveLocationCall) InlineMessageID ¶ added in v0.0.5
func (call *StopMessageLiveLocationCall) InlineMessageID(inlineMessageID string) *StopMessageLiveLocationCall
InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message
func (*StopMessageLiveLocationCall) MessageID ¶ added in v0.0.5
func (call *StopMessageLiveLocationCall) MessageID(messageID int) *StopMessageLiveLocationCall
MessageID Required if inline_message_id is not specified. Identifier of the message with live location to stop
func (*StopMessageLiveLocationCall) ReplyMarkup ¶
func (call *StopMessageLiveLocationCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *StopMessageLiveLocationCall
ReplyMarkup A JSON-serialized object for a new inline keyboard.
type StopPollCall ¶
StopPollCall reprenesents a call to the stopPoll method. Use this method to stop a poll which was sent by the bot On success, the stopped Poll is returned.
func NewStopPollCall ¶
func NewStopPollCall(chatID PeerID, messageID int) *StopPollCall
NewStopPollCall constructs a new StopPollCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Identifier of the original message with the poll
func (*StopPollCall) ChatID ¶ added in v0.0.5
func (call *StopPollCall) ChatID(chatID PeerID) *StopPollCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*StopPollCall) MessageID ¶ added in v0.0.5
func (call *StopPollCall) MessageID(messageID int) *StopPollCall
MessageID Identifier of the original message with the poll
func (*StopPollCall) ReplyMarkup ¶
func (call *StopPollCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *StopPollCall
ReplyMarkup A JSON-serialized object for a new message inline keyboard.
type SuccessfulPayment ¶
type SuccessfulPayment struct { // Three-letter ISO 4217 currency code Currency string `json:"currency"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). TotalAmount int `json:"total_amount"` // Bot specified invoice payload InvoicePayload string `json:"invoice_payload"` // Optional. Identifier of the shipping option chosen by the user ShippingOptionID string `json:"shipping_option_id,omitempty"` // Optional. Order information provided by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` // Telegram payment identifier TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Provider payment identifier ProviderPaymentChargeID string `json:"provider_payment_charge_id"` }
SuccessfulPayment this object contains basic information about a successful payment.
type SwitchInlineQueryChosenChat ¶ added in v0.9.0
type SwitchInlineQueryChosenChat struct { // Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted Query string `json:"query,omitempty"` // Optional. True, if private chats with users can be chosen AllowUserChats bool `json:"allow_user_chats,omitempty"` // Optional. True, if private chats with bots can be chosen AllowBotChats bool `json:"allow_bot_chats,omitempty"` // Optional. True, if group and supergroup chats can be chosen AllowGroupChats bool `json:"allow_group_chats,omitempty"` // Optional. True, if channel chats can be chosen AllowChannelChats bool `json:"allow_channel_chats,omitempty"` }
SwitchInlineQueryChosenChat this object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
type UnbanChatMemberCall ¶
type UnbanChatMemberCall struct {
CallNoResult
}
UnbanChatMemberCall reprenesents a call to the unbanChatMember method. Use this method to unban a previously banned 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
func NewUnbanChatMemberCall ¶
func NewUnbanChatMemberCall(chatID PeerID, userID UserID) *UnbanChatMemberCall
NewUnbanChatMemberCall constructs a new UnbanChatMemberCall with required parameters. chatID - Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) userID - Unique identifier of the target user
func (*UnbanChatMemberCall) ChatID ¶ added in v0.0.5
func (call *UnbanChatMemberCall) ChatID(chatID PeerID) *UnbanChatMemberCall
ChatID Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
func (*UnbanChatMemberCall) OnlyIfBanned ¶
func (call *UnbanChatMemberCall) OnlyIfBanned(onlyIfBanned bool) *UnbanChatMemberCall
OnlyIfBanned Do nothing if the user is not banned
func (*UnbanChatMemberCall) UserID ¶ added in v0.0.5
func (call *UnbanChatMemberCall) UserID(userID UserID) *UnbanChatMemberCall
UserID Unique identifier of the target user
type UnbanChatSenderChatCall ¶
type UnbanChatSenderChatCall struct {
CallNoResult
}
UnbanChatSenderChatCall reprenesents a call to the unbanChatSenderChat method. Use this method to unban a previously banned channel chat in a supergroup or channel The bot must be an administrator for this to work and must have the appropriate administrator rights
func NewUnbanChatSenderChatCall ¶
func NewUnbanChatSenderChatCall(chatID PeerID, senderChatID int) *UnbanChatSenderChatCall
NewUnbanChatSenderChatCall constructs a new UnbanChatSenderChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) senderChatID - Unique identifier of the target sender chat
func (*UnbanChatSenderChatCall) ChatID ¶ added in v0.0.5
func (call *UnbanChatSenderChatCall) ChatID(chatID PeerID) *UnbanChatSenderChatCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*UnbanChatSenderChatCall) SenderChatID ¶ added in v0.0.5
func (call *UnbanChatSenderChatCall) SenderChatID(senderChatID int) *UnbanChatSenderChatCall
SenderChatID Unique identifier of the target sender chat
type UnhideGeneralForumTopicCall ¶ added in v0.6.0
type UnhideGeneralForumTopicCall struct {
CallNoResult
}
UnhideGeneralForumTopicCall reprenesents a call to the unhideGeneralForumTopic method. Use this method to unhide the 'General' topic in a forum supergroup chat The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
func NewUnhideGeneralForumTopicCall ¶ added in v0.6.0
func NewUnhideGeneralForumTopicCall(chatID PeerID) *UnhideGeneralForumTopicCall
NewUnhideGeneralForumTopicCall constructs a new UnhideGeneralForumTopicCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*UnhideGeneralForumTopicCall) ChatID ¶ added in v0.6.0
func (call *UnhideGeneralForumTopicCall) ChatID(chatID PeerID) *UnhideGeneralForumTopicCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type UnpinAllChatMessagesCall ¶
type UnpinAllChatMessagesCall struct {
CallNoResult
}
UnpinAllChatMessagesCall reprenesents a call to the unpinAllChatMessages method. 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' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel
func NewUnpinAllChatMessagesCall ¶
func NewUnpinAllChatMessagesCall(chatID PeerID) *UnpinAllChatMessagesCall
NewUnpinAllChatMessagesCall constructs a new UnpinAllChatMessagesCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*UnpinAllChatMessagesCall) ChatID ¶ added in v0.0.5
func (call *UnpinAllChatMessagesCall) ChatID(chatID PeerID) *UnpinAllChatMessagesCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type UnpinAllForumTopicMessagesCall ¶ added in v0.6.0
type UnpinAllForumTopicMessagesCall struct {
CallNoResult
}
UnpinAllForumTopicMessagesCall reprenesents a call to the unpinAllForumTopicMessages method. Use this method to clear the list of pinned messages in a forum topic The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup
func NewUnpinAllForumTopicMessagesCall ¶ added in v0.6.0
func NewUnpinAllForumTopicMessagesCall(chatID PeerID, messageThreadID int) *UnpinAllForumTopicMessagesCall
NewUnpinAllForumTopicMessagesCall constructs a new UnpinAllForumTopicMessagesCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) messageThreadID - Unique identifier for the target message thread of the forum topic
func (*UnpinAllForumTopicMessagesCall) ChatID ¶ added in v0.6.0
func (call *UnpinAllForumTopicMessagesCall) ChatID(chatID PeerID) *UnpinAllForumTopicMessagesCall
ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func (*UnpinAllForumTopicMessagesCall) MessageThreadID ¶ added in v0.6.0
func (call *UnpinAllForumTopicMessagesCall) MessageThreadID(messageThreadID int) *UnpinAllForumTopicMessagesCall
MessageThreadID Unique identifier for the target message thread of the forum topic
type UnpinChatMessageCall ¶
type UnpinChatMessageCall struct {
CallNoResult
}
UnpinChatMessageCall reprenesents a call to the unpinChatMessage method. 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' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel
func NewUnpinChatMessageCall ¶
func NewUnpinChatMessageCall(chatID PeerID) *UnpinChatMessageCall
NewUnpinChatMessageCall constructs a new UnpinChatMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*UnpinChatMessageCall) ChatID ¶ added in v0.0.5
func (call *UnpinChatMessageCall) ChatID(chatID PeerID) *UnpinChatMessageCall
ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func (*UnpinChatMessageCall) MessageID ¶ added in v0.0.5
func (call *UnpinChatMessageCall) MessageID(messageID int) *UnpinChatMessageCall
MessageID Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
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. ID int `json:"update_id"` // 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"` // Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"` // Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"` // Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"` }
Update this object represents an incoming update.At most one of the optional parameters can be present in any given update.
func (*Update) Msg ¶ added in v0.3.0
Msg returns message from whever possible. It returns nil if message is not found.
func (*Update) Type ¶ added in v0.1.1
func (update *Update) Type() UpdateType
type UpdateType ¶ added in v0.1.1
type UpdateType int
UpdateType it's type for describe content of Update.
const ( UpdateTypeUnknown UpdateType = iota UpdateTypeMessage UpdateTypeEditedMessage UpdateTypeChannelPost UpdateTypeEditedChannelPost UpdateTypeInlineQuery UpdateTypeChosenInlineResult UpdateTypeCallbackQuery UpdateTypeShippingQuery UpdateTypePreCheckoutQuery UpdateTypePoll UpdateTypePollAnswer UpdateTypeMyChatMember UpdateTypeChatMember UpdateTypeChatJoinRequest )
func (UpdateType) MarshalText ¶ added in v0.1.1
func (typ UpdateType) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler.
func (UpdateType) String ¶ added in v0.1.1
func (typ UpdateType) String() string
String returns string representation of UpdateType.
func (*UpdateType) UnmarshalText ¶ added in v0.1.1
func (typ *UpdateType) UnmarshalText(v []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type UploadStickerFileCall ¶
UploadStickerFileCall reprenesents a call to the uploadStickerFile method. Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times) Returns the uploaded File on success.
func NewUploadStickerFileCall ¶
func NewUploadStickerFileCall(userID UserID, sticker InputFile, stickerFormat string) *UploadStickerFileCall
NewUploadStickerFileCall constructs a new UploadStickerFileCall with required parameters. userID - User identifier of sticker file owner sticker - A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files » stickerFormat - Format of the sticker, must be one of “static”, “animated”, “video”
func (*UploadStickerFileCall) Sticker ¶ added in v0.8.0
func (call *UploadStickerFileCall) Sticker(sticker InputFile) *UploadStickerFileCall
Sticker A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files »
func (*UploadStickerFileCall) StickerFormat ¶ added in v0.8.0
func (call *UploadStickerFileCall) StickerFormat(stickerFormat string) *UploadStickerFileCall
StickerFormat Format of the sticker, must be one of “static”, “animated”, “video”
func (*UploadStickerFileCall) UserID ¶ added in v0.0.5
func (call *UploadStickerFileCall) UserID(userID UserID) *UploadStickerFileCall
UserID User identifier of sticker file owner
type User ¶
type User struct { // Unique identifier for this user or bot. ID UserID `json:"id"` // True, if this user is a bot IsBot bool `json:"is_bot"` // User's or bot's first name FirstName string `json:"first_name"` // Optional. User's or bot's last name LastName string `json:"last_name,omitempty"` // Optional. User's or bot's username Username Username `json:"username,omitempty"` // Optional. IETF language tag of the user's language LanguageCode string `json:"language_code,omitempty"` // Optional. True, if this user is a Telegram Premium user IsPremium bool `json:"is_premium,omitempty"` // Optional. True, if this user added the bot to the attachment menu AddedToAttachmentMenu bool `json:"added_to_attachment_menu,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"` }
User this object represents a Telegram user or bot.
type UserProfilePhotos ¶
type UserProfilePhotos struct { // Total number of profile pictures the target user has TotalCount int `json:"total_count"` // Requested profile pictures (in up to 4 sizes each) Photos [][]PhotoSize `json:"photos"` }
UserProfilePhotos this object represent a user's profile pictures.
type UserShared ¶ added in v0.6.0
UserShared this object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.
type Username ¶
type Username string
Username represents a Telegram username.
type Venue ¶
type Venue struct { // Venue location. Can't be a live location Location Location `json:"location"` // Name of the venue Title string `json:"title"` // Address of the venue Address string `json:"address"` // 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"` }
Venue this object represents a venue.
type Video ¶
type Video struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Video width as defined by sender Width int `json:"width"` // Video height as defined by sender Height int `json:"height"` // Duration of the video in seconds as defined by sender Duration int `json:"duration"` // Optional. Video thumbnail Thumbnail *PhotoSize `json:"thumbnail,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 in bytes. FileSize int64 `json:"file_size,omitempty"` }
Video this object represents a video file.
type VideoChatEnded ¶
type VideoChatEnded struct { // Video chat duration in seconds Duration int `json:"duration"` }
VideoChatEnded this object represents a service message about a video chat ended in the chat.
type VideoChatParticipantsInvited ¶
type VideoChatParticipantsInvited struct { // New members that were invited to the video chat Users []User `json:"users"` }
VideoChatParticipantsInvited this object represents a service message about new members invited to a video chat.
type VideoChatScheduled ¶
type VideoChatScheduled struct { // Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator StartDate int `json:"start_date"` }
VideoChatScheduled this object represents a service message about a video chat scheduled in the chat.
type VideoChatStarted ¶
type VideoChatStarted struct { // Video chat duration in seconds Duration int `json:"duration"` }
VideoChatStarted this object represents a service message about a video chat started in the chat. Currently holds no information.
type VideoNote ¶
type VideoNote struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Video width and height (diameter of the video message) as defined by sender Length int `json:"length"` // Duration of the video in seconds as defined by sender Duration int `json:"duration"` // Optional. Video thumbnail Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. File size in bytes FileSize int `json:"file_size,omitempty"` }
VideoNote this object represents a video message (available in Telegram apps as of v.4.0).
type Voice ¶
type Voice struct { // Identifier for this file, which can be used to download or reuse the file FileID FileID `json:"file_id"` // 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"` // Duration of the audio in seconds as defined by sender Duration int `json:"duration"` // Optional. MIME type of the file as defined by sender MIMEType string `json:"mime_type,omitempty"` // Optional. File size in bytes. FileSize int64 `json:"file_size,omitempty"` }
Voice this object represents a voice note.
type WebAppChat ¶ added in v0.0.5
type WebAppChat struct { // Unique identifier for this chat. ID ChatID `json:"id"` // Type of chat, can be either “group”, “supergroup” or “channel” Type ChatType `json:"type"` // Title of the chat Title string `json:"title"` // Optional. Username of the chat Username string `json:"username,omitempty"` // Optional. URL of the chat’s photo. The photo can be in .jpeg or .svg formats. Only returned for Web Apps launched from the attachment menu. PhotoURL string `json:"photo_url,omitempty"` }
WebAppChat this object represents a chat.
type WebAppData ¶
type WebAppData struct { // The data. Be aware that a bad client can send arbitrary data in this field. Data string `json:"data"` // Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. ButtonText string `json:"button_text"` }
WebAppData describes data sent from a Web App to the bot.
type WebAppInfo ¶
type WebAppInfo struct { // An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps URL string `json:"url"` }
WebAppInfo describes a Web App.
type WebAppInitData ¶ added in v0.0.5
type WebAppInitData struct { // Optional. A unique identifier for the Web App session, required for sending messages via the answerWebAppQuery method. QueryID string `json:"query_id,omitempty"` // Optional. An object containing data about the current user. User *WebAppUser `json:"user,omitempty"` // Optional. An object containing data about the chat partner of the current user in the chat where the bot was launched via the attachment menu. Returned only for private chats and only for Web Apps launched via the attachment menu. Receiver *WebAppUser `json:"receiver,omitempty"` // Optional. An object containing data about the chat where the bot was launched via the attachment menu. Returned for supergroups, channels and group chats – only for Web Apps launched via the attachment menu. Chat *WebAppChat `json:"chat,omitempty"` // Optional. Type of the chat from which the Web App was opened. Can be either “sender” for a private chat with the user opening the link, “private”, “group”, “supergroup”, or “channel”. Returned only for Web Apps launched from direct links. ChatType string `json:"chat_type,omitempty"` // Optional. Global identifier, uniquely corresponding to the chat from which the Web App was opened. Returned only for Web Apps launched from a direct link. ChatInstance string `json:"chat_instance,omitempty"` // Optional. The value of the startattach parameter, passed via link. Only returned for Web Apps when launched from the attachment menu via link.The value of the start_param parameter will also be passed in the GET-parameter tgWebAppStartParam, so the Web App can load the correct interface right away. StartParam string `json:"start_param,omitempty"` // Optional. Time in seconds, after which a message can be sent via the answerWebAppQuery method. CanSendAfter int `json:"can_send_after,omitempty"` // Unix time when the form was opened. AuthDate int64 `json:"auth_date"` // A hash of all passed parameters, which the bot server can use to check their validity. Hash string `json:"hash"` // contains filtered or unexported fields }
WebAppInitData this object contains data that is transferred to the Web App when it is opened. It is empty if the Web App was launched from a keyboard button or from inline mode.
func ParseWebAppInitData ¶ added in v0.0.5
func ParseWebAppInitData(vs url.Values) (*WebAppInitData, error)
ParseWebAppInitData parses a WebAppInitData from query string.
func (WebAppInitData) Query ¶ added in v0.0.5
func (w WebAppInitData) Query() url.Values
Query returns a query values for the WebAppInitData.
func (WebAppInitData) Signature ¶ added in v0.0.5
func (w WebAppInitData) Signature(token string) string
Signature returns the signature of the WebAppInitData.
func (WebAppInitData) Valid ¶ added in v0.0.5
func (w WebAppInitData) Valid(token string) bool
type WebAppUser ¶ added in v0.0.5
type WebAppUser struct { // A unique identifier for the user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. It has at most 52 significant bits, so a 64-bit integer or a double-precision float type is safe for storing this identifier. ID UserID `json:"id"` // Optional. True, if this user is a bot. Returns in the receiver field only. IsBot bool `json:"is_bot,omitempty"` // First name of the user or bot. FirstName string `json:"first_name"` // Optional. Last name of the user or bot. LastName string `json:"last_name,omitempty"` // Optional. Username of the user or bot. Username string `json:"username,omitempty"` // Optional. IETF language tag of the user's language. Returns in user field only. LanguageCode string `json:"language_code,omitempty"` // Optional. True, if this user is a Telegram Premium user IsPremium bool `json:"is_premium,omitempty"` // Optional. URL of the user’s profile photo. The photo can be in .jpeg or .svg formats. Only returned for Web Apps launched from the attachment menu. PhotoURL string `json:"photo_url,omitempty"` }
WebAppUser this object contains the data of the Web App user.
type WebhookInfo ¶
type WebhookInfo struct { // Webhook URL, may be empty if webhook is not set up URL string `json:"url"` // True, if a custom certificate was provided for webhook certificate checks HasCustomCertificate bool `json:"has_custom_certificate"` // Number of updates awaiting delivery PendingUpdateCount int `json:"pending_update_count"` // 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. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters LastSynchronizationErrorDate int64 `json:"last_synchronization_error_date,omitempty"` // Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery MaxConnections int `json:"max_connections,omitempty"` // Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` }
WebhookInfo describes the current status of a webhook.
type WriteAccessAllowed ¶ added in v0.6.0
type WriteAccessAllowed struct { // Optional. Name of the Web App which was launched from a link WebAppName string `json:"web_app_name,omitempty"` }
WriteAccessAllowed this object represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Packages examples contains usage examples of go-tg.
|
Packages examples contains usage examples of go-tg. |
calculator
Package contains example of using tgb.ChatType filter.
|
Package contains example of using tgb.ChatType filter. |
chat-type-filter
Package contains example of using tgb.ChatType filter.
|
Package contains example of using tgb.ChatType filter. |
echo-bot
Package contains simple echo bot, that demonstrates how to use handlers, filters and file uploads.
|
Package contains simple echo bot, that demonstrates how to use handlers, filters and file uploads. |
media-group
Package contains example of using tgb.ChatType filter.
|
Package contains example of using tgb.ChatType filter. |
quote-bot
Package contains example of using tgb.ChatType filter.
|
Package contains example of using tgb.ChatType filter. |
session-filter
Package contains simple echo bot, that demonstrates how to use handlers, filters and file uploads.
|
Package contains simple echo bot, that demonstrates how to use handlers, filters and file uploads. |
webapps
Package contains example of using tgb.ChatType filter.
|
Package contains example of using tgb.ChatType filter. |
Package tgb is a Telegram bot framework.
|
Package tgb is a Telegram bot framework. |
session
Package session provides a session managment.
|
Package session provides a session managment. |
session/sessionredis
Module
|
|
session/sessionsql
Module
|