Documentation
¶
Overview ¶
Package gogram provides a Telegram Bot API client library for Go.
Index ¶
- Constants
- Variables
- func DownloadByFileID(client *Client, fileID, filePath string) error
- func DownloadFile(client *Client, file *File, path string) error
- func ExtractArgs(text string) []string
- func ExtractPayload(text string) string
- func NewError(code int, text string) error
- func ReceiveFileReader(client *Client, file *File) (io.ReadCloser, error)
- func ReceiveFileReaderByFileID(client *Client, fileID string) (io.ReadCloser, error)
- type APIError
- type AcceptedGiftTypes
- type AddStickerToSetOption
- type AddStickerToSetParams
- type AffiliateInfo
- type Animation
- type AnswerCallbackQueryOption
- func WithAnswerCallbackQueryCacheTime(value int64) AnswerCallbackQueryOption
- func WithAnswerCallbackQueryCallbackQueryID(value string) AnswerCallbackQueryOption
- func WithAnswerCallbackQueryShowAlert(value bool) AnswerCallbackQueryOption
- func WithAnswerCallbackQueryText(value string) AnswerCallbackQueryOption
- func WithAnswerCallbackQueryURL(value string) AnswerCallbackQueryOption
- type AnswerCallbackQueryParams
- type AnswerInlineQueryOption
- func WithAnswerInlineQueryButton(value *InlineQueryResultsButton) AnswerInlineQueryOption
- func WithAnswerInlineQueryCacheTime(value int64) AnswerInlineQueryOption
- func WithAnswerInlineQueryInlineQueryID(value string) AnswerInlineQueryOption
- func WithAnswerInlineQueryIsPersonal(value bool) AnswerInlineQueryOption
- func WithAnswerInlineQueryNextOffset(value string) AnswerInlineQueryOption
- func WithAnswerInlineQueryResults(value []InlineQueryResult) AnswerInlineQueryOption
- type AnswerInlineQueryParams
- type AnswerPreCheckoutQueryOption
- type AnswerPreCheckoutQueryParams
- type AnswerShippingQueryOption
- func WithAnswerShippingQueryErrorMessage(value string) AnswerShippingQueryOption
- func WithAnswerShippingQueryOk(value bool) AnswerShippingQueryOption
- func WithAnswerShippingQueryShippingOptions(value []ShippingOption) AnswerShippingQueryOption
- func WithAnswerShippingQueryShippingQueryID(value string) AnswerShippingQueryOption
- type AnswerShippingQueryParams
- type AnswerWebAppQueryOption
- type AnswerWebAppQueryParams
- type ApproveChatJoinRequestOption
- type ApproveChatJoinRequestParams
- type ApproveSuggestedPostOption
- type ApproveSuggestedPostParams
- type Audio
- type BackgroundFill
- type BackgroundFillFreeformGradient
- type BackgroundFillGradient
- type BackgroundFillSolid
- type BackgroundType
- type BackgroundTypeChatTheme
- type BackgroundTypeFill
- type BackgroundTypePattern
- type BackgroundTypeWallpaper
- type BanChatMemberOption
- type BanChatMemberParams
- type BanChatSenderChatOption
- type BanChatSenderChatParams
- type Birthdate
- 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 BusinessBotRights
- type BusinessConnection
- type BusinessIntro
- type BusinessLocation
- type BusinessMessagesDeleted
- type BusinessOpeningHours
- type BusinessOpeningHoursInterval
- type CallbackGame
- type CallbackQuery
- type Chat
- type ChatAdministratorRights
- type ChatBackground
- type ChatBoost
- type ChatBoostAdded
- type ChatBoostRemoved
- type ChatBoostSource
- type ChatBoostSourceGiftCode
- type ChatBoostSourceGiveaway
- type ChatBoostSourcePremium
- type ChatBoostUpdated
- type ChatFullInfo
- type ChatInviteLink
- type ChatJoinRequest
- type ChatLocation
- type ChatMember
- type ChatMemberAdministrator
- type ChatMemberBanned
- type ChatMemberLeft
- type ChatMemberMember
- type ChatMemberOwner
- type ChatMemberRestricted
- type ChatMemberUpdated
- type ChatOwnerChanged
- type ChatOwnerLeft
- type ChatPermissions
- type ChatPhoto
- type ChatShared
- type Checklist
- type ChecklistTask
- type ChecklistTasksAdded
- type ChecklistTasksDone
- type ChosenInlineResult
- type Client
- func (c *Client) AddStickerToSet(ctx context.Context, params *AddStickerToSetParams) (ret bool, err error)
- func (c *Client) AnswerCallbackQuery(ctx context.Context, params *AnswerCallbackQueryParams) (ret bool, err error)
- func (c *Client) AnswerInlineQuery(ctx context.Context, params *AnswerInlineQueryParams) (ret bool, err error)
- func (c *Client) AnswerPreCheckoutQuery(ctx context.Context, params *AnswerPreCheckoutQueryParams) (ret bool, err error)
- func (c *Client) AnswerShippingQuery(ctx context.Context, params *AnswerShippingQueryParams) (ret bool, err error)
- func (c *Client) AnswerWebAppQuery(ctx context.Context, params *AnswerWebAppQueryParams) (ret *SentWebAppMessage, err error)
- func (c *Client) ApproveChatJoinRequest(ctx context.Context, params *ApproveChatJoinRequestParams) (ret bool, err error)
- func (c *Client) ApproveSuggestedPost(ctx context.Context, params *ApproveSuggestedPostParams) (ret bool, err error)
- func (c *Client) BanChatMember(ctx context.Context, params *BanChatMemberParams) (ret bool, err error)
- func (c *Client) BanChatSenderChat(ctx context.Context, params *BanChatSenderChatParams) (ret bool, err error)
- func (c *Client) Close(ctx context.Context, params *CloseParams) (ret bool, err error)
- func (c *Client) CloseForumTopic(ctx context.Context, params *CloseForumTopicParams) (ret bool, err error)
- func (c *Client) CloseGeneralForumTopic(ctx context.Context, params *CloseGeneralForumTopicParams) (ret bool, err error)
- func (c *Client) ConvertGiftToStars(ctx context.Context, params *ConvertGiftToStarsParams) (ret bool, err error)
- func (c *Client) CopyMessage(ctx context.Context, params *CopyMessageParams) (ret *MessageId, err error)
- func (c *Client) CopyMessages(ctx context.Context, params *CopyMessagesParams) (ret []MessageId, err error)
- func (c *Client) CreateChatInviteLink(ctx context.Context, params *CreateChatInviteLinkParams) (ret *ChatInviteLink, err error)
- func (c *Client) CreateChatSubscriptionInviteLink(ctx context.Context, params *CreateChatSubscriptionInviteLinkParams) (ret *ChatInviteLink, err error)
- func (c *Client) CreateForumTopic(ctx context.Context, params *CreateForumTopicParams) (ret *ForumTopic, err error)
- func (c *Client) CreateInvoiceLink(ctx context.Context, params *CreateInvoiceLinkParams) (ret string, err error)
- func (c *Client) CreateNewStickerSet(ctx context.Context, params *CreateNewStickerSetParams) (ret bool, err error)
- func (c *Client) DeclineChatJoinRequest(ctx context.Context, params *DeclineChatJoinRequestParams) (ret bool, err error)
- func (c *Client) DeclineSuggestedPost(ctx context.Context, params *DeclineSuggestedPostParams) (ret bool, err error)
- func (c *Client) DeleteBusinessMessages(ctx context.Context, params *DeleteBusinessMessagesParams) (ret bool, err error)
- func (c *Client) DeleteChatPhoto(ctx context.Context, params *DeleteChatPhotoParams) (ret bool, err error)
- func (c *Client) DeleteChatStickerSet(ctx context.Context, params *DeleteChatStickerSetParams) (ret bool, err error)
- func (c *Client) DeleteForumTopic(ctx context.Context, params *DeleteForumTopicParams) (ret bool, err error)
- func (c *Client) DeleteMessage(ctx context.Context, params *DeleteMessageParams) (ret bool, err error)
- func (c *Client) DeleteMessages(ctx context.Context, params *DeleteMessagesParams) (ret bool, err error)
- func (c *Client) DeleteMyCommands(ctx context.Context, params *DeleteMyCommandsParams) (ret bool, err error)
- func (c *Client) DeleteStickerFromSet(ctx context.Context, params *DeleteStickerFromSetParams) (ret bool, err error)
- func (c *Client) DeleteStickerSet(ctx context.Context, params *DeleteStickerSetParams) (ret bool, err error)
- func (c *Client) DeleteStory(ctx context.Context, params *DeleteStoryParams) (ret bool, err error)
- func (c *Client) DeleteWebhook(ctx context.Context, params *DeleteWebhookParams) (ret bool, err error)
- func (c *Client) EditChatInviteLink(ctx context.Context, params *EditChatInviteLinkParams) (ret *ChatInviteLink, err error)
- func (c *Client) EditChatSubscriptionInviteLink(ctx context.Context, params *EditChatSubscriptionInviteLinkParams) (ret *ChatInviteLink, err error)
- func (c *Client) EditForumTopic(ctx context.Context, params *EditForumTopicParams) (ret bool, err error)
- func (c *Client) EditGeneralForumTopic(ctx context.Context, params *EditGeneralForumTopicParams) (ret bool, err error)
- func (c *Client) EditMessageCaption(ctx context.Context, params *EditMessageCaptionParams) (ret *Message, err error)
- func (c *Client) EditMessageChecklist(ctx context.Context, params *EditMessageChecklistParams) (ret *Message, err error)
- func (c *Client) EditMessageLiveLocation(ctx context.Context, params *EditMessageLiveLocationParams) (ret *Message, err error)
- func (c *Client) EditMessageMedia(ctx context.Context, params *EditMessageMediaParams) (ret *Message, err error)
- func (c *Client) EditMessageReplyMarkup(ctx context.Context, params *EditMessageReplyMarkupParams) (ret *Message, err error)
- func (c *Client) EditMessageText(ctx context.Context, params *EditMessageTextParams) (ret *Message, err error)
- func (c *Client) EditStory(ctx context.Context, params *EditStoryParams) (ret *Story, err error)
- func (c *Client) EditUserStarSubscription(ctx context.Context, params *EditUserStarSubscriptionParams) (ret bool, err error)
- func (c *Client) ExportChatInviteLink(ctx context.Context, params *ExportChatInviteLinkParams) (ret string, err error)
- func (c *Client) ForwardMessage(ctx context.Context, params *ForwardMessageParams) (ret *Message, err error)
- func (c *Client) ForwardMessages(ctx context.Context, params *ForwardMessagesParams) (ret []MessageId, err error)
- func (c *Client) GetAvailableGifts(ctx context.Context, params *GetAvailableGiftsParams) (ret *Gifts, err error)
- func (c *Client) GetBusinessAccountGifts(ctx context.Context, params *GetBusinessAccountGiftsParams) (ret *OwnedGifts, err error)
- func (c *Client) GetBusinessAccountStarBalance(ctx context.Context, params *GetBusinessAccountStarBalanceParams) (ret *StarAmount, err error)
- func (c *Client) GetBusinessConnection(ctx context.Context, params *GetBusinessConnectionParams) (ret *BusinessConnection, err error)
- func (c *Client) GetChat(ctx context.Context, params *GetChatParams) (ret *ChatFullInfo, err error)
- func (c *Client) GetChatAdministrators(ctx context.Context, params *GetChatAdministratorsParams) (ret []ChatMember, err error)
- func (c *Client) GetChatGifts(ctx context.Context, params *GetChatGiftsParams) (ret *OwnedGifts, err error)
- func (c *Client) GetChatMember(ctx context.Context, params *GetChatMemberParams) (ret *ChatMember, err error)
- func (c *Client) GetChatMemberCount(ctx context.Context, params *GetChatMemberCountParams) (ret int64, err error)
- func (c *Client) GetChatMenuButton(ctx context.Context, params *GetChatMenuButtonParams) (ret *MenuButton, err error)
- func (c *Client) GetCustomEmojiStickers(ctx context.Context, params *GetCustomEmojiStickersParams) (ret []Sticker, err error)
- func (c *Client) GetFile(ctx context.Context, params *GetFileParams) (ret *File, err error)
- func (c *Client) GetForumTopicIconStickers(ctx context.Context, params *GetForumTopicIconStickersParams) (ret []Sticker, err error)
- func (c *Client) GetGameHighScores(ctx context.Context, params *GetGameHighScoresParams) (ret []GameHighScore, err error)
- func (c *Client) GetMe(ctx context.Context, params *GetMeParams) (ret *User, err error)
- func (c *Client) GetMyCommands(ctx context.Context, params *GetMyCommandsParams) (ret []BotCommand, err error)
- func (c *Client) GetMyDefaultAdministratorRights(ctx context.Context, params *GetMyDefaultAdministratorRightsParams) (ret *ChatAdministratorRights, err error)
- func (c *Client) GetMyDescription(ctx context.Context, params *GetMyDescriptionParams) (ret *BotDescription, err error)
- func (c *Client) GetMyName(ctx context.Context, params *GetMyNameParams) (ret *BotName, err error)
- func (c *Client) GetMyShortDescription(ctx context.Context, params *GetMyShortDescriptionParams) (ret *BotShortDescription, err error)
- func (c *Client) GetMyStarBalance(ctx context.Context, params *GetMyStarBalanceParams) (ret *StarAmount, err error)
- func (c *Client) GetStarTransactions(ctx context.Context, params *GetStarTransactionsParams) (ret *StarTransactions, err error)
- func (c *Client) GetStickerSet(ctx context.Context, params *GetStickerSetParams) (ret *StickerSet, err error)
- func (c *Client) GetUpdates(ctx context.Context, params *GetUpdatesParams) (ret []Update, err error)
- func (c *Client) GetUserChatBoosts(ctx context.Context, params *GetUserChatBoostsParams) (ret *UserChatBoosts, err error)
- func (c *Client) GetUserGifts(ctx context.Context, params *GetUserGiftsParams) (ret *OwnedGifts, err error)
- func (c *Client) GetUserProfileAudios(ctx context.Context, params *GetUserProfileAudiosParams) (ret *UserProfileAudios, err error)
- func (c *Client) GetUserProfilePhotos(ctx context.Context, params *GetUserProfilePhotosParams) (ret *UserProfilePhotos, err error)
- func (c *Client) GetWebhookInfo(ctx context.Context, params *GetWebhookInfoParams) (ret *WebhookInfo, err error)
- func (c *Client) GiftPremiumSubscription(ctx context.Context, params *GiftPremiumSubscriptionParams) (ret bool, err error)
- func (c *Client) HideGeneralForumTopic(ctx context.Context, params *HideGeneralForumTopicParams) (ret bool, err error)
- func (c *Client) ID() int64
- func (c *Client) LeaveChat(ctx context.Context, params *LeaveChatParams) (ret bool, err error)
- func (c *Client) LocalAddr() net.Addr
- func (c *Client) LogOut(ctx context.Context, params *LogOutParams) (ret bool, err error)
- func (c *Client) Option(opts ...ClientOption) (previous ClientOption)
- func (c *Client) PinChatMessage(ctx context.Context, params *PinChatMessageParams) (ret bool, err error)
- func (c *Client) PostStory(ctx context.Context, params *PostStoryParams) (ret *Story, err error)
- func (c *Client) PromoteChatMember(ctx context.Context, params *PromoteChatMemberParams) (ret bool, err error)
- func (c *Client) Raw(ctx context.Context, method string, reader io.Reader, contentType ...string) (json.RawMessage, error)
- func (c *Client) ReadBusinessMessage(ctx context.Context, params *ReadBusinessMessageParams) (ret bool, err error)
- func (c *Client) RefundStarPayment(ctx context.Context, params *RefundStarPaymentParams) (ret bool, err error)
- func (c *Client) RemoteAddr() net.Addr
- func (c *Client) RemoveBusinessAccountProfilePhoto(ctx context.Context, params *RemoveBusinessAccountProfilePhotoParams) (ret bool, err error)
- func (c *Client) RemoveChatVerification(ctx context.Context, params *RemoveChatVerificationParams) (ret bool, err error)
- func (c *Client) RemoveMyProfilePhoto(ctx context.Context, params *RemoveMyProfilePhotoParams) (ret bool, err error)
- func (c *Client) RemoveUserVerification(ctx context.Context, params *RemoveUserVerificationParams) (ret bool, err error)
- func (c *Client) ReopenForumTopic(ctx context.Context, params *ReopenForumTopicParams) (ret bool, err error)
- func (c *Client) ReopenGeneralForumTopic(ctx context.Context, params *ReopenGeneralForumTopicParams) (ret bool, err error)
- func (c *Client) ReplaceStickerInSet(ctx context.Context, params *ReplaceStickerInSetParams) (ret bool, err error)
- func (c *Client) RepostStory(ctx context.Context, params *RepostStoryParams) (ret *Story, err error)
- func (c *Client) RestrictChatMember(ctx context.Context, params *RestrictChatMemberParams) (ret bool, err error)
- func (c *Client) RevokeChatInviteLink(ctx context.Context, params *RevokeChatInviteLinkParams) (ret *ChatInviteLink, err error)
- func (c *Client) Router() *Router
- func (c *Client) SavePreparedInlineMessage(ctx context.Context, params *SavePreparedInlineMessageParams) (ret *PreparedInlineMessage, err error)
- func (c *Client) SendAnimation(ctx context.Context, params *SendAnimationParams) (ret *Message, err error)
- func (c *Client) SendAudio(ctx context.Context, params *SendAudioParams) (ret *Message, err error)
- func (c *Client) SendChatAction(ctx context.Context, params *SendChatActionParams) (ret bool, err error)
- func (c *Client) SendChecklist(ctx context.Context, params *SendChecklistParams) (ret *Message, err error)
- func (c *Client) SendContact(ctx context.Context, params *SendContactParams) (ret *Message, err error)
- func (c *Client) SendDice(ctx context.Context, params *SendDiceParams) (ret *Message, err error)
- func (c *Client) SendDocument(ctx context.Context, params *SendDocumentParams) (ret *Message, err error)
- func (c *Client) SendGame(ctx context.Context, params *SendGameParams) (ret *Message, err error)
- func (c *Client) SendGift(ctx context.Context, params *SendGiftParams) (ret bool, err error)
- func (c *Client) SendInvoice(ctx context.Context, params *SendInvoiceParams) (ret *Message, err error)
- func (c *Client) SendLocation(ctx context.Context, params *SendLocationParams) (ret *Message, err error)
- func (c *Client) SendMediaGroup(ctx context.Context, params *SendMediaGroupParams) (ret []Message, err error)
- func (c *Client) SendMessage(ctx context.Context, params *SendMessageParams) (ret *Message, err error)
- func (c *Client) SendMessageDraft(ctx context.Context, params *SendMessageDraftParams) (ret bool, err error)
- func (c *Client) SendPaidMedia(ctx context.Context, params *SendPaidMediaParams) (ret *Message, err error)
- func (c *Client) SendPhoto(ctx context.Context, params *SendPhotoParams) (ret *Message, err error)
- func (c *Client) SendPoll(ctx context.Context, params *SendPollParams) (ret *Message, err error)
- func (c *Client) SendSticker(ctx context.Context, params *SendStickerParams) (ret *Message, err error)
- func (c *Client) SendVenue(ctx context.Context, params *SendVenueParams) (ret *Message, err error)
- func (c *Client) SendVideo(ctx context.Context, params *SendVideoParams) (ret *Message, err error)
- func (c *Client) SendVideoNote(ctx context.Context, params *SendVideoNoteParams) (ret *Message, err error)
- func (c *Client) SendVoice(ctx context.Context, params *SendVoiceParams) (ret *Message, err error)
- func (c *Client) SetBusinessAccountBio(ctx context.Context, params *SetBusinessAccountBioParams) (ret bool, err error)
- func (c *Client) SetBusinessAccountGiftSettings(ctx context.Context, params *SetBusinessAccountGiftSettingsParams) (ret bool, err error)
- func (c *Client) SetBusinessAccountName(ctx context.Context, params *SetBusinessAccountNameParams) (ret bool, err error)
- func (c *Client) SetBusinessAccountProfilePhoto(ctx context.Context, params *SetBusinessAccountProfilePhotoParams) (ret bool, err error)
- func (c *Client) SetBusinessAccountUsername(ctx context.Context, params *SetBusinessAccountUsernameParams) (ret bool, err error)
- func (c *Client) SetChatAdministratorCustomTitle(ctx context.Context, params *SetChatAdministratorCustomTitleParams) (ret bool, err error)
- func (c *Client) SetChatDescription(ctx context.Context, params *SetChatDescriptionParams) (ret bool, err error)
- func (c *Client) SetChatMemberTag(ctx context.Context, params *SetChatMemberTagParams) (ret bool, err error)
- func (c *Client) SetChatMenuButton(ctx context.Context, params *SetChatMenuButtonParams) (ret bool, err error)
- func (c *Client) SetChatPermissions(ctx context.Context, params *SetChatPermissionsParams) (ret bool, err error)
- func (c *Client) SetChatPhoto(ctx context.Context, params *SetChatPhotoParams) (ret bool, err error)
- func (c *Client) SetChatStickerSet(ctx context.Context, params *SetChatStickerSetParams) (ret bool, err error)
- func (c *Client) SetChatTitle(ctx context.Context, params *SetChatTitleParams) (ret bool, err error)
- func (c *Client) SetCustomEmojiStickerSetThumbnail(ctx context.Context, params *SetCustomEmojiStickerSetThumbnailParams) (ret bool, err error)
- func (c *Client) SetGameScore(ctx context.Context, params *SetGameScoreParams) (ret *Message, err error)
- func (c *Client) SetMessageReaction(ctx context.Context, params *SetMessageReactionParams) (ret bool, err error)
- func (c *Client) SetMyCommands(ctx context.Context, params *SetMyCommandsParams) (ret bool, err error)
- func (c *Client) SetMyDefaultAdministratorRights(ctx context.Context, params *SetMyDefaultAdministratorRightsParams) (ret bool, err error)
- func (c *Client) SetMyDescription(ctx context.Context, params *SetMyDescriptionParams) (ret bool, err error)
- func (c *Client) SetMyName(ctx context.Context, params *SetMyNameParams) (ret bool, err error)
- func (c *Client) SetMyProfilePhoto(ctx context.Context, params *SetMyProfilePhotoParams) (ret bool, err error)
- func (c *Client) SetMyShortDescription(ctx context.Context, params *SetMyShortDescriptionParams) (ret bool, err error)
- func (c *Client) SetPassportDataErrors(ctx context.Context, params *SetPassportDataErrorsParams) (ret bool, err error)
- func (c *Client) SetRouter(r *Router)
- func (c *Client) SetStickerEmojiList(ctx context.Context, params *SetStickerEmojiListParams) (ret bool, err error)
- func (c *Client) SetStickerKeywords(ctx context.Context, params *SetStickerKeywordsParams) (ret bool, err error)
- func (c *Client) SetStickerMaskPosition(ctx context.Context, params *SetStickerMaskPositionParams) (ret bool, err error)
- func (c *Client) SetStickerPositionInSet(ctx context.Context, params *SetStickerPositionInSetParams) (ret bool, err error)
- func (c *Client) SetStickerSetThumbnail(ctx context.Context, params *SetStickerSetThumbnailParams) (ret bool, err error)
- func (c *Client) SetStickerSetTitle(ctx context.Context, params *SetStickerSetTitleParams) (ret bool, err error)
- func (c *Client) SetUserEmojiStatus(ctx context.Context, params *SetUserEmojiStatusParams) (ret bool, err error)
- func (c *Client) SetWebhook(ctx context.Context, params *SetWebhookParams) (ret bool, err error)
- func (c *Client) Start(ctx context.Context, params *GetUpdatesParams) error
- func (c *Client) Stop()
- func (c *Client) StopMessageLiveLocation(ctx context.Context, params *StopMessageLiveLocationParams) (ret *Message, err error)
- func (c *Client) StopPoll(ctx context.Context, params *StopPollParams) (ret *Poll, err error)
- func (c *Client) Token() string
- func (c *Client) TransferBusinessAccountStars(ctx context.Context, params *TransferBusinessAccountStarsParams) (ret bool, err error)
- func (c *Client) TransferGift(ctx context.Context, params *TransferGiftParams) (ret bool, err error)
- func (c *Client) UnbanChatMember(ctx context.Context, params *UnbanChatMemberParams) (ret bool, err error)
- func (c *Client) UnbanChatSenderChat(ctx context.Context, params *UnbanChatSenderChatParams) (ret bool, err error)
- func (c *Client) UnhideGeneralForumTopic(ctx context.Context, params *UnhideGeneralForumTopicParams) (ret bool, err error)
- func (c *Client) UnpinAllChatMessages(ctx context.Context, params *UnpinAllChatMessagesParams) (ret bool, err error)
- func (c *Client) UnpinAllForumTopicMessages(ctx context.Context, params *UnpinAllForumTopicMessagesParams) (ret bool, err error)
- func (c *Client) UnpinAllGeneralForumTopicMessages(ctx context.Context, params *UnpinAllGeneralForumTopicMessagesParams) (ret bool, err error)
- func (c *Client) UnpinChatMessage(ctx context.Context, params *UnpinChatMessageParams) (ret bool, err error)
- func (c *Client) UpgradeGift(ctx context.Context, params *UpgradeGiftParams) (ret bool, err error)
- func (c *Client) UploadStickerFile(ctx context.Context, params *UploadStickerFileParams) (ret *File, err error)
- func (c *Client) VerifyChat(ctx context.Context, params *VerifyChatParams) (ret bool, err error)
- func (c *Client) VerifyUser(ctx context.Context, params *VerifyUserParams) (ret bool, err error)
- type ClientOption
- type CloseForumTopicOption
- type CloseForumTopicParams
- type CloseGeneralForumTopicOption
- type CloseGeneralForumTopicParams
- type CloseOption
- type CloseParams
- type Contact
- type Context
- func (ctx *Context) AddStickerToSet(userID int64, name string, sticker InputSticker, opts ...AddStickerToSetOption) error
- func (ctx *Context) AnswerCallbackQuery(opts ...AnswerCallbackQueryOption) error
- func (ctx *Context) AnswerInlineQuery(results []InlineQueryResult, opts ...AnswerInlineQueryOption) error
- func (ctx *Context) AnswerPreCheckoutQuery(ok bool, opts ...AnswerPreCheckoutQueryOption) error
- func (ctx *Context) AnswerShippingQuery(ok bool, opts ...AnswerShippingQueryOption) error
- func (ctx *Context) AnswerWebAppQuery(webAppQueryID string, result InlineQueryResult, ...) error
- func (ctx *Context) ApproveChatJoinRequest(userID int64, opts ...ApproveChatJoinRequestOption) error
- func (ctx *Context) ApproveSuggestedPost(messageID int64, opts ...ApproveSuggestedPostOption) error
- func (ctx *Context) BanChatMember(userID int64, opts ...BanChatMemberOption) error
- func (ctx *Context) BanChatSenderChat(senderChatID int64, opts ...BanChatSenderChatOption) error
- func (ctx *Context) Chat() *Chat
- func (ctx *Context) Client() *Client
- func (ctx *Context) Close(opts ...CloseOption) error
- func (ctx *Context) CloseForumTopic(messageThreadID int64, opts ...CloseForumTopicOption) error
- func (ctx *Context) CloseGeneralForumTopic(opts ...CloseGeneralForumTopicOption) error
- func (ctx *Context) Context() context.Context
- func (ctx *Context) ConvertGiftToStars(ownedGiftID string, opts ...ConvertGiftToStarsOption) error
- func (ctx *Context) CopyMessage(fromChatID string, messageID int64, opts ...CopyMessageOption) error
- func (ctx *Context) CopyMessages(fromChatID string, messageIDs []int64, opts ...CopyMessagesOption) error
- func (ctx *Context) CreateChatInviteLink(opts ...CreateChatInviteLinkOption) error
- func (ctx *Context) CreateChatSubscriptionInviteLink(subscriptionPeriod int64, subscriptionPrice int64, ...) error
- func (ctx *Context) CreateForumTopic(name string, opts ...CreateForumTopicOption) error
- func (ctx *Context) CreateInvoiceLink(title string, description string, payload string, currency string, ...) error
- func (ctx *Context) CreateNewStickerSet(userID int64, name string, title string, stickers []InputSticker, ...) error
- func (ctx *Context) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) DeclineChatJoinRequest(userID int64, opts ...DeclineChatJoinRequestOption) error
- func (ctx *Context) DeclineSuggestedPost(messageID int64, opts ...DeclineSuggestedPostOption) error
- func (ctx *Context) DeleteBusinessMessages(messageIDs []int64, opts ...DeleteBusinessMessagesOption) error
- func (ctx *Context) DeleteChatPhoto(opts ...DeleteChatPhotoOption) error
- func (ctx *Context) DeleteChatStickerSet(opts ...DeleteChatStickerSetOption) error
- func (ctx *Context) DeleteForumTopic(messageThreadID int64, opts ...DeleteForumTopicOption) error
- func (ctx *Context) DeleteMessage(messageID int64, opts ...DeleteMessageOption) error
- func (ctx *Context) DeleteMessages(messageIDs []int64, opts ...DeleteMessagesOption) error
- func (ctx *Context) DeleteMyCommands(opts ...DeleteMyCommandsOption) error
- func (ctx *Context) DeleteStickerFromSet(sticker string, opts ...DeleteStickerFromSetOption) error
- func (ctx *Context) DeleteStickerSet(name string, opts ...DeleteStickerSetOption) error
- func (ctx *Context) DeleteStory(storyID int64, opts ...DeleteStoryOption) error
- func (ctx *Context) DeleteWebhook(opts ...DeleteWebhookOption) error
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) EditChatInviteLink(inviteLink string, opts ...EditChatInviteLinkOption) error
- func (ctx *Context) EditChatSubscriptionInviteLink(inviteLink string, opts ...EditChatSubscriptionInviteLinkOption) error
- func (ctx *Context) EditForumTopic(messageThreadID int64, opts ...EditForumTopicOption) error
- func (ctx *Context) EditGeneralForumTopic(name string, opts ...EditGeneralForumTopicOption) error
- func (ctx *Context) EditMessageCaption(opts ...EditMessageCaptionOption) error
- func (ctx *Context) EditMessageChecklist(messageID int64, checklist InputChecklist, opts ...EditMessageChecklistOption) error
- func (ctx *Context) EditMessageLiveLocation(latitude float64, longitude float64, opts ...EditMessageLiveLocationOption) error
- func (ctx *Context) EditMessageMedia(media InputMedia, opts ...EditMessageMediaOption) error
- func (ctx *Context) EditMessageReplyMarkup(opts ...EditMessageReplyMarkupOption) error
- func (ctx *Context) EditMessageText(text string, opts ...EditMessageTextOption) error
- func (ctx *Context) EditStory(storyID int64, content InputStoryContent, opts ...EditStoryOption) error
- func (ctx *Context) EditUserStarSubscription(userID int64, telegramPaymentChargeID string, isCanceled bool, ...) error
- func (ctx *Context) Err() error
- func (ctx *Context) ExportChatInviteLink(opts ...ExportChatInviteLinkOption) error
- func (ctx *Context) ForwardMessage(fromChatID string, messageID int64, opts ...ForwardMessageOption) error
- func (ctx *Context) ForwardMessages(fromChatID string, messageIDs []int64, opts ...ForwardMessagesOption) error
- func (ctx *Context) GetAvailableGifts(opts ...GetAvailableGiftsOption) error
- func (ctx *Context) GetBusinessAccountGifts(opts ...GetBusinessAccountGiftsOption) error
- func (ctx *Context) GetBusinessAccountStarBalance(opts ...GetBusinessAccountStarBalanceOption) error
- func (ctx *Context) GetBusinessConnection(opts ...GetBusinessConnectionOption) error
- func (ctx *Context) GetChat(opts ...GetChatOption) error
- func (ctx *Context) GetChatAdministrators(opts ...GetChatAdministratorsOption) error
- func (ctx *Context) GetChatGifts(opts ...GetChatGiftsOption) error
- func (ctx *Context) GetChatMember(userID int64, opts ...GetChatMemberOption) error
- func (ctx *Context) GetChatMemberCount(opts ...GetChatMemberCountOption) error
- func (ctx *Context) GetChatMenuButton(opts ...GetChatMenuButtonOption) error
- func (ctx *Context) GetCustomEmojiStickers(customEmojiIDs []string, opts ...GetCustomEmojiStickersOption) error
- func (ctx *Context) GetFile(fileID string, opts ...GetFileOption) error
- func (ctx *Context) GetForumTopicIconStickers(opts ...GetForumTopicIconStickersOption) error
- func (ctx *Context) GetGameHighScores(userID int64, opts ...GetGameHighScoresOption) error
- func (ctx *Context) GetMe(opts ...GetMeOption) error
- func (ctx *Context) GetMyCommands(opts ...GetMyCommandsOption) error
- func (ctx *Context) GetMyDefaultAdministratorRights(opts ...GetMyDefaultAdministratorRightsOption) error
- func (ctx *Context) GetMyDescription(opts ...GetMyDescriptionOption) error
- func (ctx *Context) GetMyName(opts ...GetMyNameOption) error
- func (ctx *Context) GetMyShortDescription(opts ...GetMyShortDescriptionOption) error
- func (ctx *Context) GetMyStarBalance(opts ...GetMyStarBalanceOption) error
- func (ctx *Context) GetStarTransactions(opts ...GetStarTransactionsOption) error
- func (ctx *Context) GetStickerSet(name string, opts ...GetStickerSetOption) error
- func (ctx *Context) GetUpdates(opts ...GetUpdatesOption) error
- func (ctx *Context) GetUserChatBoosts(userID int64, opts ...GetUserChatBoostsOption) error
- func (ctx *Context) GetUserGifts(userID int64, opts ...GetUserGiftsOption) error
- func (ctx *Context) GetUserProfileAudios(userID int64, opts ...GetUserProfileAudiosOption) error
- func (ctx *Context) GetUserProfilePhotos(userID int64, opts ...GetUserProfilePhotosOption) error
- func (ctx *Context) GetWebhookInfo(opts ...GetWebhookInfoOption) error
- func (ctx *Context) GiftPremiumSubscription(userID int64, monthCount int64, starCount int64, ...) error
- func (ctx *Context) HideGeneralForumTopic(opts ...HideGeneralForumTopicOption) error
- func (ctx *Context) LeaveChat(opts ...LeaveChatOption) error
- func (ctx *Context) LogOut(opts ...LogOutOption) error
- func (ctx *Context) Message() *Message
- func (ctx *Context) Payload() string
- func (ctx *Context) PinChatMessage(messageID int64, opts ...PinChatMessageOption) error
- func (ctx *Context) PostStory(content InputStoryContent, activePeriod int64, opts ...PostStoryOption) error
- func (ctx *Context) PromoteChatMember(userID int64, opts ...PromoteChatMemberOption) error
- func (ctx *Context) ReadBusinessMessage(messageID int64, opts ...ReadBusinessMessageOption) error
- func (ctx *Context) RefundStarPayment(userID int64, telegramPaymentChargeID string, opts ...RefundStarPaymentOption) error
- func (ctx *Context) RemoveBusinessAccountProfilePhoto(opts ...RemoveBusinessAccountProfilePhotoOption) error
- func (ctx *Context) RemoveChatVerification(opts ...RemoveChatVerificationOption) error
- func (ctx *Context) RemoveMyProfilePhoto(opts ...RemoveMyProfilePhotoOption) error
- func (ctx *Context) RemoveUserVerification(userID int64, opts ...RemoveUserVerificationOption) error
- func (ctx *Context) ReopenForumTopic(messageThreadID int64, opts ...ReopenForumTopicOption) error
- func (ctx *Context) ReopenGeneralForumTopic(opts ...ReopenGeneralForumTopicOption) error
- func (ctx *Context) ReplaceStickerInSet(userID int64, name string, oldSticker string, sticker InputSticker, ...) error
- func (ctx *Context) RepostStory(fromChatID int64, fromStoryID int64, activePeriod int64, ...) error
- func (ctx *Context) RestrictChatMember(userID int64, permissions ChatPermissions, opts ...RestrictChatMemberOption) error
- func (ctx *Context) RevokeChatInviteLink(inviteLink string, opts ...RevokeChatInviteLinkOption) error
- func (ctx *Context) SavePreparedInlineMessage(userID int64, result InlineQueryResult, ...) error
- func (ctx *Context) SendAnimation(animation InputFile, opts ...SendAnimationOption) error
- func (ctx *Context) SendAudio(audio InputFile, opts ...SendAudioOption) error
- func (ctx *Context) SendChatAction(action string, opts ...SendChatActionOption) error
- func (ctx *Context) SendChecklist(checklist InputChecklist, opts ...SendChecklistOption) error
- func (ctx *Context) SendContact(phoneNumber string, firstName string, opts ...SendContactOption) error
- func (ctx *Context) SendDice(opts ...SendDiceOption) error
- func (ctx *Context) SendDocument(document InputFile, opts ...SendDocumentOption) error
- func (ctx *Context) SendGame(gameShortName string, opts ...SendGameOption) error
- func (ctx *Context) SendGift(giftID string, opts ...SendGiftOption) error
- func (ctx *Context) SendInvoice(title string, description string, payload string, currency string, ...) error
- func (ctx *Context) SendLocation(latitude float64, longitude float64, opts ...SendLocationOption) error
- func (ctx *Context) SendMediaGroup(media []InputMedia, opts ...SendMediaGroupOption) error
- func (ctx *Context) SendMessage(text string, opts ...SendMessageOption) error
- func (ctx *Context) SendMessageDraft(draftID int64, text string, opts ...SendMessageDraftOption) error
- func (ctx *Context) SendPaidMedia(starCount int64, media []InputPaidMedia, opts ...SendPaidMediaOption) error
- func (ctx *Context) SendPhoto(photo InputFile, opts ...SendPhotoOption) error
- func (ctx *Context) SendPoll(question string, options []InputPollOption, opts ...SendPollOption) error
- func (ctx *Context) SendSticker(sticker InputFile, opts ...SendStickerOption) error
- func (ctx *Context) SendVenue(latitude float64, longitude float64, title string, address string, ...) error
- func (ctx *Context) SendVideo(video InputFile, opts ...SendVideoOption) error
- func (ctx *Context) SendVideoNote(videoNote InputFile, opts ...SendVideoNoteOption) error
- func (ctx *Context) SendVoice(voice InputFile, opts ...SendVoiceOption) error
- func (ctx *Context) SetBusinessAccountBio(opts ...SetBusinessAccountBioOption) error
- func (ctx *Context) SetBusinessAccountGiftSettings(showGiftButton bool, acceptedGiftTypes AcceptedGiftTypes, ...) error
- func (ctx *Context) SetBusinessAccountName(firstName string, opts ...SetBusinessAccountNameOption) error
- func (ctx *Context) SetBusinessAccountProfilePhoto(photo InputProfilePhoto, opts ...SetBusinessAccountProfilePhotoOption) error
- func (ctx *Context) SetBusinessAccountUsername(opts ...SetBusinessAccountUsernameOption) error
- func (ctx *Context) SetChatAdministratorCustomTitle(userID int64, customTitle string, ...) error
- func (ctx *Context) SetChatDescription(opts ...SetChatDescriptionOption) error
- func (ctx *Context) SetChatMemberTag(userID int64, opts ...SetChatMemberTagOption) error
- func (ctx *Context) SetChatMenuButton(opts ...SetChatMenuButtonOption) error
- func (ctx *Context) SetChatPermissions(permissions ChatPermissions, opts ...SetChatPermissionsOption) error
- func (ctx *Context) SetChatPhoto(photo InputFile, opts ...SetChatPhotoOption) error
- func (ctx *Context) SetChatStickerSet(stickerSetName string, opts ...SetChatStickerSetOption) error
- func (ctx *Context) SetChatTitle(title string, opts ...SetChatTitleOption) error
- func (ctx *Context) SetCustomEmojiStickerSetThumbnail(name string, opts ...SetCustomEmojiStickerSetThumbnailOption) error
- func (ctx *Context) SetGameScore(userID int64, score int64, opts ...SetGameScoreOption) error
- func (ctx *Context) SetMessageReaction(messageID int64, opts ...SetMessageReactionOption) error
- func (ctx *Context) SetMyCommands(commands []BotCommand, opts ...SetMyCommandsOption) error
- func (ctx *Context) SetMyDefaultAdministratorRights(opts ...SetMyDefaultAdministratorRightsOption) error
- func (ctx *Context) SetMyDescription(opts ...SetMyDescriptionOption) error
- func (ctx *Context) SetMyName(opts ...SetMyNameOption) error
- func (ctx *Context) SetMyProfilePhoto(photo InputProfilePhoto, opts ...SetMyProfilePhotoOption) error
- func (ctx *Context) SetMyShortDescription(opts ...SetMyShortDescriptionOption) error
- func (ctx *Context) SetPassportDataErrors(userID int64, errors []PassportElementError, ...) error
- func (ctx *Context) SetStickerEmojiList(sticker string, emojiList []string, opts ...SetStickerEmojiListOption) error
- func (ctx *Context) SetStickerKeywords(sticker string, opts ...SetStickerKeywordsOption) error
- func (ctx *Context) SetStickerMaskPosition(sticker string, opts ...SetStickerMaskPositionOption) error
- func (ctx *Context) SetStickerPositionInSet(sticker string, position int64, opts ...SetStickerPositionInSetOption) error
- func (ctx *Context) SetStickerSetThumbnail(name string, userID int64, format string, opts ...SetStickerSetThumbnailOption) error
- func (ctx *Context) SetStickerSetTitle(name string, title string, opts ...SetStickerSetTitleOption) error
- func (ctx *Context) SetUserEmojiStatus(userID int64, opts ...SetUserEmojiStatusOption) error
- func (ctx *Context) SetValue(key, value any)
- func (ctx *Context) SetWebhook(uRL string, opts ...SetWebhookOption) error
- func (ctx *Context) StopMessageLiveLocation(opts ...StopMessageLiveLocationOption) error
- func (ctx *Context) StopPoll(messageID int64, opts ...StopPollOption) error
- func (ctx *Context) Text() string
- func (ctx *Context) TransferBusinessAccountStars(starCount int64, opts ...TransferBusinessAccountStarsOption) error
- func (ctx *Context) TransferGift(ownedGiftID string, newOwnerChatID int64, opts ...TransferGiftOption) error
- func (ctx *Context) UnbanChatMember(userID int64, opts ...UnbanChatMemberOption) error
- func (ctx *Context) UnbanChatSenderChat(senderChatID int64, opts ...UnbanChatSenderChatOption) error
- func (ctx *Context) UnhideGeneralForumTopic(opts ...UnhideGeneralForumTopicOption) error
- func (ctx *Context) UnpinAllChatMessages(opts ...UnpinAllChatMessagesOption) error
- func (ctx *Context) UnpinAllForumTopicMessages(messageThreadID int64, opts ...UnpinAllForumTopicMessagesOption) error
- func (ctx *Context) UnpinAllGeneralForumTopicMessages(opts ...UnpinAllGeneralForumTopicMessagesOption) error
- func (ctx *Context) UnpinChatMessage(opts ...UnpinChatMessageOption) error
- func (ctx *Context) Update() *Update
- func (ctx *Context) UpgradeGift(ownedGiftID string, opts ...UpgradeGiftOption) error
- func (ctx *Context) UploadStickerFile(userID int64, sticker InputFile, stickerFormat string, ...) error
- func (ctx *Context) User() *User
- func (ctx *Context) Value(key any) any
- func (ctx *Context) VerifyChat(opts ...VerifyChatOption) error
- func (ctx *Context) VerifyUser(userID int64, opts ...VerifyUserOption) error
- type ConvertGiftToStarsOption
- type ConvertGiftToStarsParams
- type CopyMessageOption
- func WithCopyMessageAllowPaidBroadcast(value bool) CopyMessageOption
- func WithCopyMessageCaption(value string) CopyMessageOption
- func WithCopyMessageCaptionEntities(value []MessageEntity) CopyMessageOption
- func WithCopyMessageChatID(value string) CopyMessageOption
- func WithCopyMessageDirectMessagesTopicID(value int64) CopyMessageOption
- func WithCopyMessageDisableNotification(value bool) CopyMessageOption
- func WithCopyMessageFromChatID(value string) CopyMessageOption
- func WithCopyMessageMessageEffectID(value string) CopyMessageOption
- func WithCopyMessageMessageID(value int64) CopyMessageOption
- func WithCopyMessageMessageThreadID(value int64) CopyMessageOption
- func WithCopyMessageParseMode(value string) CopyMessageOption
- func WithCopyMessageProtectContent(value bool) CopyMessageOption
- func WithCopyMessageReplyMarkup(value *ReplyMarkup) CopyMessageOption
- func WithCopyMessageReplyParameters(value *ReplyParameters) CopyMessageOption
- func WithCopyMessageShowCaptionAboveMedia(value bool) CopyMessageOption
- func WithCopyMessageSuggestedPostParameters(value *SuggestedPostParameters) CopyMessageOption
- func WithCopyMessageVideoStartTimestamp(value int64) CopyMessageOption
- type CopyMessageParams
- type CopyMessagesOption
- func WithCopyMessagesChatID(value string) CopyMessagesOption
- func WithCopyMessagesDirectMessagesTopicID(value int64) CopyMessagesOption
- func WithCopyMessagesDisableNotification(value bool) CopyMessagesOption
- func WithCopyMessagesFromChatID(value string) CopyMessagesOption
- func WithCopyMessagesMessageIDs(value []int64) CopyMessagesOption
- func WithCopyMessagesMessageThreadID(value int64) CopyMessagesOption
- func WithCopyMessagesProtectContent(value bool) CopyMessagesOption
- func WithCopyMessagesRemoveCaption(value bool) CopyMessagesOption
- type CopyMessagesParams
- type CopyTextButton
- type CreateChatInviteLinkOption
- func WithCreateChatInviteLinkChatID(value string) CreateChatInviteLinkOption
- func WithCreateChatInviteLinkCreatesJoinRequest(value bool) CreateChatInviteLinkOption
- func WithCreateChatInviteLinkExpireDate(value int64) CreateChatInviteLinkOption
- func WithCreateChatInviteLinkMemberLimit(value int64) CreateChatInviteLinkOption
- func WithCreateChatInviteLinkName(value string) CreateChatInviteLinkOption
- type CreateChatInviteLinkParams
- type CreateChatSubscriptionInviteLinkOption
- func WithCreateChatSubscriptionInviteLinkChatID(value string) CreateChatSubscriptionInviteLinkOption
- func WithCreateChatSubscriptionInviteLinkName(value string) CreateChatSubscriptionInviteLinkOption
- func WithCreateChatSubscriptionInviteLinkSubscriptionPeriod(value int64) CreateChatSubscriptionInviteLinkOption
- func WithCreateChatSubscriptionInviteLinkSubscriptionPrice(value int64) CreateChatSubscriptionInviteLinkOption
- type CreateChatSubscriptionInviteLinkParams
- type CreateForumTopicOption
- type CreateForumTopicParams
- type CreateInvoiceLinkOption
- func WithCreateInvoiceLinkBusinessConnectionID(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkCurrency(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkDescription(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkIsFlexible(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkMaxTipAmount(value int64) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkNeedEmail(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkNeedName(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkNeedPhoneNumber(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkNeedShippingAddress(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkPayload(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkPhotoHeight(value int64) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkPhotoSize(value int64) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkPhotoUrl(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkPhotoWidth(value int64) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkPrices(value []LabeledPrice) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkProviderData(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkProviderToken(value string) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkSendEmailToProvider(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkSendPhoneNumberToProvider(value bool) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkSubscriptionPeriod(value int64) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkSuggestedTipAmounts(value []int64) CreateInvoiceLinkOption
- func WithCreateInvoiceLinkTitle(value string) CreateInvoiceLinkOption
- type CreateInvoiceLinkParams
- type CreateNewStickerSetOption
- func WithCreateNewStickerSetName(value string) CreateNewStickerSetOption
- func WithCreateNewStickerSetNeedsRepainting(value bool) CreateNewStickerSetOption
- func WithCreateNewStickerSetStickerType(value string) CreateNewStickerSetOption
- func WithCreateNewStickerSetStickers(value []InputSticker) CreateNewStickerSetOption
- func WithCreateNewStickerSetTitle(value string) CreateNewStickerSetOption
- func WithCreateNewStickerSetUserID(value int64) CreateNewStickerSetOption
- type CreateNewStickerSetParams
- type DeclineChatJoinRequestOption
- type DeclineChatJoinRequestParams
- type DeclineSuggestedPostOption
- type DeclineSuggestedPostParams
- type DeleteBusinessMessagesOption
- type DeleteBusinessMessagesParams
- type DeleteChatPhotoOption
- type DeleteChatPhotoParams
- type DeleteChatStickerSetOption
- type DeleteChatStickerSetParams
- type DeleteForumTopicOption
- type DeleteForumTopicParams
- type DeleteMessageOption
- type DeleteMessageParams
- type DeleteMessagesOption
- type DeleteMessagesParams
- type DeleteMyCommandsOption
- type DeleteMyCommandsParams
- type DeleteStickerFromSetOption
- type DeleteStickerFromSetParams
- type DeleteStickerSetOption
- type DeleteStickerSetParams
- type DeleteStoryOption
- type DeleteStoryParams
- type DeleteWebhookOption
- type DeleteWebhookParams
- type Dice
- type DirectMessagePriceChanged
- type DirectMessagesTopic
- type Document
- type EditChatInviteLinkOption
- func WithEditChatInviteLinkChatID(value string) EditChatInviteLinkOption
- func WithEditChatInviteLinkCreatesJoinRequest(value bool) EditChatInviteLinkOption
- func WithEditChatInviteLinkExpireDate(value int64) EditChatInviteLinkOption
- func WithEditChatInviteLinkInviteLink(value string) EditChatInviteLinkOption
- func WithEditChatInviteLinkMemberLimit(value int64) EditChatInviteLinkOption
- func WithEditChatInviteLinkName(value string) EditChatInviteLinkOption
- type EditChatInviteLinkParams
- type EditChatSubscriptionInviteLinkOption
- type EditChatSubscriptionInviteLinkParams
- type EditForumTopicOption
- type EditForumTopicParams
- type EditGeneralForumTopicOption
- type EditGeneralForumTopicParams
- type EditMessageCaptionOption
- func WithEditMessageCaptionBusinessConnectionID(value string) EditMessageCaptionOption
- func WithEditMessageCaptionCaption(value string) EditMessageCaptionOption
- func WithEditMessageCaptionCaptionEntities(value []MessageEntity) EditMessageCaptionOption
- func WithEditMessageCaptionChatID(value string) EditMessageCaptionOption
- func WithEditMessageCaptionInlineMessageID(value string) EditMessageCaptionOption
- func WithEditMessageCaptionMessageID(value int64) EditMessageCaptionOption
- func WithEditMessageCaptionParseMode(value string) EditMessageCaptionOption
- func WithEditMessageCaptionReplyMarkup(value *InlineKeyboardMarkup) EditMessageCaptionOption
- func WithEditMessageCaptionShowCaptionAboveMedia(value bool) EditMessageCaptionOption
- type EditMessageCaptionParams
- type EditMessageChecklistOption
- func WithEditMessageChecklistBusinessConnectionID(value string) EditMessageChecklistOption
- func WithEditMessageChecklistChatID(value int64) EditMessageChecklistOption
- func WithEditMessageChecklistChecklist(value InputChecklist) EditMessageChecklistOption
- func WithEditMessageChecklistMessageID(value int64) EditMessageChecklistOption
- func WithEditMessageChecklistReplyMarkup(value *InlineKeyboardMarkup) EditMessageChecklistOption
- type EditMessageChecklistParams
- type EditMessageLiveLocationOption
- func WithEditMessageLiveLocationBusinessConnectionID(value string) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationChatID(value string) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationHeading(value int64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationHorizontalAccuracy(value float64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationInlineMessageID(value string) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationLatitude(value float64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationLivePeriod(value int64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationLongitude(value float64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationMessageID(value int64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationProximityAlertRadius(value int64) EditMessageLiveLocationOption
- func WithEditMessageLiveLocationReplyMarkup(value *InlineKeyboardMarkup) EditMessageLiveLocationOption
- type EditMessageLiveLocationParams
- type EditMessageMediaOption
- func WithEditMessageMediaBusinessConnectionID(value string) EditMessageMediaOption
- func WithEditMessageMediaChatID(value string) EditMessageMediaOption
- func WithEditMessageMediaInlineMessageID(value string) EditMessageMediaOption
- func WithEditMessageMediaMedia(value InputMedia) EditMessageMediaOption
- func WithEditMessageMediaMessageID(value int64) EditMessageMediaOption
- func WithEditMessageMediaReplyMarkup(value *InlineKeyboardMarkup) EditMessageMediaOption
- type EditMessageMediaParams
- type EditMessageReplyMarkupOption
- func WithEditMessageReplyMarkupBusinessConnectionID(value string) EditMessageReplyMarkupOption
- func WithEditMessageReplyMarkupChatID(value string) EditMessageReplyMarkupOption
- func WithEditMessageReplyMarkupInlineMessageID(value string) EditMessageReplyMarkupOption
- func WithEditMessageReplyMarkupMessageID(value int64) EditMessageReplyMarkupOption
- func WithEditMessageReplyMarkupReplyMarkup(value *InlineKeyboardMarkup) EditMessageReplyMarkupOption
- type EditMessageReplyMarkupParams
- type EditMessageTextOption
- func WithEditMessageTextBusinessConnectionID(value string) EditMessageTextOption
- func WithEditMessageTextChatID(value string) EditMessageTextOption
- func WithEditMessageTextEntities(value []MessageEntity) EditMessageTextOption
- func WithEditMessageTextInlineButtons(buttons ...InlineKeyboardButton) EditMessageTextOption
- func WithEditMessageTextInlineKeyboard(keyboard [][]InlineKeyboardButton) EditMessageTextOption
- func WithEditMessageTextInlineMessageID(value string) EditMessageTextOption
- func WithEditMessageTextLinkPreviewOptions(value *LinkPreviewOptions) EditMessageTextOption
- func WithEditMessageTextMessageID(value int64) EditMessageTextOption
- func WithEditMessageTextParseMode(value string) EditMessageTextOption
- func WithEditMessageTextReplyMarkup(value *InlineKeyboardMarkup) EditMessageTextOption
- func WithEditMessageTextText(value string) EditMessageTextOption
- type EditMessageTextParams
- type EditStoryOption
- func WithEditStoryAreas(value []StoryArea) EditStoryOption
- func WithEditStoryBusinessConnectionID(value string) EditStoryOption
- func WithEditStoryCaption(value string) EditStoryOption
- func WithEditStoryCaptionEntities(value []MessageEntity) EditStoryOption
- func WithEditStoryContent(value InputStoryContent) EditStoryOption
- func WithEditStoryParseMode(value string) EditStoryOption
- func WithEditStoryStoryID(value int64) EditStoryOption
- type EditStoryParams
- type EditUserStarSubscriptionOption
- type EditUserStarSubscriptionParams
- type EncryptedCredentials
- type EncryptedPassportElement
- type Error
- type ExportChatInviteLinkOption
- type ExportChatInviteLinkParams
- type ExternalReplyInfo
- type File
- type Filter
- type ForceReply
- type ForumTopic
- type ForumTopicClosed
- type ForumTopicCreated
- type ForumTopicEdited
- type ForumTopicReopened
- type ForwardMessageOption
- func WithForwardMessageChatID(value string) ForwardMessageOption
- func WithForwardMessageDirectMessagesTopicID(value int64) ForwardMessageOption
- func WithForwardMessageDisableNotification(value bool) ForwardMessageOption
- func WithForwardMessageFromChatID(value string) ForwardMessageOption
- func WithForwardMessageMessageEffectID(value string) ForwardMessageOption
- func WithForwardMessageMessageID(value int64) ForwardMessageOption
- func WithForwardMessageMessageThreadID(value int64) ForwardMessageOption
- func WithForwardMessageProtectContent(value bool) ForwardMessageOption
- func WithForwardMessageSuggestedPostParameters(value *SuggestedPostParameters) ForwardMessageOption
- func WithForwardMessageVideoStartTimestamp(value int64) ForwardMessageOption
- type ForwardMessageParams
- type ForwardMessagesOption
- func WithForwardMessagesChatID(value string) ForwardMessagesOption
- func WithForwardMessagesDirectMessagesTopicID(value int64) ForwardMessagesOption
- func WithForwardMessagesDisableNotification(value bool) ForwardMessagesOption
- func WithForwardMessagesFromChatID(value string) ForwardMessagesOption
- func WithForwardMessagesMessageIDs(value []int64) ForwardMessagesOption
- func WithForwardMessagesMessageThreadID(value int64) ForwardMessagesOption
- func WithForwardMessagesProtectContent(value bool) ForwardMessagesOption
- type ForwardMessagesParams
- type Game
- type GameHighScore
- type GeneralForumTopicHidden
- type GeneralForumTopicUnhidden
- type GetAvailableGiftsOption
- type GetAvailableGiftsParams
- type GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsBusinessConnectionID(value string) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeFromBlockchain(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeLimitedNonUpgradable(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeLimitedUpgradable(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeSaved(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeUnique(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeUnlimited(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsExcludeUnsaved(value bool) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsLimit(value int64) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsOffset(value string) GetBusinessAccountGiftsOption
- func WithGetBusinessAccountGiftsSortByPrice(value bool) GetBusinessAccountGiftsOption
- type GetBusinessAccountGiftsParams
- type GetBusinessAccountStarBalanceOption
- type GetBusinessAccountStarBalanceParams
- type GetBusinessConnectionOption
- type GetBusinessConnectionParams
- type GetChatAdministratorsOption
- type GetChatAdministratorsParams
- type GetChatGiftsOption
- func WithGetChatGiftsChatID(value string) GetChatGiftsOption
- func WithGetChatGiftsExcludeFromBlockchain(value bool) GetChatGiftsOption
- func WithGetChatGiftsExcludeLimitedNonUpgradable(value bool) GetChatGiftsOption
- func WithGetChatGiftsExcludeLimitedUpgradable(value bool) GetChatGiftsOption
- func WithGetChatGiftsExcludeSaved(value bool) GetChatGiftsOption
- func WithGetChatGiftsExcludeUnique(value bool) GetChatGiftsOption
- func WithGetChatGiftsExcludeUnlimited(value bool) GetChatGiftsOption
- func WithGetChatGiftsExcludeUnsaved(value bool) GetChatGiftsOption
- func WithGetChatGiftsLimit(value int64) GetChatGiftsOption
- func WithGetChatGiftsOffset(value string) GetChatGiftsOption
- func WithGetChatGiftsSortByPrice(value bool) GetChatGiftsOption
- type GetChatGiftsParams
- type GetChatMemberCountOption
- type GetChatMemberCountParams
- type GetChatMemberOption
- type GetChatMemberParams
- type GetChatMenuButtonOption
- type GetChatMenuButtonParams
- type GetChatOption
- type GetChatParams
- type GetCustomEmojiStickersOption
- type GetCustomEmojiStickersParams
- type GetFileOption
- type GetFileParams
- type GetForumTopicIconStickersOption
- type GetForumTopicIconStickersParams
- type GetGameHighScoresOption
- type GetGameHighScoresParams
- type GetMeOption
- type GetMeParams
- type GetMyCommandsOption
- type GetMyCommandsParams
- type GetMyDefaultAdministratorRightsOption
- type GetMyDefaultAdministratorRightsParams
- type GetMyDescriptionOption
- type GetMyDescriptionParams
- type GetMyNameOption
- type GetMyNameParams
- type GetMyShortDescriptionOption
- type GetMyShortDescriptionParams
- type GetMyStarBalanceOption
- type GetMyStarBalanceParams
- type GetStarTransactionsOption
- type GetStarTransactionsParams
- type GetStickerSetOption
- type GetStickerSetParams
- type GetUpdatesOption
- type GetUpdatesParams
- type GetUserChatBoostsOption
- type GetUserChatBoostsParams
- type GetUserGiftsOption
- func WithGetUserGiftsExcludeFromBlockchain(value bool) GetUserGiftsOption
- func WithGetUserGiftsExcludeLimitedNonUpgradable(value bool) GetUserGiftsOption
- func WithGetUserGiftsExcludeLimitedUpgradable(value bool) GetUserGiftsOption
- func WithGetUserGiftsExcludeUnique(value bool) GetUserGiftsOption
- func WithGetUserGiftsExcludeUnlimited(value bool) GetUserGiftsOption
- func WithGetUserGiftsLimit(value int64) GetUserGiftsOption
- func WithGetUserGiftsOffset(value string) GetUserGiftsOption
- func WithGetUserGiftsSortByPrice(value bool) GetUserGiftsOption
- func WithGetUserGiftsUserID(value int64) GetUserGiftsOption
- type GetUserGiftsParams
- type GetUserProfileAudiosOption
- type GetUserProfileAudiosParams
- type GetUserProfilePhotosOption
- type GetUserProfilePhotosParams
- type GetWebhookInfoOption
- type GetWebhookInfoParams
- type Gift
- type GiftBackground
- type GiftInfo
- type GiftPremiumSubscriptionOption
- func WithGiftPremiumSubscriptionMonthCount(value int64) GiftPremiumSubscriptionOption
- func WithGiftPremiumSubscriptionStarCount(value int64) GiftPremiumSubscriptionOption
- func WithGiftPremiumSubscriptionText(value string) GiftPremiumSubscriptionOption
- func WithGiftPremiumSubscriptionTextEntities(value []MessageEntity) GiftPremiumSubscriptionOption
- func WithGiftPremiumSubscriptionTextParseMode(value string) GiftPremiumSubscriptionOption
- func WithGiftPremiumSubscriptionUserID(value int64) GiftPremiumSubscriptionOption
- type GiftPremiumSubscriptionParams
- type Gifts
- type Giveaway
- type GiveawayCompleted
- type GiveawayCreated
- type GiveawayWinners
- type HandlerFunc
- type HandlerFuncErr
- type HandlerFuncPanic
- type HideGeneralForumTopicOption
- type HideGeneralForumTopicParams
- type Identifier
- type InaccessibleMessage
- type InlineKeyboard
- type InlineKeyboardButton
- type InlineKeyboardMarkup
- type InlineKeyboardRow
- type InlineQuery
- type InlineQueryResult
- type InlineQueryResultArticle
- type InlineQueryResultAudio
- type InlineQueryResultCachedAudio
- type InlineQueryResultCachedDocument
- type InlineQueryResultCachedGif
- type InlineQueryResultCachedMpeg4Gif
- type InlineQueryResultCachedPhoto
- type InlineQueryResultCachedSticker
- type InlineQueryResultCachedVideo
- type InlineQueryResultCachedVoice
- type InlineQueryResultContact
- type InlineQueryResultDocument
- type InlineQueryResultGame
- type InlineQueryResultGif
- type InlineQueryResultLocation
- type InlineQueryResultMpeg4Gif
- type InlineQueryResultPhoto
- type InlineQueryResultVenue
- type InlineQueryResultVideo
- type InlineQueryResultVoice
- type InlineQueryResultsButton
- type InputChecklist
- type InputChecklistTask
- type InputContactMessageContent
- type InputFile
- type InputInvoiceMessageContent
- type InputLocationMessageContent
- type InputMedia
- type InputMediaAnimation
- type InputMediaAudio
- type InputMediaDocument
- type InputMediaPhoto
- type InputMediaVideo
- type InputMessageContent
- type InputPaidMedia
- type InputPaidMediaPhoto
- type InputPaidMediaVideo
- type InputPollOption
- type InputProfilePhoto
- type InputProfilePhotoAnimated
- type InputProfilePhotoStatic
- type InputSticker
- type InputStoryContent
- type InputStoryContentPhoto
- type InputStoryContentVideo
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type JSONWrapper
- type KeyboardButton
- type KeyboardButtonPollType
- type KeyboardButtonRequestChat
- type KeyboardButtonRequestUsers
- type LabeledPrice
- type LeaveChatOption
- type LeaveChatParams
- type LinkPreviewOptions
- type Location
- type LocationAddress
- type LogOutOption
- type LogOutParams
- type LoginUrl
- type MaskPosition
- type MaybeInaccessibleMessage
- type MenuButton
- type MenuButtonCommands
- type MenuButtonDefault
- type MenuButtonWebApp
- type Message
- type MessageAutoDeleteTimerChanged
- type MessageEntity
- type MessageId
- type MessageOrigin
- type MessageOriginChannel
- type MessageOriginChat
- type MessageOriginHiddenUser
- type MessageOriginUser
- type MessageReactionCountUpdated
- type MessageReactionUpdated
- type MiddlewareFunc
- type MigrateError
- type OrderInfo
- type OwnedGift
- type OwnedGiftRegular
- type OwnedGiftUnique
- type OwnedGifts
- type PaidMedia
- type PaidMediaInfo
- type PaidMediaPhoto
- type PaidMediaPreview
- type PaidMediaPurchased
- type PaidMediaVideo
- type PaidMessagePriceChanged
- type PassportData
- type PassportElementError
- type PassportElementErrorDataField
- type PassportElementErrorFile
- type PassportElementErrorFiles
- type PassportElementErrorFrontSide
- type PassportElementErrorReverseSide
- type PassportElementErrorSelfie
- type PassportElementErrorTranslationFile
- type PassportElementErrorTranslationFiles
- type PassportElementErrorUnspecified
- type PassportFile
- type PhotoSize
- type PinChatMessageOption
- type PinChatMessageParams
- type Poll
- type PollAnswer
- type PollOption
- type PostStoryOption
- func WithPostStoryActivePeriod(value int64) PostStoryOption
- func WithPostStoryAreas(value []StoryArea) PostStoryOption
- func WithPostStoryBusinessConnectionID(value string) PostStoryOption
- func WithPostStoryCaption(value string) PostStoryOption
- func WithPostStoryCaptionEntities(value []MessageEntity) PostStoryOption
- func WithPostStoryContent(value InputStoryContent) PostStoryOption
- func WithPostStoryParseMode(value string) PostStoryOption
- func WithPostStoryPostToChatPage(value bool) PostStoryOption
- func WithPostStoryProtectContent(value bool) PostStoryOption
- type PostStoryParams
- type PreCheckoutQuery
- type PreparedInlineMessage
- type PromoteChatMemberOption
- func WithPromoteChatMemberCanChangeInfo(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanDeleteMessages(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanDeleteStories(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanEditMessages(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanEditStories(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanInviteUsers(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanManageChat(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanManageDirectMessages(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanManageTags(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanManageTopics(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanManageVideoChats(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanPinMessages(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanPostMessages(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanPostStories(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanPromoteMembers(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberCanRestrictMembers(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberChatID(value string) PromoteChatMemberOption
- func WithPromoteChatMemberIsAnonymous(value bool) PromoteChatMemberOption
- func WithPromoteChatMemberUserID(value int64) PromoteChatMemberOption
- type PromoteChatMemberParams
- type ProximityAlertTriggered
- type ReactionCount
- type ReactionType
- type ReactionTypeCustomEmoji
- type ReactionTypeEmoji
- type ReactionTypePaid
- type ReadBusinessMessageOption
- type ReadBusinessMessageParams
- type RefundStarPaymentOption
- type RefundStarPaymentParams
- type RefundedPayment
- type RemoveBusinessAccountProfilePhotoOption
- type RemoveBusinessAccountProfilePhotoParams
- type RemoveChatVerificationOption
- type RemoveChatVerificationParams
- type RemoveMyProfilePhotoOption
- type RemoveMyProfilePhotoParams
- type RemoveUserVerificationOption
- type RemoveUserVerificationParams
- type ReopenForumTopicOption
- type ReopenForumTopicParams
- type ReopenGeneralForumTopicOption
- type ReopenGeneralForumTopicParams
- type ReplaceStickerInSetOption
- func WithReplaceStickerInSetName(value string) ReplaceStickerInSetOption
- func WithReplaceStickerInSetOldSticker(value string) ReplaceStickerInSetOption
- func WithReplaceStickerInSetSticker(value InputSticker) ReplaceStickerInSetOption
- func WithReplaceStickerInSetUserID(value int64) ReplaceStickerInSetOption
- type ReplaceStickerInSetParams
- type ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type ReplyMarkup
- type ReplyParameters
- type RepostStoryOption
- func WithRepostStoryActivePeriod(value int64) RepostStoryOption
- func WithRepostStoryBusinessConnectionID(value string) RepostStoryOption
- func WithRepostStoryFromChatID(value int64) RepostStoryOption
- func WithRepostStoryFromStoryID(value int64) RepostStoryOption
- func WithRepostStoryPostToChatPage(value bool) RepostStoryOption
- func WithRepostStoryProtectContent(value bool) RepostStoryOption
- type RepostStoryParams
- type Response
- type ResponseParameters
- type RestrictChatMemberOption
- func WithRestrictChatMemberChatID(value string) RestrictChatMemberOption
- func WithRestrictChatMemberPermissions(value ChatPermissions) RestrictChatMemberOption
- func WithRestrictChatMemberUntilDate(value int64) RestrictChatMemberOption
- func WithRestrictChatMemberUseIndependentChatPermissions(value bool) RestrictChatMemberOption
- func WithRestrictChatMemberUserID(value int64) RestrictChatMemberOption
- type RestrictChatMemberParams
- type RetryError
- type RevenueWithdrawalState
- type RevenueWithdrawalStateFailed
- type RevenueWithdrawalStatePending
- type RevenueWithdrawalStateSucceeded
- type RevokeChatInviteLinkOption
- type RevokeChatInviteLinkParams
- type Router
- func (r *Router) HandleInlineKeyboardButton(b *InlineKeyboardButton, handler func(ctx *Context, cq *CallbackQuery) error)
- func (r *Router) HandleKeyboardButton(b *KeyboardButton, handler func(ctx *Context, m *Message) error)
- func (r *Router) Process(ctx *Context)
- func (r *Router) SetHandlerDefault(handler HandlerFunc)
- func (r *Router) SetHandlerErr(handler HandlerFuncErr)
- func (r *Router) SetHandlerPanic(handler HandlerFuncPanic)
- func (r *Router) Use(funcs ...MiddlewareFunc)
- type RouterGroup
- func (rg *RouterGroup) Group(filters ...Filter) *RouterGroup
- func (rg *RouterGroup) HandleOnBusinessConnection(handler func(*Context, *BusinessConnection) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnBusinessMessage(handler func(*Context, *Message) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnCallbackQuery(handler func(*Context, *CallbackQuery) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnChannelPost(handler func(*Context, *Message) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnChatBoost(handler func(*Context, *ChatBoostUpdated) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnChatJoinRequest(handler func(*Context, *ChatJoinRequest) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnChatMember(handler func(*Context, *ChatMemberUpdated) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnChosenInlineResult(handler func(*Context, *ChosenInlineResult) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnDeletedBusinessMessages(handler func(*Context, *BusinessMessagesDeleted) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnEditedBusinessMessage(handler func(*Context, *Message) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnEditedChannelPost(handler func(*Context, *Message) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnEditedMessage(handler func(*Context, *Message) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnInlineQuery(handler func(*Context, *InlineQuery) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnMessage(handler func(*Context, *Message) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnMessageReaction(handler func(*Context, *MessageReactionUpdated) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnMessageReactionCount(handler func(*Context, *MessageReactionCountUpdated) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnMyChatMember(handler func(*Context, *ChatMemberUpdated) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnPoll(handler func(*Context, *Poll) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnPollAnswer(handler func(*Context, *PollAnswer) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnPreCheckoutQuery(handler func(*Context, *PreCheckoutQuery) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnPurchasedPaidMedia(handler func(*Context, *PaidMediaPurchased) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnRemovedChatBoost(handler func(*Context, *ChatBoostRemoved) error, filters ...Filter)
- func (rg *RouterGroup) HandleOnShippingQuery(handler func(*Context, *ShippingQuery) error, filters ...Filter)
- func (rg *RouterGroup) Use(funcs ...MiddlewareFunc)
- type SavePreparedInlineMessageOption
- func WithSavePreparedInlineMessageAllowBotChats(value bool) SavePreparedInlineMessageOption
- func WithSavePreparedInlineMessageAllowChannelChats(value bool) SavePreparedInlineMessageOption
- func WithSavePreparedInlineMessageAllowGroupChats(value bool) SavePreparedInlineMessageOption
- func WithSavePreparedInlineMessageAllowUserChats(value bool) SavePreparedInlineMessageOption
- func WithSavePreparedInlineMessageResult(value InlineQueryResult) SavePreparedInlineMessageOption
- func WithSavePreparedInlineMessageUserID(value int64) SavePreparedInlineMessageOption
- type SavePreparedInlineMessageParams
- type SendAnimationOption
- func WithSendAnimationAllowPaidBroadcast(value bool) SendAnimationOption
- func WithSendAnimationAnimation(value InputFile) SendAnimationOption
- func WithSendAnimationBusinessConnectionID(value string) SendAnimationOption
- func WithSendAnimationCaption(value string) SendAnimationOption
- func WithSendAnimationCaptionEntities(value []MessageEntity) SendAnimationOption
- func WithSendAnimationChatID(value string) SendAnimationOption
- func WithSendAnimationDirectMessagesTopicID(value int64) SendAnimationOption
- func WithSendAnimationDisableNotification(value bool) SendAnimationOption
- func WithSendAnimationDuration(value int64) SendAnimationOption
- func WithSendAnimationHasSpoiler(value bool) SendAnimationOption
- func WithSendAnimationHeight(value int64) SendAnimationOption
- func WithSendAnimationMessageEffectID(value string) SendAnimationOption
- func WithSendAnimationMessageThreadID(value int64) SendAnimationOption
- func WithSendAnimationParseMode(value string) SendAnimationOption
- func WithSendAnimationProtectContent(value bool) SendAnimationOption
- func WithSendAnimationReplyMarkup(value *ReplyMarkup) SendAnimationOption
- func WithSendAnimationReplyParameters(value *ReplyParameters) SendAnimationOption
- func WithSendAnimationShowCaptionAboveMedia(value bool) SendAnimationOption
- func WithSendAnimationSuggestedPostParameters(value *SuggestedPostParameters) SendAnimationOption
- func WithSendAnimationThumbnail(value *InputFile) SendAnimationOption
- func WithSendAnimationWidth(value int64) SendAnimationOption
- type SendAnimationParams
- type SendAudioOption
- func WithSendAudioAllowPaidBroadcast(value bool) SendAudioOption
- func WithSendAudioAudio(value InputFile) SendAudioOption
- func WithSendAudioBusinessConnectionID(value string) SendAudioOption
- func WithSendAudioCaption(value string) SendAudioOption
- func WithSendAudioCaptionEntities(value []MessageEntity) SendAudioOption
- func WithSendAudioChatID(value string) SendAudioOption
- func WithSendAudioDirectMessagesTopicID(value int64) SendAudioOption
- func WithSendAudioDisableNotification(value bool) SendAudioOption
- func WithSendAudioDuration(value int64) SendAudioOption
- func WithSendAudioMessageEffectID(value string) SendAudioOption
- func WithSendAudioMessageThreadID(value int64) SendAudioOption
- func WithSendAudioParseMode(value string) SendAudioOption
- func WithSendAudioPerformer(value string) SendAudioOption
- func WithSendAudioProtectContent(value bool) SendAudioOption
- func WithSendAudioReplyMarkup(value *ReplyMarkup) SendAudioOption
- func WithSendAudioReplyParameters(value *ReplyParameters) SendAudioOption
- func WithSendAudioSuggestedPostParameters(value *SuggestedPostParameters) SendAudioOption
- func WithSendAudioThumbnail(value *InputFile) SendAudioOption
- func WithSendAudioTitle(value string) SendAudioOption
- type SendAudioParams
- type SendChatActionOption
- type SendChatActionParams
- type SendChecklistOption
- func WithSendChecklistBusinessConnectionID(value string) SendChecklistOption
- func WithSendChecklistChatID(value int64) SendChecklistOption
- func WithSendChecklistChecklist(value InputChecklist) SendChecklistOption
- func WithSendChecklistDisableNotification(value bool) SendChecklistOption
- func WithSendChecklistMessageEffectID(value string) SendChecklistOption
- func WithSendChecklistProtectContent(value bool) SendChecklistOption
- func WithSendChecklistReplyMarkup(value *InlineKeyboardMarkup) SendChecklistOption
- func WithSendChecklistReplyParameters(value *ReplyParameters) SendChecklistOption
- type SendChecklistParams
- type SendContactOption
- func WithSendContactAllowPaidBroadcast(value bool) SendContactOption
- func WithSendContactBusinessConnectionID(value string) SendContactOption
- func WithSendContactChatID(value string) SendContactOption
- func WithSendContactDirectMessagesTopicID(value int64) SendContactOption
- func WithSendContactDisableNotification(value bool) SendContactOption
- func WithSendContactFirstName(value string) SendContactOption
- func WithSendContactLastName(value string) SendContactOption
- func WithSendContactMessageEffectID(value string) SendContactOption
- func WithSendContactMessageThreadID(value int64) SendContactOption
- func WithSendContactPhoneNumber(value string) SendContactOption
- func WithSendContactProtectContent(value bool) SendContactOption
- func WithSendContactReplyMarkup(value *ReplyMarkup) SendContactOption
- func WithSendContactReplyParameters(value *ReplyParameters) SendContactOption
- func WithSendContactSuggestedPostParameters(value *SuggestedPostParameters) SendContactOption
- func WithSendContactVcard(value string) SendContactOption
- type SendContactParams
- type SendDiceOption
- func WithSendDiceAllowPaidBroadcast(value bool) SendDiceOption
- func WithSendDiceBusinessConnectionID(value string) SendDiceOption
- func WithSendDiceChatID(value string) SendDiceOption
- func WithSendDiceDirectMessagesTopicID(value int64) SendDiceOption
- func WithSendDiceDisableNotification(value bool) SendDiceOption
- func WithSendDiceEmoji(value string) SendDiceOption
- func WithSendDiceMessageEffectID(value string) SendDiceOption
- func WithSendDiceMessageThreadID(value int64) SendDiceOption
- func WithSendDiceProtectContent(value bool) SendDiceOption
- func WithSendDiceReplyMarkup(value *ReplyMarkup) SendDiceOption
- func WithSendDiceReplyParameters(value *ReplyParameters) SendDiceOption
- func WithSendDiceSuggestedPostParameters(value *SuggestedPostParameters) SendDiceOption
- type SendDiceParams
- type SendDocumentOption
- func WithSendDocumentAllowPaidBroadcast(value bool) SendDocumentOption
- func WithSendDocumentBusinessConnectionID(value string) SendDocumentOption
- func WithSendDocumentCaption(value string) SendDocumentOption
- func WithSendDocumentCaptionEntities(value []MessageEntity) SendDocumentOption
- func WithSendDocumentChatID(value string) SendDocumentOption
- func WithSendDocumentDirectMessagesTopicID(value int64) SendDocumentOption
- func WithSendDocumentDisableContentTypeDetection(value bool) SendDocumentOption
- func WithSendDocumentDisableNotification(value bool) SendDocumentOption
- func WithSendDocumentDocument(value InputFile) SendDocumentOption
- func WithSendDocumentMessageEffectID(value string) SendDocumentOption
- func WithSendDocumentMessageThreadID(value int64) SendDocumentOption
- func WithSendDocumentParseMode(value string) SendDocumentOption
- func WithSendDocumentProtectContent(value bool) SendDocumentOption
- func WithSendDocumentReplyMarkup(value *ReplyMarkup) SendDocumentOption
- func WithSendDocumentReplyParameters(value *ReplyParameters) SendDocumentOption
- func WithSendDocumentSuggestedPostParameters(value *SuggestedPostParameters) SendDocumentOption
- func WithSendDocumentThumbnail(value *InputFile) SendDocumentOption
- type SendDocumentParams
- type SendGameOption
- func WithSendGameAllowPaidBroadcast(value bool) SendGameOption
- func WithSendGameBusinessConnectionID(value string) SendGameOption
- func WithSendGameChatID(value int64) SendGameOption
- func WithSendGameDisableNotification(value bool) SendGameOption
- func WithSendGameGameShortName(value string) SendGameOption
- func WithSendGameMessageEffectID(value string) SendGameOption
- func WithSendGameMessageThreadID(value int64) SendGameOption
- func WithSendGameProtectContent(value bool) SendGameOption
- func WithSendGameReplyMarkup(value *InlineKeyboardMarkup) SendGameOption
- func WithSendGameReplyParameters(value *ReplyParameters) SendGameOption
- type SendGameParams
- type SendGiftOption
- func WithSendGiftChatID(value string) SendGiftOption
- func WithSendGiftGiftID(value string) SendGiftOption
- func WithSendGiftPayForUpgrade(value bool) SendGiftOption
- func WithSendGiftText(value string) SendGiftOption
- func WithSendGiftTextEntities(value []MessageEntity) SendGiftOption
- func WithSendGiftTextParseMode(value string) SendGiftOption
- func WithSendGiftUserID(value int64) SendGiftOption
- type SendGiftParams
- type SendInvoiceOption
- func WithSendInvoiceAllowPaidBroadcast(value bool) SendInvoiceOption
- func WithSendInvoiceChatID(value string) SendInvoiceOption
- func WithSendInvoiceCurrency(value string) SendInvoiceOption
- func WithSendInvoiceDescription(value string) SendInvoiceOption
- func WithSendInvoiceDirectMessagesTopicID(value int64) SendInvoiceOption
- func WithSendInvoiceDisableNotification(value bool) SendInvoiceOption
- func WithSendInvoiceIsFlexible(value bool) SendInvoiceOption
- func WithSendInvoiceMaxTipAmount(value int64) SendInvoiceOption
- func WithSendInvoiceMessageEffectID(value string) SendInvoiceOption
- func WithSendInvoiceMessageThreadID(value int64) SendInvoiceOption
- func WithSendInvoiceNeedEmail(value bool) SendInvoiceOption
- func WithSendInvoiceNeedName(value bool) SendInvoiceOption
- func WithSendInvoiceNeedPhoneNumber(value bool) SendInvoiceOption
- func WithSendInvoiceNeedShippingAddress(value bool) SendInvoiceOption
- func WithSendInvoicePayload(value string) SendInvoiceOption
- func WithSendInvoicePhotoHeight(value int64) SendInvoiceOption
- func WithSendInvoicePhotoSize(value int64) SendInvoiceOption
- func WithSendInvoicePhotoUrl(value string) SendInvoiceOption
- func WithSendInvoicePhotoWidth(value int64) SendInvoiceOption
- func WithSendInvoicePrices(value []LabeledPrice) SendInvoiceOption
- func WithSendInvoiceProtectContent(value bool) SendInvoiceOption
- func WithSendInvoiceProviderData(value string) SendInvoiceOption
- func WithSendInvoiceProviderToken(value string) SendInvoiceOption
- func WithSendInvoiceReplyMarkup(value *InlineKeyboardMarkup) SendInvoiceOption
- func WithSendInvoiceReplyParameters(value *ReplyParameters) SendInvoiceOption
- func WithSendInvoiceSendEmailToProvider(value bool) SendInvoiceOption
- func WithSendInvoiceSendPhoneNumberToProvider(value bool) SendInvoiceOption
- func WithSendInvoiceStartParameter(value string) SendInvoiceOption
- func WithSendInvoiceSuggestedPostParameters(value *SuggestedPostParameters) SendInvoiceOption
- func WithSendInvoiceSuggestedTipAmounts(value []int64) SendInvoiceOption
- func WithSendInvoiceTitle(value string) SendInvoiceOption
- type SendInvoiceParams
- type SendLocationOption
- func WithSendLocationAllowPaidBroadcast(value bool) SendLocationOption
- func WithSendLocationBusinessConnectionID(value string) SendLocationOption
- func WithSendLocationChatID(value string) SendLocationOption
- func WithSendLocationDirectMessagesTopicID(value int64) SendLocationOption
- func WithSendLocationDisableNotification(value bool) SendLocationOption
- func WithSendLocationHeading(value int64) SendLocationOption
- func WithSendLocationHorizontalAccuracy(value float64) SendLocationOption
- func WithSendLocationLatitude(value float64) SendLocationOption
- func WithSendLocationLivePeriod(value int64) SendLocationOption
- func WithSendLocationLongitude(value float64) SendLocationOption
- func WithSendLocationMessageEffectID(value string) SendLocationOption
- func WithSendLocationMessageThreadID(value int64) SendLocationOption
- func WithSendLocationProtectContent(value bool) SendLocationOption
- func WithSendLocationProximityAlertRadius(value int64) SendLocationOption
- func WithSendLocationReplyMarkup(value *ReplyMarkup) SendLocationOption
- func WithSendLocationReplyParameters(value *ReplyParameters) SendLocationOption
- func WithSendLocationSuggestedPostParameters(value *SuggestedPostParameters) SendLocationOption
- type SendLocationParams
- type SendMediaGroupOption
- func WithSendMediaGroupAllowPaidBroadcast(value bool) SendMediaGroupOption
- func WithSendMediaGroupBusinessConnectionID(value string) SendMediaGroupOption
- func WithSendMediaGroupChatID(value string) SendMediaGroupOption
- func WithSendMediaGroupDirectMessagesTopicID(value int64) SendMediaGroupOption
- func WithSendMediaGroupDisableNotification(value bool) SendMediaGroupOption
- func WithSendMediaGroupMedia(value []InputMedia) SendMediaGroupOption
- func WithSendMediaGroupMessageEffectID(value string) SendMediaGroupOption
- func WithSendMediaGroupMessageThreadID(value int64) SendMediaGroupOption
- func WithSendMediaGroupProtectContent(value bool) SendMediaGroupOption
- func WithSendMediaGroupReplyParameters(value *ReplyParameters) SendMediaGroupOption
- type SendMediaGroupParams
- type SendMessageDraftOption
- func WithSendMessageDraftChatID(value int64) SendMessageDraftOption
- func WithSendMessageDraftDraftID(value int64) SendMessageDraftOption
- func WithSendMessageDraftEntities(value []MessageEntity) SendMessageDraftOption
- func WithSendMessageDraftMessageThreadID(value int64) SendMessageDraftOption
- func WithSendMessageDraftParseMode(value string) SendMessageDraftOption
- func WithSendMessageDraftText(value string) SendMessageDraftOption
- type SendMessageDraftParams
- type SendMessageOption
- func WithSendMessageAllowPaidBroadcast(value bool) SendMessageOption
- func WithSendMessageBusinessConnectionID(value string) SendMessageOption
- func WithSendMessageChatID(value string) SendMessageOption
- func WithSendMessageDirectMessagesTopicID(value int64) SendMessageOption
- func WithSendMessageDisableNotification(value bool) SendMessageOption
- func WithSendMessageEntities(value []MessageEntity) SendMessageOption
- func WithSendMessageInlineButtons(buttons ...InlineKeyboardButton) SendMessageOption
- func WithSendMessageInlineKeyboard(keyboard [][]InlineKeyboardButton) SendMessageOption
- func WithSendMessageLinkPreviewOptions(value *LinkPreviewOptions) SendMessageOption
- func WithSendMessageMessageEffectID(value string) SendMessageOption
- func WithSendMessageMessageThreadID(value int64) SendMessageOption
- func WithSendMessageParseMode(value string) SendMessageOption
- func WithSendMessageProtectContent(value bool) SendMessageOption
- func WithSendMessageReplyMarkup(value *ReplyMarkup) SendMessageOption
- func WithSendMessageReplyParameters(value *ReplyParameters) SendMessageOption
- func WithSendMessageSuggestedPostParameters(value *SuggestedPostParameters) SendMessageOption
- func WithSendMessageText(value string) SendMessageOption
- type SendMessageParams
- type SendPaidMediaOption
- func WithSendPaidMediaAllowPaidBroadcast(value bool) SendPaidMediaOption
- func WithSendPaidMediaBusinessConnectionID(value string) SendPaidMediaOption
- func WithSendPaidMediaCaption(value string) SendPaidMediaOption
- func WithSendPaidMediaCaptionEntities(value []MessageEntity) SendPaidMediaOption
- func WithSendPaidMediaChatID(value string) SendPaidMediaOption
- func WithSendPaidMediaDirectMessagesTopicID(value int64) SendPaidMediaOption
- func WithSendPaidMediaDisableNotification(value bool) SendPaidMediaOption
- func WithSendPaidMediaMedia(value []InputPaidMedia) SendPaidMediaOption
- func WithSendPaidMediaMessageThreadID(value int64) SendPaidMediaOption
- func WithSendPaidMediaParseMode(value string) SendPaidMediaOption
- func WithSendPaidMediaPayload(value string) SendPaidMediaOption
- func WithSendPaidMediaProtectContent(value bool) SendPaidMediaOption
- func WithSendPaidMediaReplyMarkup(value *ReplyMarkup) SendPaidMediaOption
- func WithSendPaidMediaReplyParameters(value *ReplyParameters) SendPaidMediaOption
- func WithSendPaidMediaShowCaptionAboveMedia(value bool) SendPaidMediaOption
- func WithSendPaidMediaStarCount(value int64) SendPaidMediaOption
- func WithSendPaidMediaSuggestedPostParameters(value *SuggestedPostParameters) SendPaidMediaOption
- type SendPaidMediaParams
- type SendPhotoOption
- func WithSendPhotoAllowPaidBroadcast(value bool) SendPhotoOption
- func WithSendPhotoBusinessConnectionID(value string) SendPhotoOption
- func WithSendPhotoCaption(value string) SendPhotoOption
- func WithSendPhotoCaptionEntities(value []MessageEntity) SendPhotoOption
- func WithSendPhotoChatID(value string) SendPhotoOption
- func WithSendPhotoDirectMessagesTopicID(value int64) SendPhotoOption
- func WithSendPhotoDisableNotification(value bool) SendPhotoOption
- func WithSendPhotoHasSpoiler(value bool) SendPhotoOption
- func WithSendPhotoMessageEffectID(value string) SendPhotoOption
- func WithSendPhotoMessageThreadID(value int64) SendPhotoOption
- func WithSendPhotoParseMode(value string) SendPhotoOption
- func WithSendPhotoPhoto(value InputFile) SendPhotoOption
- func WithSendPhotoProtectContent(value bool) SendPhotoOption
- func WithSendPhotoReplyMarkup(value *ReplyMarkup) SendPhotoOption
- func WithSendPhotoReplyParameters(value *ReplyParameters) SendPhotoOption
- func WithSendPhotoShowCaptionAboveMedia(value bool) SendPhotoOption
- func WithSendPhotoSuggestedPostParameters(value *SuggestedPostParameters) SendPhotoOption
- type SendPhotoParams
- type SendPollOption
- func WithSendPollAllowPaidBroadcast(value bool) SendPollOption
- func WithSendPollAllowsMultipleAnswers(value bool) SendPollOption
- func WithSendPollBusinessConnectionID(value string) SendPollOption
- func WithSendPollChatID(value string) SendPollOption
- func WithSendPollCloseDate(value int64) SendPollOption
- func WithSendPollCorrectOptionID(value int64) SendPollOption
- func WithSendPollDisableNotification(value bool) SendPollOption
- func WithSendPollExplanation(value string) SendPollOption
- func WithSendPollExplanationEntities(value []MessageEntity) SendPollOption
- func WithSendPollExplanationParseMode(value string) SendPollOption
- func WithSendPollIsAnonymous(value bool) SendPollOption
- func WithSendPollIsClosed(value bool) SendPollOption
- func WithSendPollMessageEffectID(value string) SendPollOption
- func WithSendPollMessageThreadID(value int64) SendPollOption
- func WithSendPollOpenPeriod(value int64) SendPollOption
- func WithSendPollOptions(value []InputPollOption) SendPollOption
- func WithSendPollProtectContent(value bool) SendPollOption
- func WithSendPollQuestion(value string) SendPollOption
- func WithSendPollQuestionEntities(value []MessageEntity) SendPollOption
- func WithSendPollQuestionParseMode(value string) SendPollOption
- func WithSendPollReplyMarkup(value *ReplyMarkup) SendPollOption
- func WithSendPollReplyParameters(value *ReplyParameters) SendPollOption
- func WithSendPollType(value string) SendPollOption
- type SendPollParams
- type SendStickerOption
- func WithSendStickerAllowPaidBroadcast(value bool) SendStickerOption
- func WithSendStickerBusinessConnectionID(value string) SendStickerOption
- func WithSendStickerChatID(value string) SendStickerOption
- func WithSendStickerDirectMessagesTopicID(value int64) SendStickerOption
- func WithSendStickerDisableNotification(value bool) SendStickerOption
- func WithSendStickerEmoji(value string) SendStickerOption
- func WithSendStickerMessageEffectID(value string) SendStickerOption
- func WithSendStickerMessageThreadID(value int64) SendStickerOption
- func WithSendStickerProtectContent(value bool) SendStickerOption
- func WithSendStickerReplyMarkup(value *ReplyMarkup) SendStickerOption
- func WithSendStickerReplyParameters(value *ReplyParameters) SendStickerOption
- func WithSendStickerSticker(value InputFile) SendStickerOption
- func WithSendStickerSuggestedPostParameters(value *SuggestedPostParameters) SendStickerOption
- type SendStickerParams
- type SendVenueOption
- func WithSendVenueAddress(value string) SendVenueOption
- func WithSendVenueAllowPaidBroadcast(value bool) SendVenueOption
- func WithSendVenueBusinessConnectionID(value string) SendVenueOption
- func WithSendVenueChatID(value string) SendVenueOption
- func WithSendVenueDirectMessagesTopicID(value int64) SendVenueOption
- func WithSendVenueDisableNotification(value bool) SendVenueOption
- func WithSendVenueFoursquareID(value string) SendVenueOption
- func WithSendVenueFoursquareType(value string) SendVenueOption
- func WithSendVenueGooglePlaceID(value string) SendVenueOption
- func WithSendVenueGooglePlaceType(value string) SendVenueOption
- func WithSendVenueLatitude(value float64) SendVenueOption
- func WithSendVenueLongitude(value float64) SendVenueOption
- func WithSendVenueMessageEffectID(value string) SendVenueOption
- func WithSendVenueMessageThreadID(value int64) SendVenueOption
- func WithSendVenueProtectContent(value bool) SendVenueOption
- func WithSendVenueReplyMarkup(value *ReplyMarkup) SendVenueOption
- func WithSendVenueReplyParameters(value *ReplyParameters) SendVenueOption
- func WithSendVenueSuggestedPostParameters(value *SuggestedPostParameters) SendVenueOption
- func WithSendVenueTitle(value string) SendVenueOption
- type SendVenueParams
- type SendVideoNoteOption
- func WithSendVideoNoteAllowPaidBroadcast(value bool) SendVideoNoteOption
- func WithSendVideoNoteBusinessConnectionID(value string) SendVideoNoteOption
- func WithSendVideoNoteChatID(value string) SendVideoNoteOption
- func WithSendVideoNoteDirectMessagesTopicID(value int64) SendVideoNoteOption
- func WithSendVideoNoteDisableNotification(value bool) SendVideoNoteOption
- func WithSendVideoNoteDuration(value int64) SendVideoNoteOption
- func WithSendVideoNoteLength(value int64) SendVideoNoteOption
- func WithSendVideoNoteMessageEffectID(value string) SendVideoNoteOption
- func WithSendVideoNoteMessageThreadID(value int64) SendVideoNoteOption
- func WithSendVideoNoteProtectContent(value bool) SendVideoNoteOption
- func WithSendVideoNoteReplyMarkup(value *ReplyMarkup) SendVideoNoteOption
- func WithSendVideoNoteReplyParameters(value *ReplyParameters) SendVideoNoteOption
- func WithSendVideoNoteSuggestedPostParameters(value *SuggestedPostParameters) SendVideoNoteOption
- func WithSendVideoNoteThumbnail(value *InputFile) SendVideoNoteOption
- func WithSendVideoNoteVideoNote(value InputFile) SendVideoNoteOption
- type SendVideoNoteParams
- type SendVideoOption
- func WithSendVideoAllowPaidBroadcast(value bool) SendVideoOption
- func WithSendVideoBusinessConnectionID(value string) SendVideoOption
- func WithSendVideoCaption(value string) SendVideoOption
- func WithSendVideoCaptionEntities(value []MessageEntity) SendVideoOption
- func WithSendVideoChatID(value string) SendVideoOption
- func WithSendVideoCover(value *InputFile) SendVideoOption
- func WithSendVideoDirectMessagesTopicID(value int64) SendVideoOption
- func WithSendVideoDisableNotification(value bool) SendVideoOption
- func WithSendVideoDuration(value int64) SendVideoOption
- func WithSendVideoHasSpoiler(value bool) SendVideoOption
- func WithSendVideoHeight(value int64) SendVideoOption
- func WithSendVideoMessageEffectID(value string) SendVideoOption
- func WithSendVideoMessageThreadID(value int64) SendVideoOption
- func WithSendVideoParseMode(value string) SendVideoOption
- func WithSendVideoProtectContent(value bool) SendVideoOption
- func WithSendVideoReplyMarkup(value *ReplyMarkup) SendVideoOption
- func WithSendVideoReplyParameters(value *ReplyParameters) SendVideoOption
- func WithSendVideoShowCaptionAboveMedia(value bool) SendVideoOption
- func WithSendVideoStartTimestamp(value int64) SendVideoOption
- func WithSendVideoSuggestedPostParameters(value *SuggestedPostParameters) SendVideoOption
- func WithSendVideoSupportsStreaming(value bool) SendVideoOption
- func WithSendVideoThumbnail(value *InputFile) SendVideoOption
- func WithSendVideoVideo(value InputFile) SendVideoOption
- func WithSendVideoWidth(value int64) SendVideoOption
- type SendVideoParams
- type SendVoiceOption
- func WithSendVoiceAllowPaidBroadcast(value bool) SendVoiceOption
- func WithSendVoiceBusinessConnectionID(value string) SendVoiceOption
- func WithSendVoiceCaption(value string) SendVoiceOption
- func WithSendVoiceCaptionEntities(value []MessageEntity) SendVoiceOption
- func WithSendVoiceChatID(value string) SendVoiceOption
- func WithSendVoiceDirectMessagesTopicID(value int64) SendVoiceOption
- func WithSendVoiceDisableNotification(value bool) SendVoiceOption
- func WithSendVoiceDuration(value int64) SendVoiceOption
- func WithSendVoiceMessageEffectID(value string) SendVoiceOption
- func WithSendVoiceMessageThreadID(value int64) SendVoiceOption
- func WithSendVoiceParseMode(value string) SendVoiceOption
- func WithSendVoiceProtectContent(value bool) SendVoiceOption
- func WithSendVoiceReplyMarkup(value *ReplyMarkup) SendVoiceOption
- func WithSendVoiceReplyParameters(value *ReplyParameters) SendVoiceOption
- func WithSendVoiceSuggestedPostParameters(value *SuggestedPostParameters) SendVoiceOption
- func WithSendVoiceVoice(value InputFile) SendVoiceOption
- type SendVoiceParams
- type SentWebAppMessage
- type SetBusinessAccountBioOption
- type SetBusinessAccountBioParams
- type SetBusinessAccountGiftSettingsOption
- func WithSetBusinessAccountGiftSettingsAcceptedGiftTypes(value AcceptedGiftTypes) SetBusinessAccountGiftSettingsOption
- func WithSetBusinessAccountGiftSettingsBusinessConnectionID(value string) SetBusinessAccountGiftSettingsOption
- func WithSetBusinessAccountGiftSettingsShowGiftButton(value bool) SetBusinessAccountGiftSettingsOption
- type SetBusinessAccountGiftSettingsParams
- type SetBusinessAccountNameOption
- type SetBusinessAccountNameParams
- type SetBusinessAccountProfilePhotoOption
- func WithSetBusinessAccountProfilePhotoBusinessConnectionID(value string) SetBusinessAccountProfilePhotoOption
- func WithSetBusinessAccountProfilePhotoIsPublic(value bool) SetBusinessAccountProfilePhotoOption
- func WithSetBusinessAccountProfilePhotoPhoto(value InputProfilePhoto) SetBusinessAccountProfilePhotoOption
- type SetBusinessAccountProfilePhotoParams
- type SetBusinessAccountUsernameOption
- type SetBusinessAccountUsernameParams
- type SetChatAdministratorCustomTitleOption
- func WithSetChatAdministratorCustomTitleChatID(value string) SetChatAdministratorCustomTitleOption
- func WithSetChatAdministratorCustomTitleCustomTitle(value string) SetChatAdministratorCustomTitleOption
- func WithSetChatAdministratorCustomTitleUserID(value int64) SetChatAdministratorCustomTitleOption
- type SetChatAdministratorCustomTitleParams
- type SetChatDescriptionOption
- type SetChatDescriptionParams
- type SetChatMemberTagOption
- type SetChatMemberTagParams
- type SetChatMenuButtonOption
- type SetChatMenuButtonParams
- type SetChatPermissionsOption
- type SetChatPermissionsParams
- type SetChatPhotoOption
- type SetChatPhotoParams
- type SetChatStickerSetOption
- type SetChatStickerSetParams
- type SetChatTitleOption
- type SetChatTitleParams
- type SetCustomEmojiStickerSetThumbnailOption
- type SetCustomEmojiStickerSetThumbnailParams
- type SetGameScoreOption
- func WithSetGameScoreChatID(value int64) SetGameScoreOption
- func WithSetGameScoreDisableEditMessage(value bool) SetGameScoreOption
- func WithSetGameScoreForce(value bool) SetGameScoreOption
- func WithSetGameScoreInlineMessageID(value string) SetGameScoreOption
- func WithSetGameScoreMessageID(value int64) SetGameScoreOption
- func WithSetGameScoreScore(value int64) SetGameScoreOption
- func WithSetGameScoreUserID(value int64) SetGameScoreOption
- type SetGameScoreParams
- type SetMessageReactionOption
- func WithSetMessageReactionChatID(value string) SetMessageReactionOption
- func WithSetMessageReactionIsBig(value bool) SetMessageReactionOption
- func WithSetMessageReactionMessageID(value int64) SetMessageReactionOption
- func WithSetMessageReactionReaction(value []ReactionType) SetMessageReactionOption
- type SetMessageReactionParams
- type SetMyCommandsOption
- type SetMyCommandsParams
- type SetMyDefaultAdministratorRightsOption
- type SetMyDefaultAdministratorRightsParams
- type SetMyDescriptionOption
- type SetMyDescriptionParams
- type SetMyNameOption
- type SetMyNameParams
- type SetMyProfilePhotoOption
- type SetMyProfilePhotoParams
- type SetMyShortDescriptionOption
- type SetMyShortDescriptionParams
- type SetPassportDataErrorsOption
- type SetPassportDataErrorsParams
- type SetStickerEmojiListOption
- type SetStickerEmojiListParams
- type SetStickerKeywordsOption
- type SetStickerKeywordsParams
- type SetStickerMaskPositionOption
- type SetStickerMaskPositionParams
- type SetStickerPositionInSetOption
- type SetStickerPositionInSetParams
- type SetStickerSetThumbnailOption
- func WithSetStickerSetThumbnailFormat(value string) SetStickerSetThumbnailOption
- func WithSetStickerSetThumbnailName(value string) SetStickerSetThumbnailOption
- func WithSetStickerSetThumbnailThumbnail(value *InputFile) SetStickerSetThumbnailOption
- func WithSetStickerSetThumbnailUserID(value int64) SetStickerSetThumbnailOption
- type SetStickerSetThumbnailParams
- type SetStickerSetTitleOption
- type SetStickerSetTitleParams
- type SetUserEmojiStatusOption
- type SetUserEmojiStatusParams
- type SetWebhookOption
- func WithSetWebhookAllowedUpdates(value []string) SetWebhookOption
- func WithSetWebhookCertificate(value *InputFile) SetWebhookOption
- func WithSetWebhookDropPendingUpdates(value bool) SetWebhookOption
- func WithSetWebhookIpAddress(value string) SetWebhookOption
- func WithSetWebhookMaxConnections(value int64) SetWebhookOption
- func WithSetWebhookSecretToken(value string) SetWebhookOption
- func WithSetWebhookURL(value string) SetWebhookOption
- type SetWebhookParams
- type SharedUser
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type StarAmount
- type StarTransaction
- type StarTransactions
- type Sticker
- type StickerSet
- type StopMessageLiveLocationOption
- func WithStopMessageLiveLocationBusinessConnectionID(value string) StopMessageLiveLocationOption
- func WithStopMessageLiveLocationChatID(value string) StopMessageLiveLocationOption
- func WithStopMessageLiveLocationInlineMessageID(value string) StopMessageLiveLocationOption
- func WithStopMessageLiveLocationMessageID(value int64) StopMessageLiveLocationOption
- func WithStopMessageLiveLocationReplyMarkup(value *InlineKeyboardMarkup) StopMessageLiveLocationOption
- type StopMessageLiveLocationParams
- type StopPollOption
- type StopPollParams
- type Story
- type StoryArea
- type StoryAreaPosition
- type StoryAreaType
- type StoryAreaTypeLink
- type StoryAreaTypeLocation
- type StoryAreaTypeSuggestedReaction
- type StoryAreaTypeUniqueGift
- type StoryAreaTypeWeather
- type SuccessfulPayment
- type SuggestedPostApprovalFailed
- type SuggestedPostApproved
- type SuggestedPostDeclined
- type SuggestedPostInfo
- type SuggestedPostPaid
- type SuggestedPostParameters
- type SuggestedPostPrice
- type SuggestedPostRefunded
- type SwitchInlineQueryChosenChat
- type TextQuote
- type TransactionPartner
- type TransactionPartnerAffiliateProgram
- type TransactionPartnerChat
- type TransactionPartnerFragment
- type TransactionPartnerOther
- type TransactionPartnerTelegramAds
- type TransactionPartnerTelegramApi
- type TransactionPartnerUser
- type TransferBusinessAccountStarsOption
- type TransferBusinessAccountStarsParams
- type TransferGiftOption
- type TransferGiftParams
- type UnbanChatMemberOption
- type UnbanChatMemberParams
- type UnbanChatSenderChatOption
- type UnbanChatSenderChatParams
- type UnhideGeneralForumTopicOption
- type UnhideGeneralForumTopicParams
- type UniqueGift
- type UniqueGiftBackdrop
- type UniqueGiftBackdropColors
- type UniqueGiftColors
- type UniqueGiftInfo
- type UniqueGiftModel
- type UniqueGiftSymbol
- type UnpinAllChatMessagesOption
- type UnpinAllChatMessagesParams
- type UnpinAllForumTopicMessagesOption
- type UnpinAllForumTopicMessagesParams
- type UnpinAllGeneralForumTopicMessagesOption
- type UnpinAllGeneralForumTopicMessagesParams
- type UnpinChatMessageOption
- type UnpinChatMessageParams
- type Update
- type UpgradeGiftOption
- type UpgradeGiftParams
- type UploadStickerFileOption
- type UploadStickerFileParams
- type User
- type UserChatBoosts
- type UserProfileAudios
- type UserProfilePhotos
- type UserRating
- type UsersShared
- type Venue
- type VerifyChatOption
- type VerifyChatParams
- type VerifyUserOption
- type VerifyUserParams
- type Video
- type VideoChatEnded
- type VideoChatParticipantsInvited
- type VideoChatScheduled
- type VideoChatStarted
- type VideoNote
- type VideoQuality
- type Voice
- type WebAppData
- type WebAppInfo
- type WebhookInfo
- type WriteAccessAllowed
Constants ¶
const ( // CommandStart is the default start command. CommandStart = "/start" // CommandHelp is the default help command. CommandHelp = "/help" // CommandSettings is the default settings command. CommandSettings = "/settings" )
Standard bot commands.
const ( // CommandMaxLen is the maximum command length accepted by Telegram. CommandMaxLen = 32 // StartParamMaxLen is the maximum deep-link start parameter length. StartParamMaxLen = 64 // MessageMaxLen is the maximum text message length. MessageMaxLen = 4096 // CaptionMaxLen is the maximum media caption length. CaptionMaxLen = 1024 // MediaGroupMaxLen is the maximum number of media items in an album. MediaGroupMaxLen = 10 )
Constants for Telegram limits.
const ( // MessageEntityMention represents a mention of a user (e.g., @username). MessageEntityMention = "mention" // MessageEntityHashtag represents a hashtag (e.g., #hashtag). MessageEntityHashtag = "hashtag" // MessageEntityCashtag represents a cashtag (e.g., $USD). MessageEntityCashtag = "cashtag" // MessageEntityBotCommand represents a bot command (e.g., /start). MessageEntityBotCommand = "bot_command" // MessageEntityBotURL represents a URL (e.g., https://telegram.org). MessageEntityBotURL = "url" // MessageEntityEmail represents an email address (e.g., [email protected]). MessageEntityEmail = "email" // MessageEntityPhoneNumber represents a phone number (e.g., +1-212-555-0123). MessageEntityPhoneNumber = "phone_number" // MessageEntityBold represents bold text. MessageEntityBold = "bold" // MessageEntityItalic represents italic text. MessageEntityItalic = "italic" // MessageEntityUnderline represents underlined text. MessageEntityUnderline = "underline" // MessageEntityStrikethrough represents strikethrough text. MessageEntityStrikethrough = "strikethrough" // MessageEntitySpoiler represents spoiler message. MessageEntitySpoiler = "spoiler" // MessageEntityBlockquote represents a block quotation. MessageEntityBlockquote = "blockquote" // MessageEntityExpandableBlockquote represents a collapsed-by-default block quotation. MessageEntityExpandableBlockquote = "expandable_blockquote" // MessageEntityCode represents a monowidth string. MessageEntityCode = "code" // MessageEntityPre represents a monowidth block. MessageEntityPre = "pre" // MessageEntityTextLink represents a clickable text URL. MessageEntityTextLink = "text_link" // MessageEntityTextMention represents a mention of a user without a username. MessageEntityTextMention = "text_mention" // MessageEntityCustomEmoji represents an inline custom emoji sticker. MessageEntityCustomEmoji = "custom_emoji" )
Message entity types.
const ( // ParseModeHTML enables Telegram HTML formatting. ParseModeHTML = "HTML" // https://core.telegram.org/bots/api#html-style // ParseModeMarkdown enables legacy Telegram Markdown formatting. ParseModeMarkdown = "Markdown" // https://core.telegram.org/bots/api#markdown-style // ParseModeMarkdownV2 enables Telegram MarkdownV2 formatting. ParseModeMarkdownV2 = "MarkdownV2" // https://core.telegram.org/bots/api#markdownv2-style )
Parse modes for text formatting.
const ( // ChatPrivate represents a private chat. ChatPrivate = "private" // ChatGroup represents a basic group chat. ChatGroup = "group" // ChatSupergroup represents a supergroup chat. ChatSupergroup = "supergroup" // ChatChannel represents a channel chat. ChatChannel = "channel" )
Chat types.
const ( // ChatActionTyping for text messages. ChatActionTyping = "typing" // ChatActionUploadPhoto for photos. ChatActionUploadPhoto = "upload_photo" // ChatActionRecordVideo for videos. ChatActionRecordVideo = "record_video" // ChatActionUploadVideo for videos. ChatActionUploadVideo = "upload_video" // ChatActionRecordVoice for voice notes. ChatActionRecordVoice = "record_voice" // ChatActionUploadVoice for voice notes. ChatActionUploadVoice = "upload_voice" // ChatActionUploadDocument for general files. ChatActionUploadDocument = "upload_document" // ChatActionChooseSticker for stickers. ChatActionChooseSticker = "choose_sticker" // ChatActionFindLocation for location data. ChatActionFindLocation = "find_location" // ChatActionRecordVideoNote for video notes. ChatActionRecordVideoNote = "record_video_note" // ChatActionUploadVideoNote for video notes. ChatActionUploadVideoNote = "upload_video_note" )
Chat actions that can be sent using sendChatAction.
const BusinessStartPayloadPrefix = "bizChat" // bizChat<user_chat_id>
BusinessStartPayloadPrefix is the payload prefix used for business chat start links.
Variables ¶
var ( // ErrNoToken indicates that an empty bot token was provided. ErrNoToken = errors.New("gogram: no token provided") // ErrInvalidToken indicates that the provided bot token is malformed. ErrInvalidToken = errors.New("gogram: invalid token provided") // ErrAlreadyStarted indicates that Start was called for an already running client. ErrAlreadyStarted = errors.New("gogram: already started") )
Client errors returned by constructors and runtime operations.
var ( // ErrBadRequest indicates an invalid request payload or parameters. ErrBadRequest = NewError(http.StatusBadRequest, http.StatusText(http.StatusBadRequest)) ErrUnauthorized = NewError(http.StatusUnauthorized, http.StatusText(http.StatusUnauthorized)) // ErrForbidden indicates that the operation is not allowed. ErrForbidden = NewError(http.StatusForbidden, http.StatusText(http.StatusForbidden)) // ErrNotFound indicates that the requested resource does not exist. ErrNotFound = NewError(http.StatusNotFound, http.StatusText(http.StatusNotFound)) // ErrConflict indicates a conflicting request state. ErrConflict = NewError(http.StatusConflict, http.StatusText(http.StatusConflict)) // ErrTooManyRequests indicates that rate limits were exceeded. ErrTooManyRequests = NewError(http.StatusTooManyRequests, http.StatusText(http.StatusTooManyRequests)) // ErrInternalServerError indicates an internal Telegram server error. ErrInternalServerError = NewError(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError)) // ErrBadGateway indicates a Telegram upstream gateway failure. ErrBadGateway = NewError(http.StatusBadGateway, http.StatusText(http.StatusBadGateway)) ErrServiceUnavailable = NewError(http.StatusServiceUnavailable, http.StatusText(http.StatusServiceUnavailable)) // ErrGatewayTimeout indicates a Telegram upstream timeout. ErrGatewayTimeout = NewError(http.StatusGatewayTimeout, http.StatusText(http.StatusGatewayTimeout)) // ErrEOF indicates an empty response body where JSON was expected. ErrEOF = NewError(http.StatusBadRequest, "EOF") )
Base API errors returned by Telegram.
var ( ErrBadRequestWrongRemoteFileIdentifierSpecified = NewError(http.StatusBadRequest, "Bad Request: wrong remote file identifier specified: Wrong character in the string") ErrBadRequestCantUseFileOfTypeDocumentAsPhoto = NewError(http.StatusBadRequest, "Bad Request: can't use file of type Document as Photo") // ErrBadRequestParticipantIDInvalid indicates the bot cannot access this user yet. ErrBadRequestParticipantIDInvalid = NewError(http.StatusBadRequest, "Bad Request: PARTICIPANT_ID_INVALID") // ErrBadRequestChatNotFound indicates that the target chat does not exist or is inaccessible. ErrBadRequestChatNotFound = NewError(http.StatusBadRequest, "Bad Request: chat not found") // ErrBadRequestFileMustBeNonEmpty indicates that an uploaded file is empty. ErrBadRequestFileMustBeNonEmpty = NewError(http.StatusBadRequest, "Bad Request: file must be non-empty") )
Known custom bad request errors returned by Telegram.
var ( // ErrConflictWithBot indicates another getUpdates consumer is already running. ErrConflictWithBot = NewError(http.StatusConflict, "Conflict: terminated by other getUpdates request; make sure that only one bot instance is running") )
Conflict errors returned by Telegram.
var ( // ErrForbiddenBotWasBlockedByTheUser indicates that the user blocked the bot. ErrForbiddenBotWasBlockedByTheUser = NewError(http.StatusForbidden, "Forbidden: bot was blocked by the user") )
Forbidden errors returned by Telegram.
var ( // ErrNotFoundBanned indicates that the bot has been banned. ErrNotFoundBanned = NewError(http.StatusNotFound, "Contact https://t.me/BotSupport for assistance") )
Not-found flavored errors returned by Telegram.
var RequiredCommands = [...]string{ CommandStart, CommandHelp, CommandSettings, }
RequiredCommands lists the commands that are typically required for a bot.
var StartParamRegexp = regexp.MustCompile("[A-Za-z0-9_-]{1,64}")
StartParamRegexp is a regular expression for validating start parameters.
Functions ¶
func DownloadByFileID ¶
DownloadByFileID resolves the file path by fileID and downloads the file to the specified local path.
func DownloadFile ¶
DownloadFile downloads a file from Telegram servers to the specified local path.
func ExtractArgs ¶
ExtractArgs splits the text by spaces and returns the arguments (excluding the command).
func ExtractPayload ¶
ExtractPayload returns the substring after the first space.
func ReceiveFileReader ¶
func ReceiveFileReader(client *Client, file *File) (io.ReadCloser, error)
ReceiveFileReader returns a reader for the file content from Telegram servers. The caller is responsible for closing the reader.
func ReceiveFileReaderByFileID ¶
func ReceiveFileReaderByFileID(client *Client, fileID string) (io.ReadCloser, error)
ReceiveFileReaderByFileID resolves the file path by fileID and returns a reader for the content. The caller is responsible for closing the reader.
Types ¶
type AcceptedGiftTypes ¶
type AcceptedGiftTypes struct {
// True, if unlimited regular gifts are accepted
UnlimitedGifts bool `json:"unlimited_gifts"`
// True, if limited regular gifts are accepted
LimitedGifts bool `json:"limited_gifts"`
// True, if unique gifts or gifts that can be upgraded to unique for free are accepted
UniqueGifts bool `json:"unique_gifts"`
// True, if a Telegram Premium subscription is accepted
PremiumSubscription bool `json:"premium_subscription"`
// True, if transfers of unique gifts from channels are accepted
GiftsFromChannels bool `json:"gifts_from_channels"`
}
AcceptedGiftTypes
This object describes the types of gifts that can be gifted to a user or a chat.
type AddStickerToSetOption ¶
type AddStickerToSetOption func(params *AddStickerToSetParams) AddStickerToSetOption
AddStickerToSetOption configures AddStickerToSetParams.
func WithAddStickerToSetName ¶
func WithAddStickerToSetName(value string) AddStickerToSetOption
WithAddStickerToSetName sets the Name field.
Sticker set name
func WithAddStickerToSetSticker ¶
func WithAddStickerToSetSticker(value InputSticker) AddStickerToSetOption
WithAddStickerToSetSticker sets the Sticker field.
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 WithAddStickerToSetUserID ¶
func WithAddStickerToSetUserID(value int64) AddStickerToSetOption
WithAddStickerToSetUserID sets the UserID field.
User identifier of sticker set owner
type AddStickerToSetParams ¶
type AddStickerToSetParams struct {
// User identifier of sticker set owner
UserID int64 `json:"user_id"`
// Sticker set name
Name string `json:"name"`
// 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.
Sticker InputSticker `json:"sticker"`
}
AddStickerToSetParams contains parameters for Client.AddStickerToSet.
func (*AddStickerToSetParams) Option ¶
func (r *AddStickerToSetParams) Option(opts ...AddStickerToSetOption) (previous AddStickerToSetOption)
Option applies one or more AddStickerToSetOption values and returns the last rollback option.
type AffiliateInfo ¶
type AffiliateInfo struct {
// Optional.
// The bot or the user that received an affiliate commission if it was received by a bot or a user
AffiliateUser *User `json:"affiliate_user,omitempty"`
// Optional.
// The chat that received an affiliate commission if it was received by a chat
AffiliateChat *Chat `json:"affiliate_chat,omitempty"`
// The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users
CommissionPerMille int64 `json:"commission_per_mille"`
// Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds
Amount int64 `json:"amount"`
// Optional.
// The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds
NanostarAmount int64 `json:"nanostar_amount,omitempty"`
}
AffiliateInfo
Contains information about the affiliate that received a commission via this transaction.
type Animation ¶
type Animation 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"`
// Video width as defined by the sender
Width int64 `json:"width"`
// Video height as defined by the sender
Height int64 `json:"height"`
// Duration of the video in seconds as defined by the sender
Duration int64 `json:"duration"`
// Optional.
// Animation thumbnail as defined by the sender
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
// Optional.
// Original animation filename as defined by the sender
FileName string `json:"file_name,omitempty"`
// Optional.
// MIME type of the file as defined by the sender
MimeType string `json:"mime_type,omitempty"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
FileSize int64 `json:"file_size,omitempty"`
}
Animation
This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
type AnswerCallbackQueryOption ¶
type AnswerCallbackQueryOption func(params *AnswerCallbackQueryParams) AnswerCallbackQueryOption
AnswerCallbackQueryOption configures AnswerCallbackQueryParams.
func WithAnswerCallbackQueryCacheTime ¶
func WithAnswerCallbackQueryCacheTime(value int64) AnswerCallbackQueryOption
WithAnswerCallbackQueryCacheTime sets the CacheTime field.
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 WithAnswerCallbackQueryCallbackQueryID ¶
func WithAnswerCallbackQueryCallbackQueryID(value string) AnswerCallbackQueryOption
WithAnswerCallbackQueryCallbackQueryID sets the CallbackQueryID field.
Unique identifier for the query to be answered
func WithAnswerCallbackQueryShowAlert ¶
func WithAnswerCallbackQueryShowAlert(value bool) AnswerCallbackQueryOption
WithAnswerCallbackQueryShowAlert sets the ShowAlert field.
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 WithAnswerCallbackQueryText ¶
func WithAnswerCallbackQueryText(value string) AnswerCallbackQueryOption
WithAnswerCallbackQueryText sets the Text field.
Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
func WithAnswerCallbackQueryURL ¶
func WithAnswerCallbackQueryURL(value string) AnswerCallbackQueryOption
WithAnswerCallbackQueryURL sets the URL field.
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 AnswerCallbackQueryParams ¶
type AnswerCallbackQueryParams struct {
// Unique identifier for the query to be answered
CallbackQueryID string `json:"callback_query_id"`
// Text of the notification.
// If not specified, nothing will be shown to the user, 0-200 characters
Text string `json:"text,omitempty"`
// If True, an alert will be shown by the client instead of a notification at the top of the chat screen.
// Defaults to false.
ShowAlert bool `json:"show_alert,omitempty"`
// URL that will be opened by the user's client.
// If you have created a [Game] and accepted the conditions via [@BotFather], specify the URL that opens your game - note that this will only work if the query comes from a [callback_game] button.
//
// Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
//
// [Game]: https://core.telegram.org/bots/api#game
// [@BotFather]: https://t.me/botfather
// [callback_game]: https://core.telegram.org/bots/api#inlinekeyboardbutton
URL string `json:"url,omitempty"`
// The maximum amount of time in seconds that the result of the callback query may be cached client-side.
// Telegram apps will support caching starting in version 3.14.
// Defaults to 0.
CacheTime int64 `json:"cache_time,omitempty"`
}
AnswerCallbackQueryParams contains parameters for Client.AnswerCallbackQuery.
func (*AnswerCallbackQueryParams) Option ¶
func (r *AnswerCallbackQueryParams) Option(opts ...AnswerCallbackQueryOption) (previous AnswerCallbackQueryOption)
Option applies one or more AnswerCallbackQueryOption values and returns the last rollback option.
type AnswerInlineQueryOption ¶
type AnswerInlineQueryOption func(params *AnswerInlineQueryParams) AnswerInlineQueryOption
AnswerInlineQueryOption configures AnswerInlineQueryParams.
func WithAnswerInlineQueryButton ¶
func WithAnswerInlineQueryButton(value *InlineQueryResultsButton) AnswerInlineQueryOption
WithAnswerInlineQueryButton sets the Button field.
A JSON-serialized object describing a button to be shown above inline query results
func WithAnswerInlineQueryCacheTime ¶
func WithAnswerInlineQueryCacheTime(value int64) AnswerInlineQueryOption
WithAnswerInlineQueryCacheTime sets the CacheTime field.
The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
func WithAnswerInlineQueryInlineQueryID ¶
func WithAnswerInlineQueryInlineQueryID(value string) AnswerInlineQueryOption
WithAnswerInlineQueryInlineQueryID sets the InlineQueryID field.
Unique identifier for the answered query
func WithAnswerInlineQueryIsPersonal ¶
func WithAnswerInlineQueryIsPersonal(value bool) AnswerInlineQueryOption
WithAnswerInlineQueryIsPersonal sets the IsPersonal field.
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 WithAnswerInlineQueryNextOffset ¶
func WithAnswerInlineQueryNextOffset(value string) AnswerInlineQueryOption
WithAnswerInlineQueryNextOffset sets the NextOffset field.
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 WithAnswerInlineQueryResults ¶
func WithAnswerInlineQueryResults(value []InlineQueryResult) AnswerInlineQueryOption
WithAnswerInlineQueryResults sets the Results field.
A JSON-serialized array of results for the inline query
type AnswerInlineQueryParams ¶
type AnswerInlineQueryParams struct {
// Unique identifier for the answered query
InlineQueryID string `json:"inline_query_id"`
// A JSON-serialized array of results for the inline query
Results []InlineQueryResult `json:"results"`
// The maximum amount of time in seconds that the result of the inline query may be cached on the server.
// Defaults to 300.
CacheTime int64 `json:"cache_time,omitempty"`
// Pass True if results may be cached on the server side only for the user that sent the query.
// By default, results may be returned to any user who sends the same query.
IsPersonal bool `json:"is_personal,omitempty"`
// Pass the offset that a client should send in the next query with the same text to receive more results.
// Pass an empty string if there are no more results or if you don't support pagination.
// Offset length can't exceed 64 bytes.
NextOffset string `json:"next_offset,omitempty"`
// A JSON-serialized object describing a button to be shown above inline query results
Button *InlineQueryResultsButton `json:"button,omitempty"`
}
AnswerInlineQueryParams contains parameters for Client.AnswerInlineQuery.
func (*AnswerInlineQueryParams) Option ¶
func (r *AnswerInlineQueryParams) Option(opts ...AnswerInlineQueryOption) (previous AnswerInlineQueryOption)
Option applies one or more AnswerInlineQueryOption values and returns the last rollback option.
type AnswerPreCheckoutQueryOption ¶
type AnswerPreCheckoutQueryOption func(params *AnswerPreCheckoutQueryParams) AnswerPreCheckoutQueryOption
AnswerPreCheckoutQueryOption configures AnswerPreCheckoutQueryParams.
func WithAnswerPreCheckoutQueryErrorMessage ¶
func WithAnswerPreCheckoutQueryErrorMessage(value string) AnswerPreCheckoutQueryOption
WithAnswerPreCheckoutQueryErrorMessage sets the ErrorMessage field.
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 WithAnswerPreCheckoutQueryOk ¶
func WithAnswerPreCheckoutQueryOk(value bool) AnswerPreCheckoutQueryOption
WithAnswerPreCheckoutQueryOk sets the Ok field.
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 WithAnswerPreCheckoutQueryPreCheckoutQueryID ¶
func WithAnswerPreCheckoutQueryPreCheckoutQueryID(value string) AnswerPreCheckoutQueryOption
WithAnswerPreCheckoutQueryPreCheckoutQueryID sets the PreCheckoutQueryID field.
Unique identifier for the query to be answered
type AnswerPreCheckoutQueryParams ¶
type AnswerPreCheckoutQueryParams struct {
// Unique identifier for the query to be answered
PreCheckoutQueryID string `json:"pre_checkout_query_id"`
// 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.
Ok bool `json:"ok"`
// Required if ok is False.
// Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g.
// "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details.
// Please choose a different color or garment!").
// Telegram will display this message to the user.
ErrorMessage string `json:"error_message,omitempty"`
}
AnswerPreCheckoutQueryParams contains parameters for Client.AnswerPreCheckoutQuery.
func (*AnswerPreCheckoutQueryParams) Option ¶
func (r *AnswerPreCheckoutQueryParams) Option(opts ...AnswerPreCheckoutQueryOption) (previous AnswerPreCheckoutQueryOption)
Option applies one or more AnswerPreCheckoutQueryOption values and returns the last rollback option.
type AnswerShippingQueryOption ¶
type AnswerShippingQueryOption func(params *AnswerShippingQueryParams) AnswerShippingQueryOption
AnswerShippingQueryOption configures AnswerShippingQueryParams.
func WithAnswerShippingQueryErrorMessage ¶
func WithAnswerShippingQueryErrorMessage(value string) AnswerShippingQueryOption
WithAnswerShippingQueryErrorMessage sets the ErrorMessage field.
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 WithAnswerShippingQueryOk ¶
func WithAnswerShippingQueryOk(value bool) AnswerShippingQueryOption
WithAnswerShippingQueryOk sets the Ok field.
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 WithAnswerShippingQueryShippingOptions ¶
func WithAnswerShippingQueryShippingOptions(value []ShippingOption) AnswerShippingQueryOption
WithAnswerShippingQueryShippingOptions sets the ShippingOptions field.
Required if ok is True. A JSON-serialized array of available shipping options.
func WithAnswerShippingQueryShippingQueryID ¶
func WithAnswerShippingQueryShippingQueryID(value string) AnswerShippingQueryOption
WithAnswerShippingQueryShippingQueryID sets the ShippingQueryID field.
Unique identifier for the query to be answered
type AnswerShippingQueryParams ¶
type AnswerShippingQueryParams struct {
// Unique identifier for the query to be answered
ShippingQueryID string `json:"shipping_query_id"`
// 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)
Ok bool `json:"ok"`
// Required if ok is True.
// A JSON-serialized array of available shipping options.
ShippingOptions []ShippingOption `json:"shipping_options,omitempty"`
// Required if ok is False.
// Error message in human readable form that explains why it is impossible to complete the order (e.g.
// “Sorry, delivery to your desired address is unavailable”).
// Telegram will display this message to the user.
ErrorMessage string `json:"error_message,omitempty"`
}
AnswerShippingQueryParams contains parameters for Client.AnswerShippingQuery.
func (*AnswerShippingQueryParams) Option ¶
func (r *AnswerShippingQueryParams) Option(opts ...AnswerShippingQueryOption) (previous AnswerShippingQueryOption)
Option applies one or more AnswerShippingQueryOption values and returns the last rollback option.
type AnswerWebAppQueryOption ¶
type AnswerWebAppQueryOption func(params *AnswerWebAppQueryParams) AnswerWebAppQueryOption
AnswerWebAppQueryOption configures AnswerWebAppQueryParams.
func WithAnswerWebAppQueryResult ¶
func WithAnswerWebAppQueryResult(value InlineQueryResult) AnswerWebAppQueryOption
WithAnswerWebAppQueryResult sets the Result field.
A JSON-serialized object describing the message to be sent
func WithAnswerWebAppQueryWebAppQueryID ¶
func WithAnswerWebAppQueryWebAppQueryID(value string) AnswerWebAppQueryOption
WithAnswerWebAppQueryWebAppQueryID sets the WebAppQueryID field.
Unique identifier for the query to be answered
type AnswerWebAppQueryParams ¶
type AnswerWebAppQueryParams struct {
// Unique identifier for the query to be answered
WebAppQueryID string `json:"web_app_query_id"`
// A JSON-serialized object describing the message to be sent
Result InlineQueryResult `json:"result"`
}
AnswerWebAppQueryParams contains parameters for Client.AnswerWebAppQuery.
func (*AnswerWebAppQueryParams) Option ¶
func (r *AnswerWebAppQueryParams) Option(opts ...AnswerWebAppQueryOption) (previous AnswerWebAppQueryOption)
Option applies one or more AnswerWebAppQueryOption values and returns the last rollback option.
type ApproveChatJoinRequestOption ¶
type ApproveChatJoinRequestOption func(params *ApproveChatJoinRequestParams) ApproveChatJoinRequestOption
ApproveChatJoinRequestOption configures ApproveChatJoinRequestParams.
func WithApproveChatJoinRequestChatID ¶
func WithApproveChatJoinRequestChatID(value string) ApproveChatJoinRequestOption
WithApproveChatJoinRequestChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithApproveChatJoinRequestUserID ¶
func WithApproveChatJoinRequestUserID(value int64) ApproveChatJoinRequestOption
WithApproveChatJoinRequestUserID sets the UserID field.
Unique identifier of the target user
type ApproveChatJoinRequestParams ¶
type ApproveChatJoinRequestParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
}
ApproveChatJoinRequestParams contains parameters for Client.ApproveChatJoinRequest.
func (*ApproveChatJoinRequestParams) Option ¶
func (r *ApproveChatJoinRequestParams) Option(opts ...ApproveChatJoinRequestOption) (previous ApproveChatJoinRequestOption)
Option applies one or more ApproveChatJoinRequestOption values and returns the last rollback option.
type ApproveSuggestedPostOption ¶
type ApproveSuggestedPostOption func(params *ApproveSuggestedPostParams) ApproveSuggestedPostOption
ApproveSuggestedPostOption configures ApproveSuggestedPostParams.
func WithApproveSuggestedPostChatID ¶
func WithApproveSuggestedPostChatID(value int64) ApproveSuggestedPostOption
WithApproveSuggestedPostChatID sets the ChatID field.
Unique identifier for the target direct messages chat
func WithApproveSuggestedPostMessageID ¶
func WithApproveSuggestedPostMessageID(value int64) ApproveSuggestedPostOption
WithApproveSuggestedPostMessageID sets the MessageID field.
Identifier of a suggested post message to approve
func WithApproveSuggestedPostSendDate ¶
func WithApproveSuggestedPostSendDate(value int64) ApproveSuggestedPostOption
WithApproveSuggestedPostSendDate sets the SendDate field.
Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created. If specified, then the date must be not more than 2678400 seconds (30 days) in the future
type ApproveSuggestedPostParams ¶
type ApproveSuggestedPostParams struct {
// Unique identifier for the target direct messages chat
ChatID int64 `json:"chat_id"`
// Identifier of a suggested post message to approve
MessageID int64 `json:"message_id"`
// Point in time (Unix timestamp) when the post is expected to be published; omit if the date has already been specified when the suggested post was created.
// If specified, then the date must be not more than 2678400 seconds (30 days) in the future
SendDate int64 `json:"send_date,omitempty"`
}
ApproveSuggestedPostParams contains parameters for Client.ApproveSuggestedPost.
func (*ApproveSuggestedPostParams) Option ¶
func (r *ApproveSuggestedPostParams) Option(opts ...ApproveSuggestedPostOption) (previous ApproveSuggestedPostOption)
Option applies one or more ApproveSuggestedPostOption values and returns the last rollback option.
type Audio ¶
type Audio 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"`
// Duration of the audio in seconds as defined by the sender
Duration int64 `json:"duration"`
// Optional.
// Performer of the audio as defined by the sender or by audio tags
Performer string `json:"performer,omitempty"`
// Optional.
// Title of the audio as defined by the sender or by audio tags
Title string `json:"title,omitempty"`
// Optional.
// Original filename as defined by the sender
FileName string `json:"file_name,omitempty"`
// Optional.
// MIME type of the file as defined by the sender
MimeType string `json:"mime_type,omitempty"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
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 BackgroundFill ¶
type BackgroundFill struct {
*BackgroundFillSolid
*BackgroundFillGradient
*BackgroundFillFreeformGradient
}
BackgroundFill
This object describes the way a background is filled based on the selected colors. Currently, it can be one of
BackgroundFillFreeformGradient
func (*BackgroundFill) MarshalJSON ¶
func (r *BackgroundFill) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of BackgroundFill.
func (*BackgroundFill) UnmarshalJSON ¶
func (r *BackgroundFill) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching BackgroundFill subtype.
type BackgroundFillFreeformGradient ¶
type BackgroundFillFreeformGradient struct {
// Type of the background fill, always “freeform_gradient”
Type string `json:"type"`
// A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format
Colors []int64 `json:"colors"`
}
BackgroundFillFreeformGradient
The background is a freeform gradient that rotates after every message in the chat.
type BackgroundFillGradient ¶
type BackgroundFillGradient struct {
// Type of the background fill, always “gradient”
Type string `json:"type"`
// Top color of the gradient in the RGB24 format
TopColor int64 `json:"top_color"`
// Bottom color of the gradient in the RGB24 format
BottomColor int64 `json:"bottom_color"`
// Clockwise rotation angle of the background fill in degrees; 0-359
RotationAngle int64 `json:"rotation_angle"`
}
BackgroundFillGradient
The background is a gradient fill.
type BackgroundFillSolid ¶
type BackgroundFillSolid struct {
// Type of the background fill, always “solid”
Type string `json:"type"`
// The color of the background fill in the RGB24 format
Color int64 `json:"color"`
}
BackgroundFillSolid
The background is filled using the selected color.
type BackgroundType ¶
type BackgroundType struct {
*BackgroundTypeFill
*BackgroundTypeWallpaper
*BackgroundTypePattern
*BackgroundTypeChatTheme
}
BackgroundType
This object describes the type of a background. Currently, it can be one of
func (*BackgroundType) MarshalJSON ¶
func (r *BackgroundType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of BackgroundType.
func (*BackgroundType) UnmarshalJSON ¶
func (r *BackgroundType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching BackgroundType subtype.
type BackgroundTypeChatTheme ¶
type BackgroundTypeChatTheme struct {
// Type of the background, always “chat_theme”
Type string `json:"type"`
// Name of the chat theme, which is usually an emoji
ThemeName string `json:"theme_name"`
}
BackgroundTypeChatTheme
The background is taken directly from a built-in chat theme.
type BackgroundTypeFill ¶
type BackgroundTypeFill struct {
// Type of the background, always “fill”
Type string `json:"type"`
// The background fill
Fill BackgroundFill `json:"fill"`
// Dimming of the background in dark themes, as a percentage; 0-100
DarkThemeDimming int64 `json:"dark_theme_dimming"`
}
BackgroundTypeFill
The background is automatically filled based on the selected colors.
type BackgroundTypePattern ¶
type BackgroundTypePattern struct {
// Type of the background, always “pattern”
Type string `json:"type"`
// Document with the pattern
Document Document `json:"document"`
// The background fill that is combined with the pattern
Fill BackgroundFill `json:"fill"`
// Intensity of the pattern when it is shown above the filled background; 0-100
Intensity int64 `json:"intensity"`
// Optional.
// True, if the background fill must be applied only to the pattern itself.
// All other pixels are black in this case.
// For dark themes only
IsInverted bool `json:"is_inverted,omitempty"`
// Optional.
// True, if the background moves slightly when the device is tilted
IsMoving bool `json:"is_moving,omitempty"`
}
BackgroundTypePattern
The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
type BackgroundTypeWallpaper ¶
type BackgroundTypeWallpaper struct {
// Type of the background, always “wallpaper”
Type string `json:"type"`
// Document with the wallpaper
Document Document `json:"document"`
// Dimming of the background in dark themes, as a percentage; 0-100
DarkThemeDimming int64 `json:"dark_theme_dimming"`
// Optional.
// True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
IsBlurred bool `json:"is_blurred,omitempty"`
// Optional.
// True, if the background moves slightly when the device is tilted
IsMoving bool `json:"is_moving,omitempty"`
}
BackgroundTypeWallpaper
The background is a wallpaper in the JPEG format.
type BanChatMemberOption ¶
type BanChatMemberOption func(params *BanChatMemberParams) BanChatMemberOption
BanChatMemberOption configures BanChatMemberParams.
func WithBanChatMemberChatID ¶
func WithBanChatMemberChatID(value string) BanChatMemberOption
WithBanChatMemberChatID sets the ChatID field.
Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
func WithBanChatMemberRevokeMessages ¶
func WithBanChatMemberRevokeMessages(value bool) BanChatMemberOption
WithBanChatMemberRevokeMessages sets the RevokeMessages field.
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 WithBanChatMemberUntilDate ¶
func WithBanChatMemberUntilDate(value int64) BanChatMemberOption
WithBanChatMemberUntilDate sets the UntilDate field.
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 WithBanChatMemberUserID ¶
func WithBanChatMemberUserID(value int64) BanChatMemberOption
WithBanChatMemberUserID sets the UserID field.
Unique identifier of the target user
type BanChatMemberParams ¶
type BanChatMemberParams struct {
// Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// 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.
UntilDate int64 `json:"until_date,omitempty"`
// 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.
RevokeMessages bool `json:"revoke_messages,omitempty"`
}
BanChatMemberParams contains parameters for Client.BanChatMember.
func (*BanChatMemberParams) Option ¶
func (r *BanChatMemberParams) Option(opts ...BanChatMemberOption) (previous BanChatMemberOption)
Option applies one or more BanChatMemberOption values and returns the last rollback option.
type BanChatSenderChatOption ¶
type BanChatSenderChatOption func(params *BanChatSenderChatParams) BanChatSenderChatOption
BanChatSenderChatOption configures BanChatSenderChatParams.
func WithBanChatSenderChatChatID ¶
func WithBanChatSenderChatChatID(value string) BanChatSenderChatOption
WithBanChatSenderChatChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithBanChatSenderChatSenderChatID ¶
func WithBanChatSenderChatSenderChatID(value int64) BanChatSenderChatOption
WithBanChatSenderChatSenderChatID sets the SenderChatID field.
Unique identifier of the target sender chat
type BanChatSenderChatParams ¶
type BanChatSenderChatParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target sender chat
SenderChatID int64 `json:"sender_chat_id"`
}
BanChatSenderChatParams contains parameters for Client.BanChatSenderChat.
func (*BanChatSenderChatParams) Option ¶
func (r *BanChatSenderChatParams) Option(opts ...BanChatSenderChatOption) (previous BanChatSenderChatOption)
Option applies one or more BanChatSenderChatOption values and returns the last rollback option.
type Birthdate ¶
type Birthdate struct {
// Day of the user's birth; 1-31
Day int64 `json:"day"`
// Month of the user's birth; 1-12
Month int64 `json:"month"`
// Optional.
// Year of the user's birth
Year int64 `json:"year,omitempty"`
}
Birthdate
Describes the birthdate of a user.
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 ¶
type BotCommandScope struct {
*BotCommandScopeDefault
*BotCommandScopeAllPrivateChats
*BotCommandScopeAllGroupChats
*BotCommandScopeAllChatAdministrators
*BotCommandScopeChat
*BotCommandScopeChatAdministrators
*BotCommandScopeChatMember
}
BotCommandScope
This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
BotCommandScopeAllPrivateChats
BotCommandScopeAllChatAdministrators
BotCommandScopeChatAdministrators
func (*BotCommandScope) MarshalJSON ¶
func (r *BotCommandScope) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of BotCommandScope.
func (*BotCommandScope) UnmarshalJSON ¶
func (r *BotCommandScope) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching BotCommandScope subtype.
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.
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.
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.
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).
// Channel direct messages chats and channel chats aren't supported.
ChatID string `json:"chat_id"`
}
BotCommandScopeChat
Represents the scope of bot commands, covering a specific chat.
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).
// Channel direct messages chats and channel chats aren't supported.
ChatID string `json:"chat_id"`
}
BotCommandScopeChatAdministrators
Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
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).
// Channel direct messages chats and channel chats aren't supported.
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
}
BotCommandScopeChatMember
Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
type BotCommandScopeDefault ¶
type BotCommandScopeDefault struct {
// 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.
type BotDescription ¶
type BotDescription struct {
// The bot's description
Description string `json:"description"`
}
BotDescription
This object represents the bot's description.
type BotName ¶
type BotName struct {
// The bot's name
Name string `json:"name"`
}
BotName
This object represents the bot's name.
type BotShortDescription ¶
type BotShortDescription struct {
// The bot's short description
ShortDescription string `json:"short_description"`
}
BotShortDescription
This object represents the bot's short description.
type BusinessBotRights ¶
type BusinessBotRights struct {
// Optional.
// True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours
CanReply bool `json:"can_reply,omitempty"`
// Optional.
// True, if the bot can mark incoming private messages as read
CanReadMessages bool `json:"can_read_messages,omitempty"`
// Optional.
// True, if the bot can delete messages sent by the bot
CanDeleteSentMessages bool `json:"can_delete_sent_messages,omitempty"`
// Optional.
// True, if the bot can delete all private messages in managed chats
CanDeleteAllMessages bool `json:"can_delete_all_messages,omitempty"`
// Optional.
// True, if the bot can edit the first and last name of the business account
CanEditName bool `json:"can_edit_name,omitempty"`
// Optional.
// True, if the bot can edit the bio of the business account
CanEditBio bool `json:"can_edit_bio,omitempty"`
// Optional.
// True, if the bot can edit the profile photo of the business account
CanEditProfilePhoto bool `json:"can_edit_profile_photo,omitempty"`
// Optional.
// True, if the bot can edit the username of the business account
CanEditUsername bool `json:"can_edit_username,omitempty"`
// Optional.
// True, if the bot can change the privacy settings pertaining to gifts for the business account
CanChangeGiftSettings bool `json:"can_change_gift_settings,omitempty"`
// Optional.
// True, if the bot can view gifts and the amount of Telegram Stars owned by the business account
CanViewGiftsAndStars bool `json:"can_view_gifts_and_stars,omitempty"`
// Optional.
// True, if the bot can convert regular gifts owned by the business account to Telegram Stars
CanConvertGiftsToStars bool `json:"can_convert_gifts_to_stars,omitempty"`
// Optional.
// True, if the bot can transfer and upgrade gifts owned by the business account
CanTransferAndUpgradeGifts bool `json:"can_transfer_and_upgrade_gifts,omitempty"`
// Optional.
// True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts
CanTransferStars bool `json:"can_transfer_stars,omitempty"`
// Optional.
// True, if the bot can post, edit and delete stories on behalf of the business account
CanManageStories bool `json:"can_manage_stories,omitempty"`
}
BusinessBotRights
Represents the rights of a business bot.
type BusinessConnection ¶
type BusinessConnection struct {
// Unique identifier of the business connection
ID string `json:"id"`
// Business account user that created the business connection
User User `json:"user"`
// Identifier of a private chat with the user who created the business connection.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
UserChatID int64 `json:"user_chat_id"`
// Date the connection was established in Unix time
Date int64 `json:"date"`
// Optional.
// Rights of the business bot
Rights *BusinessBotRights `json:"rights,omitempty"`
// True, if the connection is active
IsEnabled bool `json:"is_enabled"`
}
BusinessConnection
Describes the connection of the bot with a business account.
type BusinessIntro ¶
type BusinessIntro struct {
// Optional.
// Title text of the business intro
Title string `json:"title,omitempty"`
// Optional.
// Message text of the business intro
Message string `json:"message,omitempty"`
// Optional.
// Sticker of the business intro
Sticker *Sticker `json:"sticker,omitempty"`
}
BusinessIntro
Contains information about the start page settings of a Telegram Business account.
type BusinessLocation ¶
type BusinessLocation struct {
// Address of the business
Address string `json:"address"`
// Optional.
// Location of the business
Location *Location `json:"location,omitempty"`
}
BusinessLocation
Contains information about the location of a Telegram Business account.
type BusinessMessagesDeleted ¶
type BusinessMessagesDeleted struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Information about a chat in the business account.
// The bot may not have access to the chat or the corresponding user.
Chat Chat `json:"chat"`
// The list of identifiers of deleted messages in the chat of the business account
MessageIDs []int64 `json:"message_ids"`
}
BusinessMessagesDeleted
This object is received when messages are deleted from a connected business account.
type BusinessOpeningHours ¶
type BusinessOpeningHours struct {
// Unique name of the time zone for which the opening hours are defined
TimeZoneName string `json:"time_zone_name"`
// List of time intervals describing business opening hours
OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"`
}
BusinessOpeningHours
Describes the opening hours of a business.
type BusinessOpeningHoursInterval ¶
type BusinessOpeningHoursInterval struct {
// The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 * 24 * 60
OpeningMinute int64 `json:"opening_minute"`
// The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 * 24 * 60
ClosingMinute int64 `json:"closing_minute"`
}
BusinessOpeningHoursInterval
Describes an interval of time during which a business is open.
type CallbackGame ¶
type CallbackGame struct {
}
CallbackGame
A placeholder, currently holds no information. Use BotFather to set up your game.
type CallbackQuery ¶
type CallbackQuery struct {
// Unique identifier for this query
ID string `json:"id"`
// Sender
From User `json:"from"`
// Optional.
// Message sent by the bot with the callback button that originated the query
Message *MaybeInaccessibleMessage `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].
//
// [games]: https://core.telegram.org/bots/api#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
//
// [Game]: https://core.telegram.org/bots/api#games
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.
func (*CallbackQuery) Args ¶
func (cq *CallbackQuery) Args() []string
Args extracts arguments from the callback data (strings separated by spaces, excluding the first word).
func (*CallbackQuery) Payload ¶
func (cq *CallbackQuery) Payload() string
Payload extracts the payload from the callback data (string after the first space).
type Chat ¶
type Chat struct {
// Unique identifier for this chat.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
ID int64 `json:"id"`
// Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Type string `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 string `json:"username,omitempty"`
// Optional.
// First name of the other party in a private chat
FirstName string `json:"first_name,omitempty"`
// Optional.
// Last name of the other party in a private chat
LastName string `json:"last_name,omitempty"`
// Optional.
// True, if the supergroup chat is a forum (has [topics] enabled)
//
// [topics]: https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups
IsForum bool `json:"is_forum,omitempty"`
// Optional.
// True, if the chat is the direct messages chat of a channel
IsDirectMessages bool `json:"is_direct_messages,omitempty"`
}
Chat
This object represents a chat.
func (*Chat) Identifier ¶
Identifier returns the chat identifier. It returns the chat ID as a string if available, otherwise it returns the username with an '@' prefix.
func (*Chat) IsSupergroup ¶
IsSupergroup returns true if the chat is a supergroup.
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, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars.
// 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, or access supergroup statistics
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"`
// True, if the administrator can post stories to the chat
CanPostStories bool `json:"can_post_stories"`
// True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
CanEditStories bool `json:"can_edit_stories"`
// True, if the administrator can delete stories posted by other users
CanDeleteStories bool `json:"can_delete_stories"`
// Optional.
// True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
CanPostMessages bool `json:"can_post_messages,omitempty"`
// Optional.
// True, if the administrator can edit messages of other users and can pin messages; for channels only
CanEditMessages bool `json:"can_edit_messages,omitempty"`
// Optional.
// True, if the user is allowed to pin messages; for 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; for supergroups only
CanManageTopics bool `json:"can_manage_topics,omitempty"`
// Optional.
// True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"`
// Optional.
// True, if the administrator can edit the tags of regular members; for groups and supergroups only.
// If omitted defaults to the value of can_pin_messages.
CanManageTags bool `json:"can_manage_tags,omitempty"`
}
ChatAdministratorRights
Represents the rights of an administrator in a chat.
type ChatBackground ¶
type ChatBackground struct {
// Type of the background
Type BackgroundType `json:"type"`
}
ChatBackground
This object represents a chat background.
type ChatBoost ¶
type ChatBoost struct {
// Unique identifier of the boost
BoostID string `json:"boost_id"`
// Point in time (Unix timestamp) when the chat was boosted
AddDate int64 `json:"add_date"`
// Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged
ExpirationDate int64 `json:"expiration_date"`
// Source of the added boost
Source ChatBoostSource `json:"source"`
}
ChatBoost
This object contains information about a chat boost.
type ChatBoostAdded ¶
type ChatBoostAdded struct {
// Number of boosts added by the user
BoostCount int64 `json:"boost_count"`
}
ChatBoostAdded
This object represents a service message about a user boosting a chat.
type ChatBoostRemoved ¶
type ChatBoostRemoved struct {
// Chat which was boosted
Chat Chat `json:"chat"`
// Unique identifier of the boost
BoostID string `json:"boost_id"`
// Point in time (Unix timestamp) when the boost was removed
RemoveDate int64 `json:"remove_date"`
// Source of the removed boost
Source ChatBoostSource `json:"source"`
}
ChatBoostRemoved
This object represents a boost removed from a chat.
type ChatBoostSource ¶
type ChatBoostSource struct {
*ChatBoostSourcePremium
*ChatBoostSourceGiftCode
*ChatBoostSourceGiveaway
}
ChatBoostSource
This object describes the source of a chat boost. It can be one of
func (*ChatBoostSource) MarshalJSON ¶
func (r *ChatBoostSource) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of ChatBoostSource.
func (*ChatBoostSource) UnmarshalJSON ¶
func (r *ChatBoostSource) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching ChatBoostSource subtype.
type ChatBoostSourceGiftCode ¶
type ChatBoostSourceGiftCode struct {
// Source of the boost, always “gift_code”
Source string `json:"source"`
// User for which the gift code was created
User User `json:"user"`
}
ChatBoostSourceGiftCode
The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
type ChatBoostSourceGiveaway ¶
type ChatBoostSourceGiveaway struct {
// Source of the boost, always “giveaway”
Source string `json:"source"`
// Identifier of a message in the chat with the giveaway; the message could have been deleted already.
// May be 0 if the message isn't sent yet.
GiveawayMessageID int64 `json:"giveaway_message_id"`
// Optional.
// User that won the prize in the giveaway if any; for Telegram Premium giveaways only
User *User `json:"user,omitempty"`
// Optional.
// The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
PrizeStarCount int64 `json:"prize_star_count,omitempty"`
// Optional.
// True, if the giveaway was completed, but there was no user to win the prize
IsUnclaimed bool `json:"is_unclaimed,omitempty"`
}
ChatBoostSourceGiveaway
The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
type ChatBoostSourcePremium ¶
type ChatBoostSourcePremium struct {
// Source of the boost, always “premium”
Source string `json:"source"`
// User that boosted the chat
User User `json:"user"`
}
ChatBoostSourcePremium
The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
type ChatBoostUpdated ¶
type ChatBoostUpdated struct {
// Chat which was boosted
Chat Chat `json:"chat"`
// Information about the chat boost
Boost ChatBoost `json:"boost"`
}
ChatBoostUpdated
This object represents a boost added to a chat or changed.
type ChatFullInfo ¶
type ChatFullInfo struct {
// Unique identifier for this chat.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
ID int64 `json:"id"`
// Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Type string `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 string `json:"username,omitempty"`
// Optional.
// First name of the other party in a private chat
FirstName string `json:"first_name,omitempty"`
// Optional.
// Last name of the other party in a private chat
LastName string `json:"last_name,omitempty"`
// Optional.
// True, if the supergroup chat is a forum (has [topics] enabled)
//
// [topics]: https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups
IsForum bool `json:"is_forum,omitempty"`
// Optional.
// True, if the chat is the direct messages chat of a channel
IsDirectMessages bool `json:"is_direct_messages,omitempty"`
// Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview.
// See [accent colors] for more details.
//
// [accent colors]: https://core.telegram.org/bots/api#accent-colors
AccentColorID int64 `json:"accent_color_id"`
// The maximum number of reactions that can be set on a message in the chat
MaxReactionCount int64 `json:"max_reaction_count"`
// Optional.
// Chat photo
Photo *ChatPhoto `json:"photo,omitempty"`
// Optional.
// If non-empty, the list of all [active chat usernames]; for private chats, supergroups and channels
//
// [active chat usernames]: https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames
ActiveUsernames []string `json:"active_usernames,omitempty"`
// Optional.
// For private chats, the date of birth of the user
Birthdate *Birthdate `json:"birthdate,omitempty"`
// Optional.
// For private chats with business accounts, the intro of the business
BusinessIntro *BusinessIntro `json:"business_intro,omitempty"`
// Optional.
// For private chats with business accounts, the location of the business
BusinessLocation *BusinessLocation `json:"business_location,omitempty"`
// Optional.
// For private chats with business accounts, the opening hours of the business
BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"`
// Optional.
// For private chats, the personal channel of the user
PersonalChat *Chat `json:"personal_chat,omitempty"`
// Optional.
// Information about the corresponding channel chat; for direct messages chats only
ParentChat *Chat `json:"parent_chat,omitempty"`
// Optional.
// List of available reactions allowed in the chat.
// If omitted, then all [emoji reactions] are allowed.
//
// [emoji reactions]: https://core.telegram.org/bots/api#reactiontypeemoji
AvailableReactions []ReactionType `json:"available_reactions,omitempty"`
// Optional.
// Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"`
// Optional.
// Identifier of the accent color for the chat's profile background.
// See [profile accent colors] for more details.
//
// [profile accent colors]: https://core.telegram.org/bots/api#profile-accent-colors
ProfileAccentColorID int64 `json:"profile_accent_color_id,omitempty"`
// Optional.
// Custom emoji identifier of the emoji chosen by the chat for its profile background
ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"`
// Optional.
// Custom emoji identifier of the emoji status of the chat or the other party in a private chat
EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"`
// Optional.
// Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any
EmojiStatusExpirationDate int64 `json:"emoji_status_expiration_date,omitempty"`
// Optional.
// Bio of the other party in a private chat
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
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
HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"`
// Optional.
// True, if users need to join the supergroup before they can send messages
JoinToSendMessages bool `json:"join_to_send_messages,omitempty"`
// Optional.
// True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators
JoinByRequest bool `json:"join_by_request,omitempty"`
// Optional.
// Description, for groups, supergroups and channel chats
Description string `json:"description,omitempty"`
// Optional.
// Primary invite link, for groups, supergroups and channel chats
InviteLink string `json:"invite_link,omitempty"`
// Optional.
// The most recent pinned message (by sending date)
PinnedMessage *Message `json:"pinned_message,omitempty"`
// Optional.
// Default chat member permissions, for groups and supergroups
Permissions *ChatPermissions `json:"permissions,omitempty"`
// Information about types of gifts that are accepted by the chat or by the corresponding user for private chats
AcceptedGiftTypes AcceptedGiftTypes `json:"accepted_gift_types"`
// Optional.
// True, if paid media messages can be sent or forwarded to the channel chat.
// The field is available only for channel chats.
CanSendPaidMedia bool `json:"can_send_paid_media,omitempty"`
// Optional.
// For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds
SlowModeDelay int64 `json:"slow_mode_delay,omitempty"`
// Optional.
// For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions
UnrestrictBoostCount int64 `json:"unrestrict_boost_count,omitempty"`
// Optional.
// The time after which all messages sent to the chat will be automatically deleted; in seconds
MessageAutoDeleteTime int64 `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.
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
HasHiddenMembers bool `json:"has_hidden_members,omitempty"`
// Optional.
// True, if messages from the chat can't be forwarded to other chats
HasProtectedContent bool `json:"has_protected_content,omitempty"`
// Optional.
// True, if new chat members will have access to old messages; available only to chat administrators
HasVisibleHistory bool `json:"has_visible_history,omitempty"`
// Optional.
// For supergroups, name of the group sticker set
StickerSetName string `json:"sticker_set_name,omitempty"`
// Optional.
// True, if the bot can change the group sticker set
CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`
// Optional.
// For supergroups, the name of the group's custom emoji sticker set.
// Custom emoji from this set can be used by all users and bots in the group.
CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"`
// Optional.
// Unique identifier for the linked chat, i.e.
// the discussion group identifier for a channel and vice versa; for supergroups and channel chats.
// This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
LinkedChatID int64 `json:"linked_chat_id,omitempty"`
// Optional.
// For supergroups, the location to which the supergroup is connected
Location *ChatLocation `json:"location,omitempty"`
// Optional.
// For private chats, the rating of the user if any
Rating *UserRating `json:"rating,omitempty"`
// Optional.
// For private chats, the first audio added to the profile of the user
FirstProfileAudio *Audio `json:"first_profile_audio,omitempty"`
// Optional.
// The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews
UniqueGiftColors *UniqueGiftColors `json:"unique_gift_colors,omitempty"`
// Optional.
// The number of Telegram Stars a general user have to pay to send a message to the chat
PaidMessageStarCount int64 `json:"paid_message_star_count,omitempty"`
}
ChatFullInfo
This object contains full information about a chat.
func (*ChatFullInfo) Identifier ¶
func (c *ChatFullInfo) Identifier() string
Identifier returns the chat identifier. It returns the chat ID as a string if available, otherwise it returns the username with an '@' prefix.
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 int64 `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 int64 `json:"member_limit,omitempty"`
// Optional.
// Number of pending join requests created using this link
PendingJoinRequestCount int64 `json:"pending_join_request_count,omitempty"`
// Optional.
// The number of seconds the subscription will be active for before the next payment
SubscriptionPeriod int64 `json:"subscription_period,omitempty"`
// Optional.
// The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link
SubscriptionPrice int64 `json:"subscription_price,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.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
// The bot can use this identifier for 5 minutes 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 int64 `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 {
*ChatMemberOwner
*ChatMemberAdministrator
*ChatMemberMember
*ChatMemberRestricted
*ChatMemberLeft
*ChatMemberBanned
}
ChatMember
This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
func (*ChatMember) MarshalJSON ¶
func (r *ChatMember) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of ChatMember.
func (*ChatMember) UnmarshalJSON ¶
func (r *ChatMember) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching ChatMember subtype.
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, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars.
// 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, or access supergroup statistics
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"`
// True, if the administrator can post stories to the chat
CanPostStories bool `json:"can_post_stories"`
// True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
CanEditStories bool `json:"can_edit_stories"`
// True, if the administrator can delete stories posted by other users
CanDeleteStories bool `json:"can_delete_stories"`
// Optional.
// True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
CanPostMessages bool `json:"can_post_messages,omitempty"`
// Optional.
// True, if the administrator can edit messages of other users and can pin messages; for channels only
CanEditMessages bool `json:"can_edit_messages,omitempty"`
// Optional.
// True, if the user is allowed to pin messages; for 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; for supergroups only
CanManageTopics bool `json:"can_manage_topics,omitempty"`
// Optional.
// True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"`
// Optional.
// True, if the administrator can edit the tags of regular members; for groups and supergroups only.
// If omitted defaults to the value of can_pin_messages.
CanManageTags bool `json:"can_manage_tags,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 int64 `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"`
// Optional.
// Tag of the member
Tag string `json:"tag,omitempty"`
// Information about the user
User User `json:"user"`
// Optional.
// Date when the user's subscription will expire; Unix time
UntilDate int64 `json:"until_date,omitempty"`
}
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"`
// Optional.
// Tag of the member
Tag string `json:"tag,omitempty"`
// 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, giveaways, giveaway winners, 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 and checklists
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 edit their own tag
CanEditTag bool `json:"can_edit_tag"`
// 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 int64 `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 int64 `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 after sending a direct join request without using an invite link and being approved by an administrator
ViaJoinRequest bool `json:"via_join_request,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 ChatOwnerChanged ¶
type ChatOwnerChanged struct {
// The new owner of the chat
NewOwner User `json:"new_owner"`
}
ChatOwnerChanged
Describes a service message about an ownership change in the chat.
type ChatOwnerLeft ¶
type ChatOwnerLeft struct {
// Optional.
// The user which will be the new owner of the chat if the previous owner does not return to the chat
NewOwner *User `json:"new_owner,omitempty"`
}
ChatOwnerLeft
Describes a service message about the chat owner leaving the chat.
type ChatPermissions ¶
type ChatPermissions struct {
// Optional.
// True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, 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 and checklists
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 edit their own tag
CanEditTag bool `json:"can_edit_tag,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 string `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 string `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 ¶
type ChatShared struct {
RequestID int64 `json:"request_id"`
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
// The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.
ChatID int64 `json:"chat_id"`
// Title of the chat, if the title was requested by the bot.
Title string `json:"title,omitempty"`
// Username of the chat, if the username was requested by the bot and available.
Username string `json:"username,omitempty"`
// Available sizes of the chat photo, if the photo was requested by the bot
Photo []PhotoSize `json:"photo,omitempty"`
}
ChatShared
This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
type Checklist ¶
type Checklist struct {
// Title of the checklist
Title string `json:"title"`
// Optional.
// Special entities that appear in the checklist title
TitleEntities []MessageEntity `json:"title_entities,omitempty"`
// List of tasks in the checklist
Tasks []ChecklistTask `json:"tasks"`
// Optional.
// True, if users other than the creator of the list can add tasks to the list
OthersCanAddTasks bool `json:"others_can_add_tasks,omitempty"`
// Optional.
// True, if users other than the creator of the list can mark tasks as done or not done
OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"`
}
Checklist
Describes a checklist.
type ChecklistTask ¶
type ChecklistTask struct {
// Unique identifier of the task
ID int64 `json:"id"`
// Text of the task
Text string `json:"text"`
// Optional.
// Special entities that appear in the task text
TextEntities []MessageEntity `json:"text_entities,omitempty"`
// Optional.
// User that completed the task; omitted if the task wasn't completed by a user
CompletedByUser *User `json:"completed_by_user,omitempty"`
// Optional.
// Chat that completed the task; omitted if the task wasn't completed by a chat
CompletedByChat *Chat `json:"completed_by_chat,omitempty"`
// Optional.
// Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed
CompletionDate int64 `json:"completion_date,omitempty"`
}
ChecklistTask
Describes a task in a checklist.
type ChecklistTasksAdded ¶
type ChecklistTasksAdded struct {
// Optional.
// Message containing the checklist to which the tasks were added.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
ChecklistMessage *Message `json:"checklist_message,omitempty"`
// List of tasks added to the checklist
Tasks []ChecklistTask `json:"tasks"`
}
ChecklistTasksAdded
Describes a service message about tasks added to a checklist.
type ChecklistTasksDone ¶
type ChecklistTasksDone struct {
// Optional.
// Message containing the checklist whose tasks were marked as done or not done.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
ChecklistMessage *Message `json:"checklist_message,omitempty"`
// Optional.
// Identifiers of the tasks that were marked as done
MarkedAsDoneTaskIDs []int64 `json:"marked_as_done_task_ids,omitempty"`
// Optional.
// Identifiers of the tasks that were marked as not done
MarkedAsNotDoneTaskIDs []int64 `json:"marked_as_not_done_task_ids,omitempty"`
}
ChecklistTasksDone
Describes a service message about checklist tasks marked as done or not done.
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.
//
// [inline keyboard]: https://core.telegram.org/bots/api#inlinekeyboardmarkup
// [callback queries]: https://core.telegram.org/bots/api#callbackquery
// [edit]: https://core.telegram.org/bots/api#updating-messages
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. Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Telegram Bot API client.
References:
func NewClient ¶
func NewClient(token string, opts ...ClientOption) (*Client, error)
NewClient creates a new Client with the provided token and options.
func (*Client) AddStickerToSet ¶
func (c *Client) AddStickerToSet(ctx context.Context, params *AddStickerToSetParams) (ret bool, err error)
AddStickerToSet calls the addStickerToSet Telegram Bot API method.
Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.
func (*Client) AnswerCallbackQuery ¶
func (c *Client) AnswerCallbackQuery(ctx context.Context, params *AnswerCallbackQueryParams) (ret bool, err error)
AnswerCallbackQuery calls the answerCallbackQuery Telegram Bot API 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.
func (*Client) AnswerInlineQuery ¶
func (c *Client) AnswerInlineQuery(ctx context.Context, params *AnswerInlineQueryParams) (ret bool, err error)
AnswerInlineQuery calls the answerInlineQuery Telegram Bot API 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 (*Client) AnswerPreCheckoutQuery ¶
func (c *Client) AnswerPreCheckoutQuery(ctx context.Context, params *AnswerPreCheckoutQueryParams) (ret bool, err error)
AnswerPreCheckoutQuery calls the answerPreCheckoutQuery Telegram Bot API 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 (*Client) AnswerShippingQuery ¶
func (c *Client) AnswerShippingQuery(ctx context.Context, params *AnswerShippingQueryParams) (ret bool, err error)
AnswerShippingQuery calls the answerShippingQuery Telegram Bot API 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 (*Client) AnswerWebAppQuery ¶
func (c *Client) AnswerWebAppQuery(ctx context.Context, params *AnswerWebAppQueryParams) (ret *SentWebAppMessage, err error)
AnswerWebAppQuery calls the answerWebAppQuery Telegram Bot API 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 (*Client) ApproveChatJoinRequest ¶
func (c *Client) ApproveChatJoinRequest(ctx context.Context, params *ApproveChatJoinRequestParams) (ret bool, err error)
ApproveChatJoinRequest calls the approveChatJoinRequest Telegram Bot API 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. Returns True on success.
func (*Client) ApproveSuggestedPost ¶
func (c *Client) ApproveSuggestedPost(ctx context.Context, params *ApproveSuggestedPostParams) (ret bool, err error)
ApproveSuggestedPost calls the approveSuggestedPost Telegram Bot API method.
Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success.
func (*Client) BanChatMember ¶
func (c *Client) BanChatMember(ctx context.Context, params *BanChatMemberParams) (ret bool, err error)
BanChatMember calls the banChatMember Telegram Bot API 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. Returns True on success.
func (*Client) BanChatSenderChat ¶
func (c *Client) BanChatSenderChat(ctx context.Context, params *BanChatSenderChatParams) (ret bool, err error)
BanChatSenderChat calls the banChatSenderChat Telegram Bot API 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. Returns True on success.
func (*Client) Close ¶
Close calls the close Telegram Bot API 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. Returns True on success. Requires no parameters.
func (*Client) CloseForumTopic ¶
func (c *Client) CloseForumTopic(ctx context.Context, params *CloseForumTopicParams) (ret bool, err error)
CloseForumTopic calls the closeForumTopic Telegram Bot API 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. Returns True on success.
func (*Client) CloseGeneralForumTopic ¶
func (c *Client) CloseGeneralForumTopic(ctx context.Context, params *CloseGeneralForumTopicParams) (ret bool, err error)
CloseGeneralForumTopic calls the closeGeneralForumTopic Telegram Bot API 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. Returns True on success.
func (*Client) ConvertGiftToStars ¶
func (c *Client) ConvertGiftToStars(ctx context.Context, params *ConvertGiftToStarsParams) (ret bool, err error)
ConvertGiftToStars calls the convertGiftToStars Telegram Bot API method.
Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
func (*Client) CopyMessage ¶
func (c *Client) CopyMessage(ctx context.Context, params *CopyMessageParams) (ret *MessageId, err error)
CopyMessage calls the copyMessage Telegram Bot API method.
Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners 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 (*Client) CopyMessages ¶
func (c *Client) CopyMessages(ctx context.Context, params *CopyMessagesParams) (ret []MessageId, err error)
CopyMessages calls the copyMessages Telegram Bot API method.
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners 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 forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
func (*Client) CreateChatInviteLink ¶
func (c *Client) CreateChatInviteLink(ctx context.Context, params *CreateChatInviteLinkParams) (ret *ChatInviteLink, err error)
CreateChatInviteLink calls the createChatInviteLink Telegram Bot API 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 (*Client) CreateChatSubscriptionInviteLink ¶
func (c *Client) CreateChatSubscriptionInviteLink(ctx context.Context, params *CreateChatSubscriptionInviteLinkParams) (ret *ChatInviteLink, err error)
CreateChatSubscriptionInviteLink calls the createChatSubscriptionInviteLink Telegram Bot API method.
Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.
func (*Client) CreateForumTopic ¶
func (c *Client) CreateForumTopic(ctx context.Context, params *CreateForumTopicParams) (ret *ForumTopic, err error)
CreateForumTopic calls the createForumTopic Telegram Bot API method.
Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.
func (*Client) CreateInvoiceLink ¶
func (c *Client) CreateInvoiceLink(ctx context.Context, params *CreateInvoiceLinkParams) (ret string, err error)
CreateInvoiceLink calls the createInvoiceLink Telegram Bot API method.
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
func (*Client) CreateNewStickerSet ¶
func (c *Client) CreateNewStickerSet(ctx context.Context, params *CreateNewStickerSetParams) (ret bool, err error)
CreateNewStickerSet calls the createNewStickerSet Telegram Bot API 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. Returns True on success.
func (*Client) DeclineChatJoinRequest ¶
func (c *Client) DeclineChatJoinRequest(ctx context.Context, params *DeclineChatJoinRequestParams) (ret bool, err error)
DeclineChatJoinRequest calls the declineChatJoinRequest Telegram Bot API 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. Returns True on success.
func (*Client) DeclineSuggestedPost ¶
func (c *Client) DeclineSuggestedPost(ctx context.Context, params *DeclineSuggestedPostParams) (ret bool, err error)
DeclineSuggestedPost calls the declineSuggestedPost Telegram Bot API method.
Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success.
func (*Client) DeleteBusinessMessages ¶
func (c *Client) DeleteBusinessMessages(ctx context.Context, params *DeleteBusinessMessagesParams) (ret bool, err error)
DeleteBusinessMessages calls the deleteBusinessMessages Telegram Bot API method.
Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
func (*Client) DeleteChatPhoto ¶
func (c *Client) DeleteChatPhoto(ctx context.Context, params *DeleteChatPhotoParams) (ret bool, err error)
DeleteChatPhoto calls the deleteChatPhoto Telegram Bot API 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. Returns True on success.
func (*Client) DeleteChatStickerSet ¶
func (c *Client) DeleteChatStickerSet(ctx context.Context, params *DeleteChatStickerSetParams) (ret bool, err error)
DeleteChatStickerSet calls the deleteChatStickerSet Telegram Bot API 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. Returns True on success.
func (*Client) DeleteForumTopic ¶
func (c *Client) DeleteForumTopic(ctx context.Context, params *DeleteForumTopicParams) (ret bool, err error)
DeleteForumTopic calls the deleteForumTopic Telegram Bot API method.
Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
func (*Client) DeleteMessage ¶
func (c *Client) DeleteMessage(ctx context.Context, params *DeleteMessageParams) (ret bool, err error)
DeleteMessage calls the deleteMessage Telegram Bot API method.
Use this method to delete a message, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago. - Service messages about a supergroup, channel, or forum topic creation can't be deleted. - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing messages in private chats, groups, and supergroups. - Bots can delete incoming messages in private chats. - Bots granted can_post_messages permissions can delete outgoing messages in channels. - If the bot is an administrator of a group, it can delete any message there. - If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there. - If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat. Returns True on success.
func (*Client) DeleteMessages ¶
func (c *Client) DeleteMessages(ctx context.Context, params *DeleteMessagesParams) (ret bool, err error)
DeleteMessages calls the deleteMessages Telegram Bot API method.
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.
func (*Client) DeleteMyCommands ¶
func (c *Client) DeleteMyCommands(ctx context.Context, params *DeleteMyCommandsParams) (ret bool, err error)
DeleteMyCommands calls the deleteMyCommands Telegram Bot API 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. Returns True on success.
func (*Client) DeleteStickerFromSet ¶
func (c *Client) DeleteStickerFromSet(ctx context.Context, params *DeleteStickerFromSetParams) (ret bool, err error)
DeleteStickerFromSet calls the deleteStickerFromSet Telegram Bot API method.
Use this method to delete a sticker from a set created by the bot. Returns True on success.
func (*Client) DeleteStickerSet ¶
func (c *Client) DeleteStickerSet(ctx context.Context, params *DeleteStickerSetParams) (ret bool, err error)
DeleteStickerSet calls the deleteStickerSet Telegram Bot API method.
Use this method to delete a sticker set that was created by the bot. Returns True on success.
func (*Client) DeleteStory ¶
DeleteStory calls the deleteStory Telegram Bot API method.
Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.
func (*Client) DeleteWebhook ¶
func (c *Client) DeleteWebhook(ctx context.Context, params *DeleteWebhookParams) (ret bool, err error)
DeleteWebhook calls the deleteWebhook Telegram Bot API method.
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
func (*Client) EditChatInviteLink ¶
func (c *Client) EditChatInviteLink(ctx context.Context, params *EditChatInviteLinkParams) (ret *ChatInviteLink, err error)
EditChatInviteLink calls the editChatInviteLink Telegram Bot API 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 (*Client) EditChatSubscriptionInviteLink ¶
func (c *Client) EditChatSubscriptionInviteLink(ctx context.Context, params *EditChatSubscriptionInviteLinkParams) (ret *ChatInviteLink, err error)
EditChatSubscriptionInviteLink calls the editChatSubscriptionInviteLink Telegram Bot API method.
Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.
func (*Client) EditForumTopic ¶
func (c *Client) EditForumTopic(ctx context.Context, params *EditForumTopicParams) (ret bool, err error)
EditForumTopic calls the editForumTopic Telegram Bot API method.
Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a 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. Returns True on success.
func (*Client) EditGeneralForumTopic ¶
func (c *Client) EditGeneralForumTopic(ctx context.Context, params *EditGeneralForumTopicParams) (ret bool, err error)
EditGeneralForumTopic calls the editGeneralForumTopic Telegram Bot API 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 the can_manage_topics administrator rights. Returns True on success.
func (*Client) EditMessageCaption ¶
func (c *Client) EditMessageCaption(ctx context.Context, params *EditMessageCaptionParams) (ret *Message, err error)
EditMessageCaption calls the editMessageCaption Telegram Bot API 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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Client) EditMessageChecklist ¶
func (c *Client) EditMessageChecklist(ctx context.Context, params *EditMessageChecklistParams) (ret *Message, err error)
EditMessageChecklist calls the editMessageChecklist Telegram Bot API method.
Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
func (*Client) EditMessageLiveLocation ¶
func (c *Client) EditMessageLiveLocation(ctx context.Context, params *EditMessageLiveLocationParams) (ret *Message, err error)
EditMessageLiveLocation calls the editMessageLiveLocation Telegram Bot API 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 (*Client) EditMessageMedia ¶
func (c *Client) EditMessageMedia(ctx context.Context, params *EditMessageMediaParams) (ret *Message, err error)
EditMessageMedia calls the editMessageMedia Telegram Bot API method.
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text 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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Client) EditMessageReplyMarkup ¶
func (c *Client) EditMessageReplyMarkup(ctx context.Context, params *EditMessageReplyMarkupParams) (ret *Message, err error)
EditMessageReplyMarkup calls the editMessageReplyMarkup Telegram Bot API 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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Client) EditMessageText ¶
func (c *Client) EditMessageText(ctx context.Context, params *EditMessageTextParams) (ret *Message, err error)
EditMessageText calls the editMessageText Telegram Bot API 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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Client) EditStory ¶
EditStory calls the editStory Telegram Bot API method.
Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
func (*Client) EditUserStarSubscription ¶
func (c *Client) EditUserStarSubscription(ctx context.Context, params *EditUserStarSubscriptionParams) (ret bool, err error)
EditUserStarSubscription calls the editUserStarSubscription Telegram Bot API method.
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
func (*Client) ExportChatInviteLink ¶
func (c *Client) ExportChatInviteLink(ctx context.Context, params *ExportChatInviteLinkParams) (ret string, err error)
ExportChatInviteLink calls the exportChatInviteLink Telegram Bot API 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 (*Client) ForwardMessage ¶
func (c *Client) ForwardMessage(ctx context.Context, params *ForwardMessageParams) (ret *Message, err error)
ForwardMessage calls the forwardMessage Telegram Bot API method.
Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
func (*Client) ForwardMessages ¶
func (c *Client) ForwardMessages(ctx context.Context, params *ForwardMessagesParams) (ret []MessageId, err error)
ForwardMessages calls the forwardMessages Telegram Bot API method.
Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
func (*Client) GetAvailableGifts ¶
func (c *Client) GetAvailableGifts(ctx context.Context, params *GetAvailableGiftsParams) (ret *Gifts, err error)
GetAvailableGifts calls the getAvailableGifts Telegram Bot API method.
Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.
func (*Client) GetBusinessAccountGifts ¶
func (c *Client) GetBusinessAccountGifts(ctx context.Context, params *GetBusinessAccountGiftsParams) (ret *OwnedGifts, err error)
GetBusinessAccountGifts calls the getBusinessAccountGifts Telegram Bot API method.
Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.
func (*Client) GetBusinessAccountStarBalance ¶
func (c *Client) GetBusinessAccountStarBalance(ctx context.Context, params *GetBusinessAccountStarBalanceParams) (ret *StarAmount, err error)
GetBusinessAccountStarBalance calls the getBusinessAccountStarBalance Telegram Bot API method.
Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.
func (*Client) GetBusinessConnection ¶
func (c *Client) GetBusinessConnection(ctx context.Context, params *GetBusinessConnectionParams) (ret *BusinessConnection, err error)
GetBusinessConnection calls the getBusinessConnection Telegram Bot API method.
Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
func (*Client) GetChat ¶
func (c *Client) GetChat(ctx context.Context, params *GetChatParams) (ret *ChatFullInfo, err error)
GetChat calls the getChat Telegram Bot API method.
Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.
func (*Client) GetChatAdministrators ¶
func (c *Client) GetChatAdministrators(ctx context.Context, params *GetChatAdministratorsParams) (ret []ChatMember, err error)
GetChatAdministrators calls the getChatAdministrators Telegram Bot API method.
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
func (*Client) GetChatGifts ¶
func (c *Client) GetChatGifts(ctx context.Context, params *GetChatGiftsParams) (ret *OwnedGifts, err error)
GetChatGifts calls the getChatGifts Telegram Bot API method.
Returns the gifts owned by a chat. Returns OwnedGifts on success.
func (*Client) GetChatMember ¶
func (c *Client) GetChatMember(ctx context.Context, params *GetChatMemberParams) (ret *ChatMember, err error)
GetChatMember calls the getChatMember Telegram Bot API 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 (*Client) GetChatMemberCount ¶
func (c *Client) GetChatMemberCount(ctx context.Context, params *GetChatMemberCountParams) (ret int64, err error)
GetChatMemberCount calls the getChatMemberCount Telegram Bot API method.
Use this method to get the number of members in a chat. Returns Int on success.
func (*Client) GetChatMenuButton ¶
func (c *Client) GetChatMenuButton(ctx context.Context, params *GetChatMenuButtonParams) (ret *MenuButton, err error)
GetChatMenuButton calls the getChatMenuButton Telegram Bot API 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 (*Client) GetCustomEmojiStickers ¶
func (c *Client) GetCustomEmojiStickers(ctx context.Context, params *GetCustomEmojiStickersParams) (ret []Sticker, err error)
GetCustomEmojiStickers calls the getCustomEmojiStickers Telegram Bot API method.
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
func (*Client) GetFile ¶
GetFile calls the getFile Telegram Bot API 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. Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.
func (*Client) GetForumTopicIconStickers ¶
func (c *Client) GetForumTopicIconStickers(ctx context.Context, params *GetForumTopicIconStickersParams) (ret []Sticker, err error)
GetForumTopicIconStickers calls the getForumTopicIconStickers Telegram Bot API 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 (*Client) GetGameHighScores ¶
func (c *Client) GetGameHighScores(ctx context.Context, params *GetGameHighScoresParams) (ret []GameHighScore, err error)
GetGameHighScores calls the getGameHighScores Telegram Bot API 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.
func (*Client) GetMe ¶
GetMe calls the getMe Telegram Bot API 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 (*Client) GetMyCommands ¶
func (c *Client) GetMyCommands(ctx context.Context, params *GetMyCommandsParams) (ret []BotCommand, err error)
GetMyCommands calls the getMyCommands Telegram Bot API 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 (*Client) GetMyDefaultAdministratorRights ¶
func (c *Client) GetMyDefaultAdministratorRights(ctx context.Context, params *GetMyDefaultAdministratorRightsParams) (ret *ChatAdministratorRights, err error)
GetMyDefaultAdministratorRights calls the getMyDefaultAdministratorRights Telegram Bot API method.
Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
func (*Client) GetMyDescription ¶
func (c *Client) GetMyDescription(ctx context.Context, params *GetMyDescriptionParams) (ret *BotDescription, err error)
GetMyDescription calls the getMyDescription Telegram Bot API method.
Use this method to get the current bot description for the given user language. Returns BotDescription on success.
func (*Client) GetMyName ¶
GetMyName calls the getMyName Telegram Bot API method.
Use this method to get the current bot name for the given user language. Returns BotName on success.
func (*Client) GetMyShortDescription ¶
func (c *Client) GetMyShortDescription(ctx context.Context, params *GetMyShortDescriptionParams) (ret *BotShortDescription, err error)
GetMyShortDescription calls the getMyShortDescription Telegram Bot API method.
Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
func (*Client) GetMyStarBalance ¶
func (c *Client) GetMyStarBalance(ctx context.Context, params *GetMyStarBalanceParams) (ret *StarAmount, err error)
GetMyStarBalance calls the getMyStarBalance Telegram Bot API method.
A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.
func (*Client) GetStarTransactions ¶
func (c *Client) GetStarTransactions(ctx context.Context, params *GetStarTransactionsParams) (ret *StarTransactions, err error)
GetStarTransactions calls the getStarTransactions Telegram Bot API method.
Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
func (*Client) GetStickerSet ¶
func (c *Client) GetStickerSet(ctx context.Context, params *GetStickerSetParams) (ret *StickerSet, err error)
GetStickerSet calls the getStickerSet Telegram Bot API method.
Use this method to get a sticker set. On success, a StickerSet object is returned.
func (*Client) GetUpdates ¶
func (c *Client) GetUpdates(ctx context.Context, params *GetUpdatesParams) (ret []Update, err error)
GetUpdates calls the getUpdates Telegram Bot API method.
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
func (*Client) GetUserChatBoosts ¶
func (c *Client) GetUserChatBoosts(ctx context.Context, params *GetUserChatBoostsParams) (ret *UserChatBoosts, err error)
GetUserChatBoosts calls the getUserChatBoosts Telegram Bot API method.
Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
func (*Client) GetUserGifts ¶
func (c *Client) GetUserGifts(ctx context.Context, params *GetUserGiftsParams) (ret *OwnedGifts, err error)
GetUserGifts calls the getUserGifts Telegram Bot API method.
Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
func (*Client) GetUserProfileAudios ¶
func (c *Client) GetUserProfileAudios(ctx context.Context, params *GetUserProfileAudiosParams) (ret *UserProfileAudios, err error)
GetUserProfileAudios calls the getUserProfileAudios Telegram Bot API method.
Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.
func (*Client) GetUserProfilePhotos ¶
func (c *Client) GetUserProfilePhotos(ctx context.Context, params *GetUserProfilePhotosParams) (ret *UserProfilePhotos, err error)
GetUserProfilePhotos calls the getUserProfilePhotos Telegram Bot API method.
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
func (*Client) GetWebhookInfo ¶
func (c *Client) GetWebhookInfo(ctx context.Context, params *GetWebhookInfoParams) (ret *WebhookInfo, err error)
GetWebhookInfo calls the getWebhookInfo Telegram Bot API 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 (*Client) GiftPremiumSubscription ¶
func (c *Client) GiftPremiumSubscription(ctx context.Context, params *GiftPremiumSubscriptionParams) (ret bool, err error)
GiftPremiumSubscription calls the giftPremiumSubscription Telegram Bot API method.
Gifts a Telegram Premium subscription to the given user. Returns True on success.
func (*Client) HideGeneralForumTopic ¶
func (c *Client) HideGeneralForumTopic(ctx context.Context, params *HideGeneralForumTopicParams) (ret bool, err error)
HideGeneralForumTopic calls the hideGeneralForumTopic Telegram Bot API 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. Returns True on success.
func (*Client) LeaveChat ¶
LeaveChat calls the leaveChat Telegram Bot API method.
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
func (*Client) LogOut ¶
LogOut calls the logOut Telegram Bot API 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. Returns True on success. Requires no parameters.
func (*Client) Option ¶
func (c *Client) Option(opts ...ClientOption) (previous ClientOption)
Option applies one or more ClientOption values and returns the last rollback option produced by the applied options.
func (*Client) PinChatMessage ¶
func (c *Client) PinChatMessage(ctx context.Context, params *PinChatMessageParams) (ret bool, err error)
PinChatMessage calls the pinChatMessage Telegram Bot API method.
Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success.
func (*Client) PostStory ¶
PostStory calls the postStory Telegram Bot API method.
Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
func (*Client) PromoteChatMember ¶
func (c *Client) PromoteChatMember(ctx context.Context, params *PromoteChatMemberParams) (ret bool, err error)
PromoteChatMember calls the promoteChatMember Telegram Bot API 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. Returns True on success.
func (*Client) Raw ¶
func (c *Client) Raw( ctx context.Context, method string, reader io.Reader, contentType ...string, ) (json.RawMessage, error)
Raw sends a raw request to the Telegram Bot API.
func (*Client) ReadBusinessMessage ¶
func (c *Client) ReadBusinessMessage(ctx context.Context, params *ReadBusinessMessageParams) (ret bool, err error)
ReadBusinessMessage calls the readBusinessMessage Telegram Bot API method.
Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
func (*Client) RefundStarPayment ¶
func (c *Client) RefundStarPayment(ctx context.Context, params *RefundStarPaymentParams) (ret bool, err error)
RefundStarPayment calls the refundStarPayment Telegram Bot API method.
Refunds a successful payment in Telegram Stars. Returns True on success.
func (*Client) RemoteAddr ¶
RemoteAddr returns the remote network address used by the client.
func (*Client) RemoveBusinessAccountProfilePhoto ¶
func (c *Client) RemoveBusinessAccountProfilePhoto(ctx context.Context, params *RemoveBusinessAccountProfilePhotoParams) (ret bool, err error)
RemoveBusinessAccountProfilePhoto calls the removeBusinessAccountProfilePhoto Telegram Bot API method.
Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
func (*Client) RemoveChatVerification ¶
func (c *Client) RemoveChatVerification(ctx context.Context, params *RemoveChatVerificationParams) (ret bool, err error)
RemoveChatVerification calls the removeChatVerification Telegram Bot API method.
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
func (*Client) RemoveMyProfilePhoto ¶
func (c *Client) RemoveMyProfilePhoto(ctx context.Context, params *RemoveMyProfilePhotoParams) (ret bool, err error)
RemoveMyProfilePhoto calls the removeMyProfilePhoto Telegram Bot API method.
Removes the profile photo of the bot. Requires no parameters. Returns True on success.
func (*Client) RemoveUserVerification ¶
func (c *Client) RemoveUserVerification(ctx context.Context, params *RemoveUserVerificationParams) (ret bool, err error)
RemoveUserVerification calls the removeUserVerification Telegram Bot API method.
Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
func (*Client) ReopenForumTopic ¶
func (c *Client) ReopenForumTopic(ctx context.Context, params *ReopenForumTopicParams) (ret bool, err error)
ReopenForumTopic calls the reopenForumTopic Telegram Bot API 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. Returns True on success.
func (*Client) ReopenGeneralForumTopic ¶
func (c *Client) ReopenGeneralForumTopic(ctx context.Context, params *ReopenGeneralForumTopicParams) (ret bool, err error)
ReopenGeneralForumTopic calls the reopenGeneralForumTopic Telegram Bot API 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. Returns True on success.
func (*Client) ReplaceStickerInSet ¶
func (c *Client) ReplaceStickerInSet(ctx context.Context, params *ReplaceStickerInSetParams) (ret bool, err error)
ReplaceStickerInSet calls the replaceStickerInSet Telegram Bot API method.
Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.
func (*Client) RepostStory ¶
func (c *Client) RepostStory(ctx context.Context, params *RepostStoryParams) (ret *Story, err error)
RepostStory calls the repostStory Telegram Bot API method.
Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.
func (*Client) RestrictChatMember ¶
func (c *Client) RestrictChatMember(ctx context.Context, params *RestrictChatMemberParams) (ret bool, err error)
RestrictChatMember calls the restrictChatMember Telegram Bot API 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. Returns True on success.
func (*Client) RevokeChatInviteLink ¶
func (c *Client) RevokeChatInviteLink(ctx context.Context, params *RevokeChatInviteLinkParams) (ret *ChatInviteLink, err error)
RevokeChatInviteLink calls the revokeChatInviteLink Telegram Bot API 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 (*Client) SavePreparedInlineMessage ¶
func (c *Client) SavePreparedInlineMessage(ctx context.Context, params *SavePreparedInlineMessageParams) (ret *PreparedInlineMessage, err error)
SavePreparedInlineMessage calls the savePreparedInlineMessage Telegram Bot API method.
Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
func (*Client) SendAnimation ¶
func (c *Client) SendAnimation(ctx context.Context, params *SendAnimationParams) (ret *Message, err error)
SendAnimation calls the sendAnimation Telegram Bot API 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 (*Client) SendAudio ¶
SendAudio calls the sendAudio Telegram Bot API 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 (*Client) SendChatAction ¶
func (c *Client) SendChatAction(ctx context.Context, params *SendChatActionParams) (ret bool, err error)
SendChatAction calls the sendChatAction Telegram Bot API 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). Returns True on success. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
func (*Client) SendChecklist ¶
func (c *Client) SendChecklist(ctx context.Context, params *SendChecklistParams) (ret *Message, err error)
SendChecklist calls the sendChecklist Telegram Bot API method.
Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
func (*Client) SendContact ¶
func (c *Client) SendContact(ctx context.Context, params *SendContactParams) (ret *Message, err error)
SendContact calls the sendContact Telegram Bot API method.
Use this method to send phone contacts. On success, the sent Message is returned.
func (*Client) SendDice ¶
SendDice calls the sendDice Telegram Bot API method.
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
func (*Client) SendDocument ¶
func (c *Client) SendDocument(ctx context.Context, params *SendDocumentParams) (ret *Message, err error)
SendDocument calls the sendDocument Telegram Bot API 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 (*Client) SendGame ¶
SendGame calls the sendGame Telegram Bot API method.
Use this method to send a game. On success, the sent Message is returned.
func (*Client) SendGift ¶
SendGift calls the sendGift Telegram Bot API method.
Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
func (*Client) SendInvoice ¶
func (c *Client) SendInvoice(ctx context.Context, params *SendInvoiceParams) (ret *Message, err error)
SendInvoice calls the sendInvoice Telegram Bot API method.
Use this method to send invoices. On success, the sent Message is returned.
func (*Client) SendLocation ¶
func (c *Client) SendLocation(ctx context.Context, params *SendLocationParams) (ret *Message, err error)
SendLocation calls the sendLocation Telegram Bot API method.
Use this method to send point on the map. On success, the sent Message is returned.
func (*Client) SendMediaGroup ¶
func (c *Client) SendMediaGroup(ctx context.Context, params *SendMediaGroupParams) (ret []Message, err error)
SendMediaGroup calls the sendMediaGroup Telegram Bot API 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 Message objects that were sent is returned.
func (*Client) SendMessage ¶
func (c *Client) SendMessage(ctx context.Context, params *SendMessageParams) (ret *Message, err error)
SendMessage calls the sendMessage Telegram Bot API method.
Use this method to send text messages. On success, the sent Message is returned.
func (*Client) SendMessageDraft ¶
func (c *Client) SendMessageDraft(ctx context.Context, params *SendMessageDraftParams) (ret bool, err error)
SendMessageDraft calls the sendMessageDraft Telegram Bot API method.
Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
func (*Client) SendPaidMedia ¶
func (c *Client) SendPaidMedia(ctx context.Context, params *SendPaidMediaParams) (ret *Message, err error)
SendPaidMedia calls the sendPaidMedia Telegram Bot API method.
Use this method to send paid media. On success, the sent Message is returned.
func (*Client) SendPhoto ¶
SendPhoto calls the sendPhoto Telegram Bot API method.
Use this method to send photos. On success, the sent Message is returned.
func (*Client) SendPoll ¶
SendPoll calls the sendPoll Telegram Bot API method.
Use this method to send a native poll. On success, the sent Message is returned.
func (*Client) SendSticker ¶
func (c *Client) SendSticker(ctx context.Context, params *SendStickerParams) (ret *Message, err error)
SendSticker calls the sendSticker Telegram Bot API method.
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
func (*Client) SendVenue ¶
SendVenue calls the sendVenue Telegram Bot API method.
Use this method to send information about a venue. On success, the sent Message is returned.
func (*Client) SendVideo ¶
SendVideo calls the sendVideo Telegram Bot API 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 (*Client) SendVideoNote ¶
func (c *Client) SendVideoNote(ctx context.Context, params *SendVideoNoteParams) (ret *Message, err error)
SendVideoNote calls the sendVideoNote Telegram Bot API 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 (*Client) SendVoice ¶
SendVoice calls the sendVoice Telegram Bot API 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, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
func (*Client) SetBusinessAccountBio ¶
func (c *Client) SetBusinessAccountBio(ctx context.Context, params *SetBusinessAccountBioParams) (ret bool, err error)
SetBusinessAccountBio calls the setBusinessAccountBio Telegram Bot API method.
Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.
func (*Client) SetBusinessAccountGiftSettings ¶
func (c *Client) SetBusinessAccountGiftSettings(ctx context.Context, params *SetBusinessAccountGiftSettingsParams) (ret bool, err error)
SetBusinessAccountGiftSettings calls the setBusinessAccountGiftSettings Telegram Bot API method.
Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.
func (*Client) SetBusinessAccountName ¶
func (c *Client) SetBusinessAccountName(ctx context.Context, params *SetBusinessAccountNameParams) (ret bool, err error)
SetBusinessAccountName calls the setBusinessAccountName Telegram Bot API method.
Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.
func (*Client) SetBusinessAccountProfilePhoto ¶
func (c *Client) SetBusinessAccountProfilePhoto(ctx context.Context, params *SetBusinessAccountProfilePhotoParams) (ret bool, err error)
SetBusinessAccountProfilePhoto calls the setBusinessAccountProfilePhoto Telegram Bot API method.
Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
func (*Client) SetBusinessAccountUsername ¶
func (c *Client) SetBusinessAccountUsername(ctx context.Context, params *SetBusinessAccountUsernameParams) (ret bool, err error)
SetBusinessAccountUsername calls the setBusinessAccountUsername Telegram Bot API method.
Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
func (*Client) SetChatAdministratorCustomTitle ¶
func (c *Client) SetChatAdministratorCustomTitle(ctx context.Context, params *SetChatAdministratorCustomTitleParams) (ret bool, err error)
SetChatAdministratorCustomTitle calls the setChatAdministratorCustomTitle Telegram Bot API method.
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
func (*Client) SetChatDescription ¶
func (c *Client) SetChatDescription(ctx context.Context, params *SetChatDescriptionParams) (ret bool, err error)
SetChatDescription calls the setChatDescription Telegram Bot API 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. Returns True on success.
func (*Client) SetChatMemberTag ¶
func (c *Client) SetChatMemberTag(ctx context.Context, params *SetChatMemberTagParams) (ret bool, err error)
SetChatMemberTag calls the setChatMemberTag Telegram Bot API method.
Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success.
func (*Client) SetChatMenuButton ¶
func (c *Client) SetChatMenuButton(ctx context.Context, params *SetChatMenuButtonParams) (ret bool, err error)
SetChatMenuButton calls the setChatMenuButton Telegram Bot API method.
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
func (*Client) SetChatPermissions ¶
func (c *Client) SetChatPermissions(ctx context.Context, params *SetChatPermissionsParams) (ret bool, err error)
SetChatPermissions calls the setChatPermissions Telegram Bot API 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. Returns True on success.
func (*Client) SetChatPhoto ¶
func (c *Client) SetChatPhoto(ctx context.Context, params *SetChatPhotoParams) (ret bool, err error)
SetChatPhoto calls the setChatPhoto Telegram Bot API 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. Returns True on success.
func (*Client) SetChatStickerSet ¶
func (c *Client) SetChatStickerSet(ctx context.Context, params *SetChatStickerSetParams) (ret bool, err error)
SetChatStickerSet calls the setChatStickerSet Telegram Bot API 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. Returns True on success.
func (*Client) SetChatTitle ¶
func (c *Client) SetChatTitle(ctx context.Context, params *SetChatTitleParams) (ret bool, err error)
SetChatTitle calls the setChatTitle Telegram Bot API 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. Returns True on success.
func (*Client) SetCustomEmojiStickerSetThumbnail ¶
func (c *Client) SetCustomEmojiStickerSetThumbnail(ctx context.Context, params *SetCustomEmojiStickerSetThumbnailParams) (ret bool, err error)
SetCustomEmojiStickerSetThumbnail calls the setCustomEmojiStickerSetThumbnail Telegram Bot API method.
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
func (*Client) SetGameScore ¶
func (c *Client) SetGameScore(ctx context.Context, params *SetGameScoreParams) (ret *Message, err error)
SetGameScore calls the setGameScore Telegram Bot API 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 (*Client) SetMessageReaction ¶
func (c *Client) SetMessageReaction(ctx context.Context, params *SetMessageReactionParams) (ret bool, err error)
SetMessageReaction calls the setMessageReaction Telegram Bot API method.
Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.
func (*Client) SetMyCommands ¶
func (c *Client) SetMyCommands(ctx context.Context, params *SetMyCommandsParams) (ret bool, err error)
SetMyCommands calls the setMyCommands Telegram Bot API method.
Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.
func (*Client) SetMyDefaultAdministratorRights ¶
func (c *Client) SetMyDefaultAdministratorRights(ctx context.Context, params *SetMyDefaultAdministratorRightsParams) (ret bool, err error)
SetMyDefaultAdministratorRights calls the setMyDefaultAdministratorRights Telegram Bot API 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. Returns True on success.
func (*Client) SetMyDescription ¶
func (c *Client) SetMyDescription(ctx context.Context, params *SetMyDescriptionParams) (ret bool, err error)
SetMyDescription calls the setMyDescription Telegram Bot API method.
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
func (*Client) SetMyName ¶
SetMyName calls the setMyName Telegram Bot API method.
Use this method to change the bot's name. Returns True on success.
func (*Client) SetMyProfilePhoto ¶
func (c *Client) SetMyProfilePhoto(ctx context.Context, params *SetMyProfilePhotoParams) (ret bool, err error)
SetMyProfilePhoto calls the setMyProfilePhoto Telegram Bot API method.
Changes the profile photo of the bot. Returns True on success.
func (*Client) SetMyShortDescription ¶
func (c *Client) SetMyShortDescription(ctx context.Context, params *SetMyShortDescriptionParams) (ret bool, err error)
SetMyShortDescription calls the setMyShortDescription Telegram Bot API 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. Returns True on success.
func (*Client) SetPassportDataErrors ¶
func (c *Client) SetPassportDataErrors(ctx context.Context, params *SetPassportDataErrorsParams) (ret bool, err error)
SetPassportDataErrors calls the setPassportDataErrors Telegram Bot API 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). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
func (*Client) SetStickerEmojiList ¶
func (c *Client) SetStickerEmojiList(ctx context.Context, params *SetStickerEmojiListParams) (ret bool, err error)
SetStickerEmojiList calls the setStickerEmojiList Telegram Bot API 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. Returns True on success.
func (*Client) SetStickerKeywords ¶
func (c *Client) SetStickerKeywords(ctx context.Context, params *SetStickerKeywordsParams) (ret bool, err error)
SetStickerKeywords calls the setStickerKeywords Telegram Bot API 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. Returns True on success.
func (*Client) SetStickerMaskPosition ¶
func (c *Client) SetStickerMaskPosition(ctx context.Context, params *SetStickerMaskPositionParams) (ret bool, err error)
SetStickerMaskPosition calls the setStickerMaskPosition Telegram Bot API 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. Returns True on success.
func (*Client) SetStickerPositionInSet ¶
func (c *Client) SetStickerPositionInSet(ctx context.Context, params *SetStickerPositionInSetParams) (ret bool, err error)
SetStickerPositionInSet calls the setStickerPositionInSet Telegram Bot API method.
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
func (*Client) SetStickerSetThumbnail ¶
func (c *Client) SetStickerSetThumbnail(ctx context.Context, params *SetStickerSetThumbnailParams) (ret bool, err error)
SetStickerSetThumbnail calls the setStickerSetThumbnail Telegram Bot API 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. Returns True on success.
func (*Client) SetStickerSetTitle ¶
func (c *Client) SetStickerSetTitle(ctx context.Context, params *SetStickerSetTitleParams) (ret bool, err error)
SetStickerSetTitle calls the setStickerSetTitle Telegram Bot API method.
Use this method to set the title of a created sticker set. Returns True on success.
func (*Client) SetUserEmojiStatus ¶
func (c *Client) SetUserEmojiStatus(ctx context.Context, params *SetUserEmojiStatusParams) (ret bool, err error)
SetUserEmojiStatus calls the setUserEmojiStatus Telegram Bot API method.
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
func (*Client) SetWebhook ¶
SetWebhook calls the setWebhook Telegram Bot API 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 (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success. 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 (*Client) Start ¶
func (c *Client) Start(ctx context.Context, params *GetUpdatesParams) error
Start starts the client and listens for updates.
func (*Client) StopMessageLiveLocation ¶
func (c *Client) StopMessageLiveLocation(ctx context.Context, params *StopMessageLiveLocationParams) (ret *Message, err error)
StopMessageLiveLocation calls the stopMessageLiveLocation Telegram Bot API 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 (*Client) StopPoll ¶
StopPoll calls the stopPoll Telegram Bot API method.
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
func (*Client) TransferBusinessAccountStars ¶
func (c *Client) TransferBusinessAccountStars(ctx context.Context, params *TransferBusinessAccountStarsParams) (ret bool, err error)
TransferBusinessAccountStars calls the transferBusinessAccountStars Telegram Bot API method.
Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.
func (*Client) TransferGift ¶
func (c *Client) TransferGift(ctx context.Context, params *TransferGiftParams) (ret bool, err error)
TransferGift calls the transferGift Telegram Bot API method.
Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.
func (*Client) UnbanChatMember ¶
func (c *Client) UnbanChatMember(ctx context.Context, params *UnbanChatMemberParams) (ret bool, err error)
UnbanChatMember calls the unbanChatMember Telegram Bot API 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. Returns True on success.
func (*Client) UnbanChatSenderChat ¶
func (c *Client) UnbanChatSenderChat(ctx context.Context, params *UnbanChatSenderChatParams) (ret bool, err error)
UnbanChatSenderChat calls the unbanChatSenderChat Telegram Bot API 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. Returns True on success.
func (*Client) UnhideGeneralForumTopic ¶
func (c *Client) UnhideGeneralForumTopic(ctx context.Context, params *UnhideGeneralForumTopicParams) (ret bool, err error)
UnhideGeneralForumTopic calls the unhideGeneralForumTopic Telegram Bot API 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. Returns True on success.
func (*Client) UnpinAllChatMessages ¶
func (c *Client) UnpinAllChatMessages(ctx context.Context, params *UnpinAllChatMessagesParams) (ret bool, err error)
UnpinAllChatMessages calls the unpinAllChatMessages Telegram Bot API method.
Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success.
func (*Client) UnpinAllForumTopicMessages ¶
func (c *Client) UnpinAllForumTopicMessages(ctx context.Context, params *UnpinAllForumTopicMessagesParams) (ret bool, err error)
UnpinAllForumTopicMessages calls the unpinAllForumTopicMessages Telegram Bot API method.
Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat 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. Returns True on success.
func (*Client) UnpinAllGeneralForumTopicMessages ¶
func (c *Client) UnpinAllGeneralForumTopicMessages(ctx context.Context, params *UnpinAllGeneralForumTopicMessagesParams) (ret bool, err error)
UnpinAllGeneralForumTopicMessages calls the unpinAllGeneralForumTopicMessages Telegram Bot API method.
Use this method to clear the list of pinned messages in a General 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. Returns True on success.
func (*Client) UnpinChatMessage ¶
func (c *Client) UnpinChatMessage(ctx context.Context, params *UnpinChatMessageParams) (ret bool, err error)
UnpinChatMessage calls the unpinChatMessage Telegram Bot API method.
Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success.
func (*Client) UpgradeGift ¶
UpgradeGift calls the upgradeGift Telegram Bot API method.
Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.
func (*Client) UploadStickerFile ¶
func (c *Client) UploadStickerFile(ctx context.Context, params *UploadStickerFileParams) (ret *File, err error)
UploadStickerFile calls the uploadStickerFile Telegram Bot API method.
Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.
func (*Client) VerifyChat ¶
VerifyChat calls the verifyChat Telegram Bot API method.
Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
func (*Client) VerifyUser ¶
VerifyUser calls the verifyUser Telegram Bot API method.
Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
type ClientOption ¶
type ClientOption func(client *Client) ClientOption
ClientOption is a function that configures a Client.
func WithDefaultParseMode ¶
func WithDefaultParseMode(parseMode string) ClientOption
WithDefaultParseMode sets the default parse mode for the Client.
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient sets the custom HTTP client for the Client.
func WithRPS ¶
func WithRPS(rps int) ClientOption
WithRPS sets the requests per second limit for the Client.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout sets the HTTP client timeout for the Client.
type CloseForumTopicOption ¶
type CloseForumTopicOption func(params *CloseForumTopicParams) CloseForumTopicOption
CloseForumTopicOption configures CloseForumTopicParams.
func WithCloseForumTopicChatID ¶
func WithCloseForumTopicChatID(value string) CloseForumTopicOption
WithCloseForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithCloseForumTopicMessageThreadID ¶
func WithCloseForumTopicMessageThreadID(value int64) CloseForumTopicOption
WithCloseForumTopicMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread of the forum topic
type CloseForumTopicParams ¶
type CloseForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread of the forum topic
MessageThreadID int64 `json:"message_thread_id"`
}
CloseForumTopicParams contains parameters for Client.CloseForumTopic.
func (*CloseForumTopicParams) Option ¶
func (r *CloseForumTopicParams) Option(opts ...CloseForumTopicOption) (previous CloseForumTopicOption)
Option applies one or more CloseForumTopicOption values and returns the last rollback option.
type CloseGeneralForumTopicOption ¶
type CloseGeneralForumTopicOption func(params *CloseGeneralForumTopicParams) CloseGeneralForumTopicOption
CloseGeneralForumTopicOption configures CloseGeneralForumTopicParams.
func WithCloseGeneralForumTopicChatID ¶
func WithCloseGeneralForumTopicChatID(value string) CloseGeneralForumTopicOption
WithCloseGeneralForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type CloseGeneralForumTopicParams ¶
type CloseGeneralForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
}
CloseGeneralForumTopicParams contains parameters for Client.CloseGeneralForumTopic.
func (*CloseGeneralForumTopicParams) Option ¶
func (r *CloseGeneralForumTopicParams) Option(opts ...CloseGeneralForumTopicOption) (previous CloseGeneralForumTopicOption)
Option applies one or more CloseGeneralForumTopicOption values and returns the last rollback option.
type CloseOption ¶
type CloseOption func(params *CloseParams) CloseOption
CloseOption configures CloseParams.
type CloseParams ¶
type CloseParams struct {
}
CloseParams contains parameters for Client.Close.
func (*CloseParams) Option ¶
func (r *CloseParams) Option(opts ...CloseOption) (previous CloseOption)
Option applies one or more CloseOption values and returns the last rollback option.
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.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
UserID int64 `json:"user_id,omitempty"`
// Optional.
// Additional data about the contact in the form of a [vCard]
//
// [vCard]: https://en.wikipedia.org/wiki/VCard
Vcard string `json:"vcard,omitempty"`
}
Contact
This object represents a phone contact.
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context wraps context.Context and adds Telegram-specific methods.
func (*Context) AddStickerToSet ¶
func (ctx *Context) AddStickerToSet( userID int64, name string, sticker InputSticker, opts ...AddStickerToSetOption, ) error
AddStickerToSet calls Client.AddStickerToSet with context-derived defaults.
Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.
func (*Context) AnswerCallbackQuery ¶
func (ctx *Context) AnswerCallbackQuery( opts ...AnswerCallbackQueryOption, ) error
AnswerCallbackQuery calls Client.AnswerCallbackQuery with context-derived defaults.
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
func (*Context) AnswerInlineQuery ¶
func (ctx *Context) AnswerInlineQuery( results []InlineQueryResult, opts ...AnswerInlineQueryOption, ) error
AnswerInlineQuery calls Client.AnswerInlineQuery with context-derived defaults.
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 (*Context) AnswerPreCheckoutQuery ¶
func (ctx *Context) AnswerPreCheckoutQuery( ok bool, opts ...AnswerPreCheckoutQueryOption, ) error
AnswerPreCheckoutQuery calls Client.AnswerPreCheckoutQuery with context-derived defaults.
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 (*Context) AnswerShippingQuery ¶
func (ctx *Context) AnswerShippingQuery( ok bool, opts ...AnswerShippingQueryOption, ) error
AnswerShippingQuery calls Client.AnswerShippingQuery with context-derived defaults.
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 (*Context) AnswerWebAppQuery ¶
func (ctx *Context) AnswerWebAppQuery( webAppQueryID string, result InlineQueryResult, opts ...AnswerWebAppQueryOption, ) error
AnswerWebAppQuery calls Client.AnswerWebAppQuery with context-derived defaults.
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 (*Context) ApproveChatJoinRequest ¶
func (ctx *Context) ApproveChatJoinRequest( userID int64, opts ...ApproveChatJoinRequestOption, ) error
ApproveChatJoinRequest calls Client.ApproveChatJoinRequest with context-derived defaults.
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. Returns True on success.
func (*Context) ApproveSuggestedPost ¶
func (ctx *Context) ApproveSuggestedPost( messageID int64, opts ...ApproveSuggestedPostOption, ) error
ApproveSuggestedPost calls Client.ApproveSuggestedPost with context-derived defaults.
Use this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat. Returns True on success.
func (*Context) BanChatMember ¶
func (ctx *Context) BanChatMember( userID int64, opts ...BanChatMemberOption, ) error
BanChatMember calls Client.BanChatMember with context-derived defaults.
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. Returns True on success.
func (*Context) BanChatSenderChat ¶
func (ctx *Context) BanChatSenderChat( senderChatID int64, opts ...BanChatSenderChatOption, ) error
BanChatSenderChat calls Client.BanChatSenderChat with context-derived defaults.
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. Returns True on success.
func (*Context) Close ¶
func (ctx *Context) Close( opts ...CloseOption, ) error
Close calls Client.Close with context-derived defaults.
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
func (*Context) CloseForumTopic ¶
func (ctx *Context) CloseForumTopic( messageThreadID int64, opts ...CloseForumTopicOption, ) error
CloseForumTopic calls Client.CloseForumTopic with context-derived defaults.
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. Returns True on success.
func (*Context) CloseGeneralForumTopic ¶
func (ctx *Context) CloseGeneralForumTopic( opts ...CloseGeneralForumTopicOption, ) error
CloseGeneralForumTopic calls Client.CloseGeneralForumTopic with context-derived defaults.
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. Returns True on success.
func (*Context) ConvertGiftToStars ¶
func (ctx *Context) ConvertGiftToStars( ownedGiftID string, opts ...ConvertGiftToStarsOption, ) error
ConvertGiftToStars calls Client.ConvertGiftToStars with context-derived defaults.
Converts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right. Returns True on success.
func (*Context) CopyMessage ¶
func (ctx *Context) CopyMessage( fromChatID string, messageID int64, opts ...CopyMessageOption, ) error
CopyMessage calls Client.CopyMessage with context-derived defaults.
Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners 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 (*Context) CopyMessages ¶
func (ctx *Context) CopyMessages( fromChatID string, messageIDs []int64, opts ...CopyMessagesOption, ) error
CopyMessages calls Client.CopyMessages with context-derived defaults.
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners 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 forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.
func (*Context) CreateChatInviteLink ¶
func (ctx *Context) CreateChatInviteLink( opts ...CreateChatInviteLinkOption, ) error
CreateChatInviteLink calls Client.CreateChatInviteLink with context-derived defaults.
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 (*Context) CreateChatSubscriptionInviteLink ¶
func (ctx *Context) CreateChatSubscriptionInviteLink( subscriptionPeriod int64, subscriptionPrice int64, opts ...CreateChatSubscriptionInviteLinkOption, ) error
CreateChatSubscriptionInviteLink calls Client.CreateChatSubscriptionInviteLink with context-derived defaults.
Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink. Returns the new invite link as a ChatInviteLink object.
func (*Context) CreateForumTopic ¶
func (ctx *Context) CreateForumTopic( name string, opts ...CreateForumTopicOption, ) error
CreateForumTopic calls Client.CreateForumTopic with context-derived defaults.
Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator right. Returns information about the created topic as a ForumTopic object.
func (*Context) CreateInvoiceLink ¶
func (ctx *Context) CreateInvoiceLink( title string, description string, payload string, currency string, prices []LabeledPrice, opts ...CreateInvoiceLinkOption, ) error
CreateInvoiceLink calls Client.CreateInvoiceLink with context-derived defaults.
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
func (*Context) CreateNewStickerSet ¶
func (ctx *Context) CreateNewStickerSet( userID int64, name string, title string, stickers []InputSticker, opts ...CreateNewStickerSetOption, ) error
CreateNewStickerSet calls Client.CreateNewStickerSet with context-derived defaults.
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. Returns True on success.
func (*Context) Deadline ¶
Deadline returns the time when work done on behalf of this context should be cancelled.
func (*Context) DeclineChatJoinRequest ¶
func (ctx *Context) DeclineChatJoinRequest( userID int64, opts ...DeclineChatJoinRequestOption, ) error
DeclineChatJoinRequest calls Client.DeclineChatJoinRequest with context-derived defaults.
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. Returns True on success.
func (*Context) DeclineSuggestedPost ¶
func (ctx *Context) DeclineSuggestedPost( messageID int64, opts ...DeclineSuggestedPostOption, ) error
DeclineSuggestedPost calls Client.DeclineSuggestedPost with context-derived defaults.
Use this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat. Returns True on success.
func (*Context) DeleteBusinessMessages ¶
func (ctx *Context) DeleteBusinessMessages( messageIDs []int64, opts ...DeleteBusinessMessagesOption, ) error
DeleteBusinessMessages calls Client.DeleteBusinessMessages with context-derived defaults.
Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
func (*Context) DeleteChatPhoto ¶
func (ctx *Context) DeleteChatPhoto( opts ...DeleteChatPhotoOption, ) error
DeleteChatPhoto calls Client.DeleteChatPhoto with context-derived defaults.
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. Returns True on success.
func (*Context) DeleteChatStickerSet ¶
func (ctx *Context) DeleteChatStickerSet( opts ...DeleteChatStickerSetOption, ) error
DeleteChatStickerSet calls Client.DeleteChatStickerSet with context-derived defaults.
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. Returns True on success.
func (*Context) DeleteForumTopic ¶
func (ctx *Context) DeleteForumTopic( messageThreadID int64, opts ...DeleteForumTopicOption, ) error
DeleteForumTopic calls Client.DeleteForumTopic with context-derived defaults.
Use this method to delete a forum topic along with all its messages in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
func (*Context) DeleteMessage ¶
func (ctx *Context) DeleteMessage( messageID int64, opts ...DeleteMessageOption, ) error
DeleteMessage calls Client.DeleteMessage with context-derived defaults.
Use this method to delete a message, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago. - Service messages about a supergroup, channel, or forum topic creation can't be deleted. - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing messages in private chats, groups, and supergroups. - Bots can delete incoming messages in private chats. - Bots granted can_post_messages permissions can delete outgoing messages in channels. - If the bot is an administrator of a group, it can delete any message there. - If the bot has can_delete_messages administrator right in a supergroup or a channel, it can delete any message there. - If the bot has can_manage_direct_messages administrator right in a channel, it can delete any message in the corresponding direct messages chat. Returns True on success.
func (*Context) DeleteMessages ¶
func (ctx *Context) DeleteMessages( messageIDs []int64, opts ...DeleteMessagesOption, ) error
DeleteMessages calls Client.DeleteMessages with context-derived defaults.
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.
func (*Context) DeleteMyCommands ¶
func (ctx *Context) DeleteMyCommands( opts ...DeleteMyCommandsOption, ) error
DeleteMyCommands calls Client.DeleteMyCommands with context-derived defaults.
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. Returns True on success.
func (*Context) DeleteStickerFromSet ¶
func (ctx *Context) DeleteStickerFromSet( sticker string, opts ...DeleteStickerFromSetOption, ) error
DeleteStickerFromSet calls Client.DeleteStickerFromSet with context-derived defaults.
Use this method to delete a sticker from a set created by the bot. Returns True on success.
func (*Context) DeleteStickerSet ¶
func (ctx *Context) DeleteStickerSet( name string, opts ...DeleteStickerSetOption, ) error
DeleteStickerSet calls Client.DeleteStickerSet with context-derived defaults.
Use this method to delete a sticker set that was created by the bot. Returns True on success.
func (*Context) DeleteStory ¶
func (ctx *Context) DeleteStory( storyID int64, opts ...DeleteStoryOption, ) error
DeleteStory calls Client.DeleteStory with context-derived defaults.
Deletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns True on success.
func (*Context) DeleteWebhook ¶
func (ctx *Context) DeleteWebhook( opts ...DeleteWebhookOption, ) error
DeleteWebhook calls Client.DeleteWebhook with context-derived defaults.
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
func (*Context) Done ¶
func (ctx *Context) Done() <-chan struct{}
Done returns a channel that's closed when work done on behalf of this context should be cancelled.
func (*Context) EditChatInviteLink ¶
func (ctx *Context) EditChatInviteLink( inviteLink string, opts ...EditChatInviteLinkOption, ) error
EditChatInviteLink calls Client.EditChatInviteLink with context-derived defaults.
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 (*Context) EditChatSubscriptionInviteLink ¶
func (ctx *Context) EditChatSubscriptionInviteLink( inviteLink string, opts ...EditChatSubscriptionInviteLinkOption, ) error
EditChatSubscriptionInviteLink calls Client.EditChatSubscriptionInviteLink with context-derived defaults.
Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights. Returns the edited invite link as a ChatInviteLink object.
func (*Context) EditForumTopic ¶
func (ctx *Context) EditForumTopic( messageThreadID int64, opts ...EditForumTopicOption, ) error
EditForumTopic calls Client.EditForumTopic with context-derived defaults.
Use this method to edit name and icon of a topic in a forum supergroup chat or a private chat with a user. In the case of a 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. Returns True on success.
func (*Context) EditGeneralForumTopic ¶
func (ctx *Context) EditGeneralForumTopic( name string, opts ...EditGeneralForumTopicOption, ) error
EditGeneralForumTopic calls Client.EditGeneralForumTopic with context-derived defaults.
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 the can_manage_topics administrator rights. Returns True on success.
func (*Context) EditMessageCaption ¶
func (ctx *Context) EditMessageCaption( opts ...EditMessageCaptionOption, ) error
EditMessageCaption calls Client.EditMessageCaption with context-derived defaults.
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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Context) EditMessageChecklist ¶
func (ctx *Context) EditMessageChecklist( messageID int64, checklist InputChecklist, opts ...EditMessageChecklistOption, ) error
EditMessageChecklist calls Client.EditMessageChecklist with context-derived defaults.
Use this method to edit a checklist on behalf of a connected business account. On success, the edited Message is returned.
func (*Context) EditMessageLiveLocation ¶
func (ctx *Context) EditMessageLiveLocation( latitude float64, longitude float64, opts ...EditMessageLiveLocationOption, ) error
EditMessageLiveLocation calls Client.EditMessageLiveLocation with context-derived defaults.
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 (*Context) EditMessageMedia ¶
func (ctx *Context) EditMessageMedia( media InputMedia, opts ...EditMessageMediaOption, ) error
EditMessageMedia calls Client.EditMessageMedia with context-derived defaults.
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text 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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Context) EditMessageReplyMarkup ¶
func (ctx *Context) EditMessageReplyMarkup( opts ...EditMessageReplyMarkupOption, ) error
EditMessageReplyMarkup calls Client.EditMessageReplyMarkup with context-derived defaults.
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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Context) EditMessageText ¶
func (ctx *Context) EditMessageText( text string, opts ...EditMessageTextOption, ) error
EditMessageText calls Client.EditMessageText with context-derived defaults.
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. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.
func (*Context) EditStory ¶
func (ctx *Context) EditStory( storyID int64, content InputStoryContent, opts ...EditStoryOption, ) error
EditStory calls Client.EditStory with context-derived defaults.
Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
func (*Context) EditUserStarSubscription ¶
func (ctx *Context) EditUserStarSubscription( userID int64, telegramPaymentChargeID string, isCanceled bool, opts ...EditUserStarSubscriptionOption, ) error
EditUserStarSubscription calls Client.EditUserStarSubscription with context-derived defaults.
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
func (*Context) ExportChatInviteLink ¶
func (ctx *Context) ExportChatInviteLink( opts ...ExportChatInviteLinkOption, ) error
ExportChatInviteLink calls Client.ExportChatInviteLink with context-derived defaults.
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 (*Context) ForwardMessage ¶
func (ctx *Context) ForwardMessage( fromChatID string, messageID int64, opts ...ForwardMessageOption, ) error
ForwardMessage calls Client.ForwardMessage with context-derived defaults.
Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
func (*Context) ForwardMessages ¶
func (ctx *Context) ForwardMessages( fromChatID string, messageIDs []int64, opts ...ForwardMessagesOption, ) error
ForwardMessages calls Client.ForwardMessages with context-derived defaults.
Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.
func (*Context) GetAvailableGifts ¶
func (ctx *Context) GetAvailableGifts( opts ...GetAvailableGiftsOption, ) error
GetAvailableGifts calls Client.GetAvailableGifts with context-derived defaults.
Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.
func (*Context) GetBusinessAccountGifts ¶
func (ctx *Context) GetBusinessAccountGifts( opts ...GetBusinessAccountGiftsOption, ) error
GetBusinessAccountGifts calls Client.GetBusinessAccountGifts with context-derived defaults.
Returns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns OwnedGifts on success.
func (*Context) GetBusinessAccountStarBalance ¶
func (ctx *Context) GetBusinessAccountStarBalance( opts ...GetBusinessAccountStarBalanceOption, ) error
GetBusinessAccountStarBalance calls Client.GetBusinessAccountStarBalance with context-derived defaults.
Returns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right. Returns StarAmount on success.
func (*Context) GetBusinessConnection ¶
func (ctx *Context) GetBusinessConnection( opts ...GetBusinessConnectionOption, ) error
GetBusinessConnection calls Client.GetBusinessConnection with context-derived defaults.
Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
func (*Context) GetChat ¶
func (ctx *Context) GetChat( opts ...GetChatOption, ) error
GetChat calls Client.GetChat with context-derived defaults.
Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.
func (*Context) GetChatAdministrators ¶
func (ctx *Context) GetChatAdministrators( opts ...GetChatAdministratorsOption, ) error
GetChatAdministrators calls Client.GetChatAdministrators with context-derived defaults.
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
func (*Context) GetChatGifts ¶
func (ctx *Context) GetChatGifts( opts ...GetChatGiftsOption, ) error
GetChatGifts calls Client.GetChatGifts with context-derived defaults.
Returns the gifts owned by a chat. Returns OwnedGifts on success.
func (*Context) GetChatMember ¶
func (ctx *Context) GetChatMember( userID int64, opts ...GetChatMemberOption, ) error
GetChatMember calls Client.GetChatMember with context-derived defaults.
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 (*Context) GetChatMemberCount ¶
func (ctx *Context) GetChatMemberCount( opts ...GetChatMemberCountOption, ) error
GetChatMemberCount calls Client.GetChatMemberCount with context-derived defaults.
Use this method to get the number of members in a chat. Returns Int on success.
func (*Context) GetChatMenuButton ¶
func (ctx *Context) GetChatMenuButton( opts ...GetChatMenuButtonOption, ) error
GetChatMenuButton calls Client.GetChatMenuButton with context-derived defaults.
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 (*Context) GetCustomEmojiStickers ¶
func (ctx *Context) GetCustomEmojiStickers( customEmojiIDs []string, opts ...GetCustomEmojiStickersOption, ) error
GetCustomEmojiStickers calls Client.GetCustomEmojiStickers with context-derived defaults.
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
func (*Context) GetFile ¶
func (ctx *Context) GetFile( fileID string, opts ...GetFileOption, ) error
GetFile calls Client.GetFile with context-derived defaults.
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. Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.
func (*Context) GetForumTopicIconStickers ¶
func (ctx *Context) GetForumTopicIconStickers( opts ...GetForumTopicIconStickersOption, ) error
GetForumTopicIconStickers calls Client.GetForumTopicIconStickers with context-derived defaults.
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 (*Context) GetGameHighScores ¶
func (ctx *Context) GetGameHighScores( userID int64, opts ...GetGameHighScoresOption, ) error
GetGameHighScores calls Client.GetGameHighScores with context-derived defaults.
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.
func (*Context) GetMe ¶
func (ctx *Context) GetMe( opts ...GetMeOption, ) error
GetMe calls Client.GetMe with context-derived defaults.
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 (*Context) GetMyCommands ¶
func (ctx *Context) GetMyCommands( opts ...GetMyCommandsOption, ) error
GetMyCommands calls Client.GetMyCommands with context-derived defaults.
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 (*Context) GetMyDefaultAdministratorRights ¶
func (ctx *Context) GetMyDefaultAdministratorRights( opts ...GetMyDefaultAdministratorRightsOption, ) error
GetMyDefaultAdministratorRights calls Client.GetMyDefaultAdministratorRights with context-derived defaults.
Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
func (*Context) GetMyDescription ¶
func (ctx *Context) GetMyDescription( opts ...GetMyDescriptionOption, ) error
GetMyDescription calls Client.GetMyDescription with context-derived defaults.
Use this method to get the current bot description for the given user language. Returns BotDescription on success.
func (*Context) GetMyName ¶
func (ctx *Context) GetMyName( opts ...GetMyNameOption, ) error
GetMyName calls Client.GetMyName with context-derived defaults.
Use this method to get the current bot name for the given user language. Returns BotName on success.
func (*Context) GetMyShortDescription ¶
func (ctx *Context) GetMyShortDescription( opts ...GetMyShortDescriptionOption, ) error
GetMyShortDescription calls Client.GetMyShortDescription with context-derived defaults.
Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
func (*Context) GetMyStarBalance ¶
func (ctx *Context) GetMyStarBalance( opts ...GetMyStarBalanceOption, ) error
GetMyStarBalance calls Client.GetMyStarBalance with context-derived defaults.
A method to get the current Telegram Stars balance of the bot. Requires no parameters. On success, returns a StarAmount object.
func (*Context) GetStarTransactions ¶
func (ctx *Context) GetStarTransactions( opts ...GetStarTransactionsOption, ) error
GetStarTransactions calls Client.GetStarTransactions with context-derived defaults.
Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
func (*Context) GetStickerSet ¶
func (ctx *Context) GetStickerSet( name string, opts ...GetStickerSetOption, ) error
GetStickerSet calls Client.GetStickerSet with context-derived defaults.
Use this method to get a sticker set. On success, a StickerSet object is returned.
func (*Context) GetUpdates ¶
func (ctx *Context) GetUpdates( opts ...GetUpdatesOption, ) error
GetUpdates calls Client.GetUpdates with context-derived defaults.
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
func (*Context) GetUserChatBoosts ¶
func (ctx *Context) GetUserChatBoosts( userID int64, opts ...GetUserChatBoostsOption, ) error
GetUserChatBoosts calls Client.GetUserChatBoosts with context-derived defaults.
Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
func (*Context) GetUserGifts ¶
func (ctx *Context) GetUserGifts( userID int64, opts ...GetUserGiftsOption, ) error
GetUserGifts calls Client.GetUserGifts with context-derived defaults.
Returns the gifts owned and hosted by a user. Returns OwnedGifts on success.
func (*Context) GetUserProfileAudios ¶
func (ctx *Context) GetUserProfileAudios( userID int64, opts ...GetUserProfileAudiosOption, ) error
GetUserProfileAudios calls Client.GetUserProfileAudios with context-derived defaults.
Use this method to get a list of profile audios for a user. Returns a UserProfileAudios object.
func (*Context) GetUserProfilePhotos ¶
func (ctx *Context) GetUserProfilePhotos( userID int64, opts ...GetUserProfilePhotosOption, ) error
GetUserProfilePhotos calls Client.GetUserProfilePhotos with context-derived defaults.
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
func (*Context) GetWebhookInfo ¶
func (ctx *Context) GetWebhookInfo( opts ...GetWebhookInfoOption, ) error
GetWebhookInfo calls Client.GetWebhookInfo with context-derived defaults.
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 (*Context) GiftPremiumSubscription ¶
func (ctx *Context) GiftPremiumSubscription( userID int64, monthCount int64, starCount int64, opts ...GiftPremiumSubscriptionOption, ) error
GiftPremiumSubscription calls Client.GiftPremiumSubscription with context-derived defaults.
Gifts a Telegram Premium subscription to the given user. Returns True on success.
func (*Context) HideGeneralForumTopic ¶
func (ctx *Context) HideGeneralForumTopic( opts ...HideGeneralForumTopicOption, ) error
HideGeneralForumTopic calls Client.HideGeneralForumTopic with context-derived defaults.
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. Returns True on success.
func (*Context) LeaveChat ¶
func (ctx *Context) LeaveChat( opts ...LeaveChatOption, ) error
LeaveChat calls Client.LeaveChat with context-derived defaults.
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
func (*Context) LogOut ¶
func (ctx *Context) LogOut( opts ...LogOutOption, ) error
LogOut calls Client.LogOut with context-derived defaults.
Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
func (*Context) PinChatMessage ¶
func (ctx *Context) PinChatMessage( messageID int64, opts ...PinChatMessageOption, ) error
PinChatMessage calls Client.PinChatMessage with context-derived defaults.
Use this method to add a message to the list of pinned messages in a chat. In private chats and channel direct messages chats, all non-service messages can be pinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to pin messages in groups and channels respectively. Returns True on success.
func (*Context) PostStory ¶
func (ctx *Context) PostStory( content InputStoryContent, activePeriod int64, opts ...PostStoryOption, ) error
PostStory calls Client.PostStory with context-derived defaults.
Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right. Returns Story on success.
func (*Context) PromoteChatMember ¶
func (ctx *Context) PromoteChatMember( userID int64, opts ...PromoteChatMemberOption, ) error
PromoteChatMember calls Client.PromoteChatMember with context-derived defaults.
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. Returns True on success.
func (*Context) ReadBusinessMessage ¶
func (ctx *Context) ReadBusinessMessage( messageID int64, opts ...ReadBusinessMessageOption, ) error
ReadBusinessMessage calls Client.ReadBusinessMessage with context-derived defaults.
Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
func (*Context) RefundStarPayment ¶
func (ctx *Context) RefundStarPayment( userID int64, telegramPaymentChargeID string, opts ...RefundStarPaymentOption, ) error
RefundStarPayment calls Client.RefundStarPayment with context-derived defaults.
Refunds a successful payment in Telegram Stars. Returns True on success.
func (*Context) RemoveBusinessAccountProfilePhoto ¶
func (ctx *Context) RemoveBusinessAccountProfilePhoto( opts ...RemoveBusinessAccountProfilePhotoOption, ) error
RemoveBusinessAccountProfilePhoto calls Client.RemoveBusinessAccountProfilePhoto with context-derived defaults.
Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
func (*Context) RemoveChatVerification ¶
func (ctx *Context) RemoveChatVerification( opts ...RemoveChatVerificationOption, ) error
RemoveChatVerification calls Client.RemoveChatVerification with context-derived defaults.
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
func (*Context) RemoveMyProfilePhoto ¶
func (ctx *Context) RemoveMyProfilePhoto( opts ...RemoveMyProfilePhotoOption, ) error
RemoveMyProfilePhoto calls Client.RemoveMyProfilePhoto with context-derived defaults.
Removes the profile photo of the bot. Requires no parameters. Returns True on success.
func (*Context) RemoveUserVerification ¶
func (ctx *Context) RemoveUserVerification( userID int64, opts ...RemoveUserVerificationOption, ) error
RemoveUserVerification calls Client.RemoveUserVerification with context-derived defaults.
Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
func (*Context) ReopenForumTopic ¶
func (ctx *Context) ReopenForumTopic( messageThreadID int64, opts ...ReopenForumTopicOption, ) error
ReopenForumTopic calls Client.ReopenForumTopic with context-derived defaults.
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. Returns True on success.
func (*Context) ReopenGeneralForumTopic ¶
func (ctx *Context) ReopenGeneralForumTopic( opts ...ReopenGeneralForumTopicOption, ) error
ReopenGeneralForumTopic calls Client.ReopenGeneralForumTopic with context-derived defaults.
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. Returns True on success.
func (*Context) ReplaceStickerInSet ¶
func (ctx *Context) ReplaceStickerInSet( userID int64, name string, oldSticker string, sticker InputSticker, opts ...ReplaceStickerInSetOption, ) error
ReplaceStickerInSet calls Client.ReplaceStickerInSet with context-derived defaults.
Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.
func (*Context) RepostStory ¶
func (ctx *Context) RepostStory( fromChatID int64, fromStoryID int64, activePeriod int64, opts ...RepostStoryOption, ) error
RepostStory calls Client.RepostStory with context-derived defaults.
Reposts a story on behalf of a business account from another business account. Both business accounts must be managed by the same bot, and the story on the source account must have been posted (or reposted) by the bot. Requires the can_manage_stories business bot right for both business accounts. Returns Story on success.
func (*Context) RestrictChatMember ¶
func (ctx *Context) RestrictChatMember( userID int64, permissions ChatPermissions, opts ...RestrictChatMemberOption, ) error
RestrictChatMember calls Client.RestrictChatMember with context-derived defaults.
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. Returns True on success.
func (*Context) RevokeChatInviteLink ¶
func (ctx *Context) RevokeChatInviteLink( inviteLink string, opts ...RevokeChatInviteLinkOption, ) error
RevokeChatInviteLink calls Client.RevokeChatInviteLink with context-derived defaults.
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 (*Context) SavePreparedInlineMessage ¶
func (ctx *Context) SavePreparedInlineMessage( userID int64, result InlineQueryResult, opts ...SavePreparedInlineMessageOption, ) error
SavePreparedInlineMessage calls Client.SavePreparedInlineMessage with context-derived defaults.
Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
func (*Context) SendAnimation ¶
func (ctx *Context) SendAnimation( animation InputFile, opts ...SendAnimationOption, ) error
SendAnimation calls Client.SendAnimation with context-derived defaults.
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 (*Context) SendAudio ¶
func (ctx *Context) SendAudio( audio InputFile, opts ...SendAudioOption, ) error
SendAudio calls Client.SendAudio with context-derived defaults.
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 (*Context) SendChatAction ¶
func (ctx *Context) SendChatAction( action string, opts ...SendChatActionOption, ) error
SendChatAction calls Client.SendChatAction with context-derived defaults.
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
func (*Context) SendChecklist ¶
func (ctx *Context) SendChecklist( checklist InputChecklist, opts ...SendChecklistOption, ) error
SendChecklist calls Client.SendChecklist with context-derived defaults.
Use this method to send a checklist on behalf of a connected business account. On success, the sent Message is returned.
func (*Context) SendContact ¶
func (ctx *Context) SendContact( phoneNumber string, firstName string, opts ...SendContactOption, ) error
SendContact calls Client.SendContact with context-derived defaults.
Use this method to send phone contacts. On success, the sent Message is returned.
func (*Context) SendDice ¶
func (ctx *Context) SendDice( opts ...SendDiceOption, ) error
SendDice calls Client.SendDice with context-derived defaults.
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
func (*Context) SendDocument ¶
func (ctx *Context) SendDocument( document InputFile, opts ...SendDocumentOption, ) error
SendDocument calls Client.SendDocument with context-derived defaults.
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 (*Context) SendGame ¶
func (ctx *Context) SendGame( gameShortName string, opts ...SendGameOption, ) error
SendGame calls Client.SendGame with context-derived defaults.
Use this method to send a game. On success, the sent Message is returned.
func (*Context) SendGift ¶
func (ctx *Context) SendGift( giftID string, opts ...SendGiftOption, ) error
SendGift calls Client.SendGift with context-derived defaults.
Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
func (*Context) SendInvoice ¶
func (ctx *Context) SendInvoice( title string, description string, payload string, currency string, prices []LabeledPrice, opts ...SendInvoiceOption, ) error
SendInvoice calls Client.SendInvoice with context-derived defaults.
Use this method to send invoices. On success, the sent Message is returned.
func (*Context) SendLocation ¶
func (ctx *Context) SendLocation( latitude float64, longitude float64, opts ...SendLocationOption, ) error
SendLocation calls Client.SendLocation with context-derived defaults.
Use this method to send point on the map. On success, the sent Message is returned.
func (*Context) SendMediaGroup ¶
func (ctx *Context) SendMediaGroup( media []InputMedia, opts ...SendMediaGroupOption, ) error
SendMediaGroup calls Client.SendMediaGroup with context-derived defaults.
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 Message objects that were sent is returned.
func (*Context) SendMessage ¶
func (ctx *Context) SendMessage( text string, opts ...SendMessageOption, ) error
SendMessage calls Client.SendMessage with context-derived defaults.
Use this method to send text messages. On success, the sent Message is returned.
func (*Context) SendMessageDraft ¶
func (ctx *Context) SendMessageDraft( draftID int64, text string, opts ...SendMessageDraftOption, ) error
SendMessageDraft calls Client.SendMessageDraft with context-derived defaults.
Use this method to stream a partial message to a user while the message is being generated. Returns True on success.
func (*Context) SendPaidMedia ¶
func (ctx *Context) SendPaidMedia( starCount int64, media []InputPaidMedia, opts ...SendPaidMediaOption, ) error
SendPaidMedia calls Client.SendPaidMedia with context-derived defaults.
Use this method to send paid media. On success, the sent Message is returned.
func (*Context) SendPhoto ¶
func (ctx *Context) SendPhoto( photo InputFile, opts ...SendPhotoOption, ) error
SendPhoto calls Client.SendPhoto with context-derived defaults.
Use this method to send photos. On success, the sent Message is returned.
func (*Context) SendPoll ¶
func (ctx *Context) SendPoll( question string, options []InputPollOption, opts ...SendPollOption, ) error
SendPoll calls Client.SendPoll with context-derived defaults.
Use this method to send a native poll. On success, the sent Message is returned.
func (*Context) SendSticker ¶
func (ctx *Context) SendSticker( sticker InputFile, opts ...SendStickerOption, ) error
SendSticker calls Client.SendSticker with context-derived defaults.
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
func (*Context) SendVenue ¶
func (ctx *Context) SendVenue( latitude float64, longitude float64, title string, address string, opts ...SendVenueOption, ) error
SendVenue calls Client.SendVenue with context-derived defaults.
Use this method to send information about a venue. On success, the sent Message is returned.
func (*Context) SendVideo ¶
func (ctx *Context) SendVideo( video InputFile, opts ...SendVideoOption, ) error
SendVideo calls Client.SendVideo with context-derived defaults.
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 (*Context) SendVideoNote ¶
func (ctx *Context) SendVideoNote( videoNote InputFile, opts ...SendVideoNoteOption, ) error
SendVideoNote calls Client.SendVideoNote with context-derived defaults.
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 (*Context) SendVoice ¶
func (ctx *Context) SendVoice( voice InputFile, opts ...SendVoiceOption, ) error
SendVoice calls Client.SendVoice with context-derived defaults.
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, or in .MP3 format, or in .M4A format (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 (*Context) SetBusinessAccountBio ¶
func (ctx *Context) SetBusinessAccountBio( opts ...SetBusinessAccountBioOption, ) error
SetBusinessAccountBio calls Client.SetBusinessAccountBio with context-derived defaults.
Changes the bio of a managed business account. Requires the can_change_bio business bot right. Returns True on success.
func (*Context) SetBusinessAccountGiftSettings ¶
func (ctx *Context) SetBusinessAccountGiftSettings( showGiftButton bool, acceptedGiftTypes AcceptedGiftTypes, opts ...SetBusinessAccountGiftSettingsOption, ) error
SetBusinessAccountGiftSettings calls Client.SetBusinessAccountGiftSettings with context-derived defaults.
Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right. Returns True on success.
func (*Context) SetBusinessAccountName ¶
func (ctx *Context) SetBusinessAccountName( firstName string, opts ...SetBusinessAccountNameOption, ) error
SetBusinessAccountName calls Client.SetBusinessAccountName with context-derived defaults.
Changes the first and last name of a managed business account. Requires the can_change_name business bot right. Returns True on success.
func (*Context) SetBusinessAccountProfilePhoto ¶
func (ctx *Context) SetBusinessAccountProfilePhoto( photo InputProfilePhoto, opts ...SetBusinessAccountProfilePhotoOption, ) error
SetBusinessAccountProfilePhoto calls Client.SetBusinessAccountProfilePhoto with context-derived defaults.
Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right. Returns True on success.
func (*Context) SetBusinessAccountUsername ¶
func (ctx *Context) SetBusinessAccountUsername( opts ...SetBusinessAccountUsernameOption, ) error
SetBusinessAccountUsername calls Client.SetBusinessAccountUsername with context-derived defaults.
Changes the username of a managed business account. Requires the can_change_username business bot right. Returns True on success.
func (*Context) SetChatAdministratorCustomTitle ¶
func (ctx *Context) SetChatAdministratorCustomTitle( userID int64, customTitle string, opts ...SetChatAdministratorCustomTitleOption, ) error
SetChatAdministratorCustomTitle calls Client.SetChatAdministratorCustomTitle with context-derived defaults.
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
func (*Context) SetChatDescription ¶
func (ctx *Context) SetChatDescription( opts ...SetChatDescriptionOption, ) error
SetChatDescription calls Client.SetChatDescription with context-derived defaults.
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. Returns True on success.
func (*Context) SetChatMemberTag ¶
func (ctx *Context) SetChatMemberTag( userID int64, opts ...SetChatMemberTagOption, ) error
SetChatMemberTag calls Client.SetChatMemberTag with context-derived defaults.
Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. Returns True on success.
func (*Context) SetChatMenuButton ¶
func (ctx *Context) SetChatMenuButton( opts ...SetChatMenuButtonOption, ) error
SetChatMenuButton calls Client.SetChatMenuButton with context-derived defaults.
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
func (*Context) SetChatPermissions ¶
func (ctx *Context) SetChatPermissions( permissions ChatPermissions, opts ...SetChatPermissionsOption, ) error
SetChatPermissions calls Client.SetChatPermissions with context-derived defaults.
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. Returns True on success.
func (*Context) SetChatPhoto ¶
func (ctx *Context) SetChatPhoto( photo InputFile, opts ...SetChatPhotoOption, ) error
SetChatPhoto calls Client.SetChatPhoto with context-derived defaults.
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. Returns True on success.
func (*Context) SetChatStickerSet ¶
func (ctx *Context) SetChatStickerSet( stickerSetName string, opts ...SetChatStickerSetOption, ) error
SetChatStickerSet calls Client.SetChatStickerSet with context-derived defaults.
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. Returns True on success.
func (*Context) SetChatTitle ¶
func (ctx *Context) SetChatTitle( title string, opts ...SetChatTitleOption, ) error
SetChatTitle calls Client.SetChatTitle with context-derived defaults.
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. Returns True on success.
func (*Context) SetCustomEmojiStickerSetThumbnail ¶
func (ctx *Context) SetCustomEmojiStickerSetThumbnail( name string, opts ...SetCustomEmojiStickerSetThumbnailOption, ) error
SetCustomEmojiStickerSetThumbnail calls Client.SetCustomEmojiStickerSetThumbnail with context-derived defaults.
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
func (*Context) SetGameScore ¶
func (ctx *Context) SetGameScore( userID int64, score int64, opts ...SetGameScoreOption, ) error
SetGameScore calls Client.SetGameScore with context-derived defaults.
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 (*Context) SetMessageReaction ¶
func (ctx *Context) SetMessageReaction( messageID int64, opts ...SetMessageReactionOption, ) error
SetMessageReaction calls Client.SetMessageReaction with context-derived defaults.
Use this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions. Returns True on success.
func (*Context) SetMyCommands ¶
func (ctx *Context) SetMyCommands( commands []BotCommand, opts ...SetMyCommandsOption, ) error
SetMyCommands calls Client.SetMyCommands with context-derived defaults.
Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.
func (*Context) SetMyDefaultAdministratorRights ¶
func (ctx *Context) SetMyDefaultAdministratorRights( opts ...SetMyDefaultAdministratorRightsOption, ) error
SetMyDefaultAdministratorRights calls Client.SetMyDefaultAdministratorRights with context-derived defaults.
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. Returns True on success.
func (*Context) SetMyDescription ¶
func (ctx *Context) SetMyDescription( opts ...SetMyDescriptionOption, ) error
SetMyDescription calls Client.SetMyDescription with context-derived defaults.
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
func (*Context) SetMyName ¶
func (ctx *Context) SetMyName( opts ...SetMyNameOption, ) error
SetMyName calls Client.SetMyName with context-derived defaults.
Use this method to change the bot's name. Returns True on success.
func (*Context) SetMyProfilePhoto ¶
func (ctx *Context) SetMyProfilePhoto( photo InputProfilePhoto, opts ...SetMyProfilePhotoOption, ) error
SetMyProfilePhoto calls Client.SetMyProfilePhoto with context-derived defaults.
Changes the profile photo of the bot. Returns True on success.
func (*Context) SetMyShortDescription ¶
func (ctx *Context) SetMyShortDescription( opts ...SetMyShortDescriptionOption, ) error
SetMyShortDescription calls Client.SetMyShortDescription with context-derived defaults.
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. Returns True on success.
func (*Context) SetPassportDataErrors ¶
func (ctx *Context) SetPassportDataErrors( userID int64, errors []PassportElementError, opts ...SetPassportDataErrorsOption, ) error
SetPassportDataErrors calls Client.SetPassportDataErrors with context-derived defaults.
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
func (*Context) SetStickerEmojiList ¶
func (ctx *Context) SetStickerEmojiList( sticker string, emojiList []string, opts ...SetStickerEmojiListOption, ) error
SetStickerEmojiList calls Client.SetStickerEmojiList with context-derived defaults.
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. Returns True on success.
func (*Context) SetStickerKeywords ¶
func (ctx *Context) SetStickerKeywords( sticker string, opts ...SetStickerKeywordsOption, ) error
SetStickerKeywords calls Client.SetStickerKeywords with context-derived defaults.
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. Returns True on success.
func (*Context) SetStickerMaskPosition ¶
func (ctx *Context) SetStickerMaskPosition( sticker string, opts ...SetStickerMaskPositionOption, ) error
SetStickerMaskPosition calls Client.SetStickerMaskPosition with context-derived defaults.
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. Returns True on success.
func (*Context) SetStickerPositionInSet ¶
func (ctx *Context) SetStickerPositionInSet( sticker string, position int64, opts ...SetStickerPositionInSetOption, ) error
SetStickerPositionInSet calls Client.SetStickerPositionInSet with context-derived defaults.
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
func (*Context) SetStickerSetThumbnail ¶
func (ctx *Context) SetStickerSetThumbnail( name string, userID int64, format string, opts ...SetStickerSetThumbnailOption, ) error
SetStickerSetThumbnail calls Client.SetStickerSetThumbnail with context-derived defaults.
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. Returns True on success.
func (*Context) SetStickerSetTitle ¶
func (ctx *Context) SetStickerSetTitle( name string, title string, opts ...SetStickerSetTitleOption, ) error
SetStickerSetTitle calls Client.SetStickerSetTitle with context-derived defaults.
Use this method to set the title of a created sticker set. Returns True on success.
func (*Context) SetUserEmojiStatus ¶
func (ctx *Context) SetUserEmojiStatus( userID int64, opts ...SetUserEmojiStatusOption, ) error
SetUserEmojiStatus calls Client.SetUserEmojiStatus with context-derived defaults.
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.
func (*Context) SetWebhook ¶
func (ctx *Context) SetWebhook( uRL string, opts ...SetWebhookOption, ) error
SetWebhook calls Client.SetWebhook with context-derived defaults.
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 (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success. 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 (*Context) StopMessageLiveLocation ¶
func (ctx *Context) StopMessageLiveLocation( opts ...StopMessageLiveLocationOption, ) error
StopMessageLiveLocation calls Client.StopMessageLiveLocation with context-derived defaults.
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 (*Context) StopPoll ¶
func (ctx *Context) StopPoll( messageID int64, opts ...StopPollOption, ) error
StopPoll calls Client.StopPoll with context-derived defaults.
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
func (*Context) TransferBusinessAccountStars ¶
func (ctx *Context) TransferBusinessAccountStars( starCount int64, opts ...TransferBusinessAccountStarsOption, ) error
TransferBusinessAccountStars calls Client.TransferBusinessAccountStars with context-derived defaults.
Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.
func (*Context) TransferGift ¶
func (ctx *Context) TransferGift( ownedGiftID string, newOwnerChatID int64, opts ...TransferGiftOption, ) error
TransferGift calls Client.TransferGift with context-derived defaults.
Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid. Returns True on success.
func (*Context) UnbanChatMember ¶
func (ctx *Context) UnbanChatMember( userID int64, opts ...UnbanChatMemberOption, ) error
UnbanChatMember calls Client.UnbanChatMember with context-derived defaults.
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. Returns True on success.
func (*Context) UnbanChatSenderChat ¶
func (ctx *Context) UnbanChatSenderChat( senderChatID int64, opts ...UnbanChatSenderChatOption, ) error
UnbanChatSenderChat calls Client.UnbanChatSenderChat with context-derived defaults.
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. Returns True on success.
func (*Context) UnhideGeneralForumTopic ¶
func (ctx *Context) UnhideGeneralForumTopic( opts ...UnhideGeneralForumTopicOption, ) error
UnhideGeneralForumTopic calls Client.UnhideGeneralForumTopic with context-derived defaults.
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. Returns True on success.
func (*Context) UnpinAllChatMessages ¶
func (ctx *Context) UnpinAllChatMessages( opts ...UnpinAllChatMessagesOption, ) error
UnpinAllChatMessages calls Client.UnpinAllChatMessages with context-derived defaults.
Use this method to clear the list of pinned messages in a chat. In private chats and channel direct messages chats, no additional rights are required to unpin all pinned messages. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin all pinned messages in groups and channels respectively. Returns True on success.
func (*Context) UnpinAllForumTopicMessages ¶
func (ctx *Context) UnpinAllForumTopicMessages( messageThreadID int64, opts ...UnpinAllForumTopicMessagesOption, ) error
UnpinAllForumTopicMessages calls Client.UnpinAllForumTopicMessages with context-derived defaults.
Use this method to clear the list of pinned messages in a forum topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat 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. Returns True on success.
func (*Context) UnpinAllGeneralForumTopicMessages ¶
func (ctx *Context) UnpinAllGeneralForumTopicMessages( opts ...UnpinAllGeneralForumTopicMessagesOption, ) error
UnpinAllGeneralForumTopicMessages calls Client.UnpinAllGeneralForumTopicMessages with context-derived defaults.
Use this method to clear the list of pinned messages in a General 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. Returns True on success.
func (*Context) UnpinChatMessage ¶
func (ctx *Context) UnpinChatMessage( opts ...UnpinChatMessageOption, ) error
UnpinChatMessage calls Client.UnpinChatMessage with context-derived defaults.
Use this method to remove a message from the list of pinned messages in a chat. In private chats and channel direct messages chats, all messages can be unpinned. Conversely, the bot must be an administrator with the 'can_pin_messages' right or the 'can_edit_messages' right to unpin messages in groups and channels respectively. Returns True on success.
func (*Context) UpgradeGift ¶
func (ctx *Context) UpgradeGift( ownedGiftID string, opts ...UpgradeGiftOption, ) error
UpgradeGift calls Client.UpgradeGift with context-derived defaults.
Upgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid. Returns True on success.
func (*Context) UploadStickerFile ¶
func (ctx *Context) UploadStickerFile( userID int64, sticker InputFile, stickerFormat string, opts ...UploadStickerFileOption, ) error
UploadStickerFile calls Client.UploadStickerFile with context-derived defaults.
Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success.
func (*Context) Value ¶
Value returns the value associated with this context for key, or nil if no value is associated with key.
func (*Context) VerifyChat ¶
func (ctx *Context) VerifyChat( opts ...VerifyChatOption, ) error
VerifyChat calls Client.VerifyChat with context-derived defaults.
Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
func (*Context) VerifyUser ¶
func (ctx *Context) VerifyUser( userID int64, opts ...VerifyUserOption, ) error
VerifyUser calls Client.VerifyUser with context-derived defaults.
Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
type ConvertGiftToStarsOption ¶
type ConvertGiftToStarsOption func(params *ConvertGiftToStarsParams) ConvertGiftToStarsOption
ConvertGiftToStarsOption configures ConvertGiftToStarsParams.
func WithConvertGiftToStarsBusinessConnectionID ¶
func WithConvertGiftToStarsBusinessConnectionID(value string) ConvertGiftToStarsOption
WithConvertGiftToStarsBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithConvertGiftToStarsOwnedGiftID ¶
func WithConvertGiftToStarsOwnedGiftID(value string) ConvertGiftToStarsOption
WithConvertGiftToStarsOwnedGiftID sets the OwnedGiftID field.
Unique identifier of the regular gift that should be converted to Telegram Stars
type ConvertGiftToStarsParams ¶
type ConvertGiftToStarsParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the regular gift that should be converted to Telegram Stars
OwnedGiftID string `json:"owned_gift_id"`
}
ConvertGiftToStarsParams contains parameters for Client.ConvertGiftToStars.
func (*ConvertGiftToStarsParams) Option ¶
func (r *ConvertGiftToStarsParams) Option(opts ...ConvertGiftToStarsOption) (previous ConvertGiftToStarsOption)
Option applies one or more ConvertGiftToStarsOption values and returns the last rollback option.
type CopyMessageOption ¶
type CopyMessageOption func(params *CopyMessageParams) CopyMessageOption
CopyMessageOption configures CopyMessageParams.
func WithCopyMessageAllowPaidBroadcast ¶
func WithCopyMessageAllowPaidBroadcast(value bool) CopyMessageOption
WithCopyMessageAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithCopyMessageCaption ¶
func WithCopyMessageCaption(value string) CopyMessageOption
WithCopyMessageCaption sets the Caption field.
New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
func WithCopyMessageCaptionEntities ¶
func WithCopyMessageCaptionEntities(value []MessageEntity) CopyMessageOption
WithCopyMessageCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
func WithCopyMessageChatID ¶
func WithCopyMessageChatID(value string) CopyMessageOption
WithCopyMessageChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithCopyMessageDirectMessagesTopicID ¶
func WithCopyMessageDirectMessagesTopicID(value int64) CopyMessageOption
WithCopyMessageDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithCopyMessageDisableNotification ¶
func WithCopyMessageDisableNotification(value bool) CopyMessageOption
WithCopyMessageDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithCopyMessageFromChatID ¶
func WithCopyMessageFromChatID(value string) CopyMessageOption
WithCopyMessageFromChatID sets the FromChatID field.
Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
func WithCopyMessageMessageEffectID ¶
func WithCopyMessageMessageEffectID(value string) CopyMessageOption
WithCopyMessageMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; only available when copying to private chats
func WithCopyMessageMessageID ¶
func WithCopyMessageMessageID(value int64) CopyMessageOption
WithCopyMessageMessageID sets the MessageID field.
Message identifier in the chat specified in from_chat_id
func WithCopyMessageMessageThreadID ¶
func WithCopyMessageMessageThreadID(value int64) CopyMessageOption
WithCopyMessageMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithCopyMessageParseMode ¶
func WithCopyMessageParseMode(value string) CopyMessageOption
WithCopyMessageParseMode sets the ParseMode field.
Mode for parsing entities in the new caption. See formatting options for more details.
func WithCopyMessageProtectContent ¶
func WithCopyMessageProtectContent(value bool) CopyMessageOption
WithCopyMessageProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithCopyMessageReplyMarkup ¶
func WithCopyMessageReplyMarkup(value *ReplyMarkup) CopyMessageOption
WithCopyMessageReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithCopyMessageReplyParameters ¶
func WithCopyMessageReplyParameters(value *ReplyParameters) CopyMessageOption
WithCopyMessageReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithCopyMessageShowCaptionAboveMedia ¶
func WithCopyMessageShowCaptionAboveMedia(value bool) CopyMessageOption
WithCopyMessageShowCaptionAboveMedia sets the ShowCaptionAboveMedia field.
Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.
func WithCopyMessageSuggestedPostParameters ¶
func WithCopyMessageSuggestedPostParameters(value *SuggestedPostParameters) CopyMessageOption
WithCopyMessageSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithCopyMessageVideoStartTimestamp ¶
func WithCopyMessageVideoStartTimestamp(value int64) CopyMessageOption
WithCopyMessageVideoStartTimestamp sets the VideoStartTimestamp field.
New start timestamp for the copied video in the message
type CopyMessageParams ¶
type CopyMessageParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
FromChatID string `json:"from_chat_id"`
// Message identifier in the chat specified in from_chat_id
MessageID int64 `json:"message_id"`
// New start timestamp for the copied video in the message
VideoStartTimestamp int64 `json:"video_start_timestamp,omitempty"`
// New caption for media, 0-1024 characters after entities parsing.
// If not specified, the original caption is kept
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the new caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media.
// Ignored if a new caption isn't specified.
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; only available when copying to private chats
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
CopyMessageParams contains parameters for Client.CopyMessage.
func (*CopyMessageParams) Option ¶
func (r *CopyMessageParams) Option(opts ...CopyMessageOption) (previous CopyMessageOption)
Option applies one or more CopyMessageOption values and returns the last rollback option.
type CopyMessagesOption ¶
type CopyMessagesOption func(params *CopyMessagesParams) CopyMessagesOption
CopyMessagesOption configures CopyMessagesParams.
func WithCopyMessagesChatID ¶
func WithCopyMessagesChatID(value string) CopyMessagesOption
WithCopyMessagesChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithCopyMessagesDirectMessagesTopicID ¶
func WithCopyMessagesDirectMessagesTopicID(value int64) CopyMessagesOption
WithCopyMessagesDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
func WithCopyMessagesDisableNotification ¶
func WithCopyMessagesDisableNotification(value bool) CopyMessagesOption
WithCopyMessagesDisableNotification sets the DisableNotification field.
Sends the messages silently. Users will receive a notification with no sound.
func WithCopyMessagesFromChatID ¶
func WithCopyMessagesFromChatID(value string) CopyMessagesOption
WithCopyMessagesFromChatID sets the FromChatID field.
Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
func WithCopyMessagesMessageIDs ¶
func WithCopyMessagesMessageIDs(value []int64) CopyMessagesOption
WithCopyMessagesMessageIDs sets the MessageIDs field.
A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
func WithCopyMessagesMessageThreadID ¶
func WithCopyMessagesMessageThreadID(value int64) CopyMessagesOption
WithCopyMessagesMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithCopyMessagesProtectContent ¶
func WithCopyMessagesProtectContent(value bool) CopyMessagesOption
WithCopyMessagesProtectContent sets the ProtectContent field.
Protects the contents of the sent messages from forwarding and saving
func WithCopyMessagesRemoveCaption ¶
func WithCopyMessagesRemoveCaption(value bool) CopyMessagesOption
WithCopyMessagesRemoveCaption sets the RemoveCaption field.
Pass True to copy the messages without their captions
type CopyMessagesParams ¶
type CopyMessagesParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
FromChatID string `json:"from_chat_id"`
// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy.
// The identifiers must be specified in a strictly increasing order.
MessageIDs []int64 `json:"message_ids"`
// Sends the messages [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent messages from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to copy the messages without their captions
RemoveCaption bool `json:"remove_caption,omitempty"`
}
CopyMessagesParams contains parameters for Client.CopyMessages.
func (*CopyMessagesParams) Option ¶
func (r *CopyMessagesParams) Option(opts ...CopyMessagesOption) (previous CopyMessagesOption)
Option applies one or more CopyMessagesOption values and returns the last rollback option.
type CopyTextButton ¶
type CopyTextButton struct {
// The text to be copied to the clipboard; 1-256 characters
Text string `json:"text"`
}
CopyTextButton
This object represents an inline keyboard button that copies specified text to the clipboard.
type CreateChatInviteLinkOption ¶
type CreateChatInviteLinkOption func(params *CreateChatInviteLinkParams) CreateChatInviteLinkOption
CreateChatInviteLinkOption configures CreateChatInviteLinkParams.
func WithCreateChatInviteLinkChatID ¶
func WithCreateChatInviteLinkChatID(value string) CreateChatInviteLinkOption
WithCreateChatInviteLinkChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithCreateChatInviteLinkCreatesJoinRequest ¶
func WithCreateChatInviteLinkCreatesJoinRequest(value bool) CreateChatInviteLinkOption
WithCreateChatInviteLinkCreatesJoinRequest sets the CreatesJoinRequest field.
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 WithCreateChatInviteLinkExpireDate ¶
func WithCreateChatInviteLinkExpireDate(value int64) CreateChatInviteLinkOption
WithCreateChatInviteLinkExpireDate sets the ExpireDate field.
Point in time (Unix timestamp) when the link will expire
func WithCreateChatInviteLinkMemberLimit ¶
func WithCreateChatInviteLinkMemberLimit(value int64) CreateChatInviteLinkOption
WithCreateChatInviteLinkMemberLimit sets the MemberLimit field.
The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
func WithCreateChatInviteLinkName ¶
func WithCreateChatInviteLinkName(value string) CreateChatInviteLinkOption
WithCreateChatInviteLinkName sets the Name field.
Invite link name; 0-32 characters
type CreateChatInviteLinkParams ¶
type CreateChatInviteLinkParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Invite link name; 0-32 characters
Name string `json:"name,omitempty"`
// Point in time (Unix timestamp) when the link will expire
ExpireDate int64 `json:"expire_date,omitempty"`
// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
MemberLimit int64 `json:"member_limit,omitempty"`
// True, if users joining the chat via the link need to be approved by chat administrators.
// If True, member_limit can't be specified
CreatesJoinRequest bool `json:"creates_join_request,omitempty"`
}
CreateChatInviteLinkParams contains parameters for Client.CreateChatInviteLink.
func (*CreateChatInviteLinkParams) Option ¶
func (r *CreateChatInviteLinkParams) Option(opts ...CreateChatInviteLinkOption) (previous CreateChatInviteLinkOption)
Option applies one or more CreateChatInviteLinkOption values and returns the last rollback option.
type CreateChatSubscriptionInviteLinkOption ¶
type CreateChatSubscriptionInviteLinkOption func(params *CreateChatSubscriptionInviteLinkParams) CreateChatSubscriptionInviteLinkOption
CreateChatSubscriptionInviteLinkOption configures CreateChatSubscriptionInviteLinkParams.
func WithCreateChatSubscriptionInviteLinkChatID ¶
func WithCreateChatSubscriptionInviteLinkChatID(value string) CreateChatSubscriptionInviteLinkOption
WithCreateChatSubscriptionInviteLinkChatID sets the ChatID field.
Unique identifier for the target channel chat or username of the target channel (in the format @channelusername)
func WithCreateChatSubscriptionInviteLinkName ¶
func WithCreateChatSubscriptionInviteLinkName(value string) CreateChatSubscriptionInviteLinkOption
WithCreateChatSubscriptionInviteLinkName sets the Name field.
Invite link name; 0-32 characters
func WithCreateChatSubscriptionInviteLinkSubscriptionPeriod ¶
func WithCreateChatSubscriptionInviteLinkSubscriptionPeriod(value int64) CreateChatSubscriptionInviteLinkOption
WithCreateChatSubscriptionInviteLinkSubscriptionPeriod sets the SubscriptionPeriod field.
The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
func WithCreateChatSubscriptionInviteLinkSubscriptionPrice ¶
func WithCreateChatSubscriptionInviteLinkSubscriptionPrice(value int64) CreateChatSubscriptionInviteLinkOption
WithCreateChatSubscriptionInviteLinkSubscriptionPrice sets the SubscriptionPrice field.
The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000
type CreateChatSubscriptionInviteLinkParams ¶
type CreateChatSubscriptionInviteLinkParams struct {
// Unique identifier for the target channel chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Invite link name; 0-32 characters
Name string `json:"name,omitempty"`
// The number of seconds the subscription will be active for before the next payment.
// Currently, it must always be 2592000 (30 days).
SubscriptionPeriod int64 `json:"subscription_period"`
// The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000
SubscriptionPrice int64 `json:"subscription_price"`
}
CreateChatSubscriptionInviteLinkParams contains parameters for Client.CreateChatSubscriptionInviteLink.
func (*CreateChatSubscriptionInviteLinkParams) Option ¶
func (r *CreateChatSubscriptionInviteLinkParams) Option(opts ...CreateChatSubscriptionInviteLinkOption) (previous CreateChatSubscriptionInviteLinkOption)
Option applies one or more CreateChatSubscriptionInviteLinkOption values and returns the last rollback option.
type CreateForumTopicOption ¶
type CreateForumTopicOption func(params *CreateForumTopicParams) CreateForumTopicOption
CreateForumTopicOption configures CreateForumTopicParams.
func WithCreateForumTopicChatID ¶
func WithCreateForumTopicChatID(value string) CreateForumTopicOption
WithCreateForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithCreateForumTopicIconColor ¶
func WithCreateForumTopicIconColor(value int64) CreateForumTopicOption
WithCreateForumTopicIconColor sets the IconColor field.
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 WithCreateForumTopicIconCustomEmojiID ¶
func WithCreateForumTopicIconCustomEmojiID(value string) CreateForumTopicOption
WithCreateForumTopicIconCustomEmojiID sets the IconCustomEmojiID field.
Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers.
func WithCreateForumTopicName ¶
func WithCreateForumTopicName(value string) CreateForumTopicOption
WithCreateForumTopicName sets the Name field.
Topic name, 1-128 characters
type CreateForumTopicParams ¶
type CreateForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Topic name, 1-128 characters
Name string `json:"name"`
// 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)
IconColor int64 `json:"icon_color,omitempty"`
// Unique identifier of the custom emoji shown as the topic icon.
// Use [getForumTopicIconStickers] to get all allowed custom emoji identifiers.
//
// [getForumTopicIconStickers]: https://core.telegram.org/bots/api#getforumtopiciconstickers
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
}
CreateForumTopicParams contains parameters for Client.CreateForumTopic.
func (*CreateForumTopicParams) Option ¶
func (r *CreateForumTopicParams) Option(opts ...CreateForumTopicOption) (previous CreateForumTopicOption)
Option applies one or more CreateForumTopicOption values and returns the last rollback option.
type CreateInvoiceLinkOption ¶
type CreateInvoiceLinkOption func(params *CreateInvoiceLinkParams) CreateInvoiceLinkOption
CreateInvoiceLinkOption configures CreateInvoiceLinkParams.
func WithCreateInvoiceLinkBusinessConnectionID ¶
func WithCreateInvoiceLinkBusinessConnectionID(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only.
func WithCreateInvoiceLinkCurrency ¶
func WithCreateInvoiceLinkCurrency(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkCurrency sets the Currency field.
Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
func WithCreateInvoiceLinkDescription ¶
func WithCreateInvoiceLinkDescription(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkDescription sets the Description field.
Product description, 1-255 characters
func WithCreateInvoiceLinkIsFlexible ¶
func WithCreateInvoiceLinkIsFlexible(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkIsFlexible sets the IsFlexible field.
Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkMaxTipAmount ¶
func WithCreateInvoiceLinkMaxTipAmount(value int64) CreateInvoiceLinkOption
WithCreateInvoiceLinkMaxTipAmount sets the MaxTipAmount field.
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. Not supported for payments in Telegram Stars.
func WithCreateInvoiceLinkNeedEmail ¶
func WithCreateInvoiceLinkNeedEmail(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkNeedEmail sets the NeedEmail field.
Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkNeedName ¶
func WithCreateInvoiceLinkNeedName(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkNeedName sets the NeedName field.
Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkNeedPhoneNumber ¶
func WithCreateInvoiceLinkNeedPhoneNumber(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkNeedPhoneNumber sets the NeedPhoneNumber field.
Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkNeedShippingAddress ¶
func WithCreateInvoiceLinkNeedShippingAddress(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkNeedShippingAddress sets the NeedShippingAddress field.
Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkPayload ¶
func WithCreateInvoiceLinkPayload(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkPayload sets the Payload field.
Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
func WithCreateInvoiceLinkPhotoHeight ¶
func WithCreateInvoiceLinkPhotoHeight(value int64) CreateInvoiceLinkOption
WithCreateInvoiceLinkPhotoHeight sets the PhotoHeight field.
Photo height
func WithCreateInvoiceLinkPhotoSize ¶
func WithCreateInvoiceLinkPhotoSize(value int64) CreateInvoiceLinkOption
WithCreateInvoiceLinkPhotoSize sets the PhotoSize field.
Photo size in bytes
func WithCreateInvoiceLinkPhotoUrl ¶
func WithCreateInvoiceLinkPhotoUrl(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkPhotoUrl sets the PhotoUrl field.
URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
func WithCreateInvoiceLinkPhotoWidth ¶
func WithCreateInvoiceLinkPhotoWidth(value int64) CreateInvoiceLinkOption
WithCreateInvoiceLinkPhotoWidth sets the PhotoWidth field.
Photo width
func WithCreateInvoiceLinkPrices ¶
func WithCreateInvoiceLinkPrices(value []LabeledPrice) CreateInvoiceLinkOption
WithCreateInvoiceLinkPrices sets the Prices field.
Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
func WithCreateInvoiceLinkProviderData ¶
func WithCreateInvoiceLinkProviderData(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkProviderData sets the ProviderData field.
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 WithCreateInvoiceLinkProviderToken ¶
func WithCreateInvoiceLinkProviderToken(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkProviderToken sets the ProviderToken field.
Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
func WithCreateInvoiceLinkSendEmailToProvider ¶
func WithCreateInvoiceLinkSendEmailToProvider(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkSendEmailToProvider sets the SendEmailToProvider field.
Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkSendPhoneNumberToProvider ¶
func WithCreateInvoiceLinkSendPhoneNumberToProvider(value bool) CreateInvoiceLinkOption
WithCreateInvoiceLinkSendPhoneNumberToProvider sets the SendPhoneNumberToProvider field.
Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
func WithCreateInvoiceLinkSubscriptionPeriod ¶
func WithCreateInvoiceLinkSubscriptionPeriod(value int64) CreateInvoiceLinkOption
WithCreateInvoiceLinkSubscriptionPeriod sets the SubscriptionPeriod field.
The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 10000 Telegram Stars.
func WithCreateInvoiceLinkSuggestedTipAmounts ¶
func WithCreateInvoiceLinkSuggestedTipAmounts(value []int64) CreateInvoiceLinkOption
WithCreateInvoiceLinkSuggestedTipAmounts sets the SuggestedTipAmounts field.
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 WithCreateInvoiceLinkTitle ¶
func WithCreateInvoiceLinkTitle(value string) CreateInvoiceLinkOption
WithCreateInvoiceLinkTitle sets the Title field.
Product name, 1-32 characters
type CreateInvoiceLinkParams ¶
type CreateInvoiceLinkParams struct {
// Unique identifier of the business connection on behalf of which the link will be created.
// For payments in [Telegram Stars] only.
//
// [Telegram Stars]: https://t.me/BotNews/90
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// 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 it for your internal processes.
Payload string `json:"payload"`
// Payment provider token, obtained via [@BotFather].
// Pass an empty string for payments in [Telegram Stars].
//
// [@BotFather]: https://t.me/botfather
// [Telegram Stars]: https://t.me/BotNews/90
ProviderToken string `json:"provider_token,omitempty"`
// Three-letter ISO 4217 currency code, see [more on currencies].
// Pass “XTR” for payments in [Telegram Stars].
//
// [more on currencies]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
Currency string `json:"currency"`
// Price breakdown, a JSON-serialized list of components (e.g.
// product price, tax, discount, delivery cost, delivery tax, bonus, etc.).
// Must contain exactly one item for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
Prices []LabeledPrice `json:"prices"`
// The number of seconds the subscription will be active for before the next payment.
// The currency must be set to “XTR” (Telegram Stars) if the parameter is used.
// Currently, it must always be 2592000 (30 days) if specified.
// Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user.
// Subscription price must no exceed 10000 Telegram Stars.
SubscriptionPeriod int64 `json:"subscription_period,omitempty"`
// 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.
// Not supported for payments in [Telegram Stars].
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
// [Telegram Stars]: https://t.me/BotNews/90
MaxTipAmount int64 `json:"max_tip_amount,omitempty"`
// 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.
SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"`
// JSON-serialized data about the invoice, which will be shared with the payment provider.
// A detailed description of required fields should be provided by the payment provider.
ProviderData string `json:"provider_data,omitempty"`
// 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"`
// Photo size in bytes
PhotoSize int64 `json:"photo_size,omitempty"`
// Photo width
PhotoWidth int64 `json:"photo_width,omitempty"`
// Photo height
PhotoHeight int64 `json:"photo_height,omitempty"`
// Pass True if you require the user's full name to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedName bool `json:"need_name,omitempty"`
// Pass True if you require the user's phone number to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedPhoneNumber bool `json:"need_phone_number,omitempty"`
// Pass True if you require the user's email address to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedEmail bool `json:"need_email,omitempty"`
// Pass True if you require the user's shipping address to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedShippingAddress bool `json:"need_shipping_address,omitempty"`
// Pass True if the user's phone number should be sent to the provider.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"`
// Pass True if the user's email address should be sent to the provider.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
SendEmailToProvider bool `json:"send_email_to_provider,omitempty"`
// Pass True if the final price depends on the shipping method.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
IsFlexible bool `json:"is_flexible,omitempty"`
}
CreateInvoiceLinkParams contains parameters for Client.CreateInvoiceLink.
func (*CreateInvoiceLinkParams) Option ¶
func (r *CreateInvoiceLinkParams) Option(opts ...CreateInvoiceLinkOption) (previous CreateInvoiceLinkOption)
Option applies one or more CreateInvoiceLinkOption values and returns the last rollback option.
type CreateNewStickerSetOption ¶
type CreateNewStickerSetOption func(params *CreateNewStickerSetParams) CreateNewStickerSetOption
CreateNewStickerSetOption configures CreateNewStickerSetParams.
func WithCreateNewStickerSetName ¶
func WithCreateNewStickerSetName(value string) CreateNewStickerSetOption
WithCreateNewStickerSetName sets the Name field.
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 WithCreateNewStickerSetNeedsRepainting ¶
func WithCreateNewStickerSetNeedsRepainting(value bool) CreateNewStickerSetOption
WithCreateNewStickerSetNeedsRepainting sets the NeedsRepainting field.
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 WithCreateNewStickerSetStickerType ¶
func WithCreateNewStickerSetStickerType(value string) CreateNewStickerSetOption
WithCreateNewStickerSetStickerType sets the StickerType field.
Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.
func WithCreateNewStickerSetStickers ¶
func WithCreateNewStickerSetStickers(value []InputSticker) CreateNewStickerSetOption
WithCreateNewStickerSetStickers sets the Stickers field.
A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
func WithCreateNewStickerSetTitle ¶
func WithCreateNewStickerSetTitle(value string) CreateNewStickerSetOption
WithCreateNewStickerSetTitle sets the Title field.
Sticker set title, 1-64 characters
func WithCreateNewStickerSetUserID ¶
func WithCreateNewStickerSetUserID(value int64) CreateNewStickerSetOption
WithCreateNewStickerSetUserID sets the UserID field.
User identifier of created sticker set owner
type CreateNewStickerSetParams ¶
type CreateNewStickerSetParams struct {
// User identifier of created sticker set owner
UserID int64 `json:"user_id"`
// 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.
Name string `json:"name"`
// Sticker set title, 1-64 characters
Title string `json:"title"`
// A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
Stickers []InputSticker `json:"stickers"`
// Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”.
// By default, a regular sticker set is created.
StickerType string `json:"sticker_type,omitempty"`
// 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
NeedsRepainting bool `json:"needs_repainting,omitempty"`
}
CreateNewStickerSetParams contains parameters for Client.CreateNewStickerSet.
func (*CreateNewStickerSetParams) Option ¶
func (r *CreateNewStickerSetParams) Option(opts ...CreateNewStickerSetOption) (previous CreateNewStickerSetOption)
Option applies one or more CreateNewStickerSetOption values and returns the last rollback option.
type DeclineChatJoinRequestOption ¶
type DeclineChatJoinRequestOption func(params *DeclineChatJoinRequestParams) DeclineChatJoinRequestOption
DeclineChatJoinRequestOption configures DeclineChatJoinRequestParams.
func WithDeclineChatJoinRequestChatID ¶
func WithDeclineChatJoinRequestChatID(value string) DeclineChatJoinRequestOption
WithDeclineChatJoinRequestChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithDeclineChatJoinRequestUserID ¶
func WithDeclineChatJoinRequestUserID(value int64) DeclineChatJoinRequestOption
WithDeclineChatJoinRequestUserID sets the UserID field.
Unique identifier of the target user
type DeclineChatJoinRequestParams ¶
type DeclineChatJoinRequestParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
}
DeclineChatJoinRequestParams contains parameters for Client.DeclineChatJoinRequest.
func (*DeclineChatJoinRequestParams) Option ¶
func (r *DeclineChatJoinRequestParams) Option(opts ...DeclineChatJoinRequestOption) (previous DeclineChatJoinRequestOption)
Option applies one or more DeclineChatJoinRequestOption values and returns the last rollback option.
type DeclineSuggestedPostOption ¶
type DeclineSuggestedPostOption func(params *DeclineSuggestedPostParams) DeclineSuggestedPostOption
DeclineSuggestedPostOption configures DeclineSuggestedPostParams.
func WithDeclineSuggestedPostChatID ¶
func WithDeclineSuggestedPostChatID(value int64) DeclineSuggestedPostOption
WithDeclineSuggestedPostChatID sets the ChatID field.
Unique identifier for the target direct messages chat
func WithDeclineSuggestedPostComment ¶
func WithDeclineSuggestedPostComment(value string) DeclineSuggestedPostOption
WithDeclineSuggestedPostComment sets the Comment field.
Comment for the creator of the suggested post; 0-128 characters
func WithDeclineSuggestedPostMessageID ¶
func WithDeclineSuggestedPostMessageID(value int64) DeclineSuggestedPostOption
WithDeclineSuggestedPostMessageID sets the MessageID field.
Identifier of a suggested post message to decline
type DeclineSuggestedPostParams ¶
type DeclineSuggestedPostParams struct {
// Unique identifier for the target direct messages chat
ChatID int64 `json:"chat_id"`
// Identifier of a suggested post message to decline
MessageID int64 `json:"message_id"`
// Comment for the creator of the suggested post; 0-128 characters
Comment string `json:"comment,omitempty"`
}
DeclineSuggestedPostParams contains parameters for Client.DeclineSuggestedPost.
func (*DeclineSuggestedPostParams) Option ¶
func (r *DeclineSuggestedPostParams) Option(opts ...DeclineSuggestedPostOption) (previous DeclineSuggestedPostOption)
Option applies one or more DeclineSuggestedPostOption values and returns the last rollback option.
type DeleteBusinessMessagesOption ¶
type DeleteBusinessMessagesOption func(params *DeleteBusinessMessagesParams) DeleteBusinessMessagesOption
DeleteBusinessMessagesOption configures DeleteBusinessMessagesParams.
func WithDeleteBusinessMessagesBusinessConnectionID ¶
func WithDeleteBusinessMessagesBusinessConnectionID(value string) DeleteBusinessMessagesOption
WithDeleteBusinessMessagesBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which to delete the messages
func WithDeleteBusinessMessagesMessageIDs ¶
func WithDeleteBusinessMessagesMessageIDs(value []int64) DeleteBusinessMessagesOption
WithDeleteBusinessMessagesMessageIDs sets the MessageIDs field.
A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted
type DeleteBusinessMessagesParams ¶
type DeleteBusinessMessagesParams struct {
// Unique identifier of the business connection on behalf of which to delete the messages
BusinessConnectionID string `json:"business_connection_id"`
// A JSON-serialized list of 1-100 identifiers of messages to delete.
// All messages must be from the same chat.
// See [deleteMessage] for limitations on which messages can be deleted
//
// [deleteMessage]: https://core.telegram.org/bots/api#deletemessage
MessageIDs []int64 `json:"message_ids"`
}
DeleteBusinessMessagesParams contains parameters for Client.DeleteBusinessMessages.
func (*DeleteBusinessMessagesParams) Option ¶
func (r *DeleteBusinessMessagesParams) Option(opts ...DeleteBusinessMessagesOption) (previous DeleteBusinessMessagesOption)
Option applies one or more DeleteBusinessMessagesOption values and returns the last rollback option.
type DeleteChatPhotoOption ¶
type DeleteChatPhotoOption func(params *DeleteChatPhotoParams) DeleteChatPhotoOption
DeleteChatPhotoOption configures DeleteChatPhotoParams.
func WithDeleteChatPhotoChatID ¶
func WithDeleteChatPhotoChatID(value string) DeleteChatPhotoOption
WithDeleteChatPhotoChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type DeleteChatPhotoParams ¶
type DeleteChatPhotoParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
DeleteChatPhotoParams contains parameters for Client.DeleteChatPhoto.
func (*DeleteChatPhotoParams) Option ¶
func (r *DeleteChatPhotoParams) Option(opts ...DeleteChatPhotoOption) (previous DeleteChatPhotoOption)
Option applies one or more DeleteChatPhotoOption values and returns the last rollback option.
type DeleteChatStickerSetOption ¶
type DeleteChatStickerSetOption func(params *DeleteChatStickerSetParams) DeleteChatStickerSetOption
DeleteChatStickerSetOption configures DeleteChatStickerSetParams.
func WithDeleteChatStickerSetChatID ¶
func WithDeleteChatStickerSetChatID(value string) DeleteChatStickerSetOption
WithDeleteChatStickerSetChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type DeleteChatStickerSetParams ¶
type DeleteChatStickerSetParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
}
DeleteChatStickerSetParams contains parameters for Client.DeleteChatStickerSet.
func (*DeleteChatStickerSetParams) Option ¶
func (r *DeleteChatStickerSetParams) Option(opts ...DeleteChatStickerSetOption) (previous DeleteChatStickerSetOption)
Option applies one or more DeleteChatStickerSetOption values and returns the last rollback option.
type DeleteForumTopicOption ¶
type DeleteForumTopicOption func(params *DeleteForumTopicParams) DeleteForumTopicOption
DeleteForumTopicOption configures DeleteForumTopicParams.
func WithDeleteForumTopicChatID ¶
func WithDeleteForumTopicChatID(value string) DeleteForumTopicOption
WithDeleteForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithDeleteForumTopicMessageThreadID ¶
func WithDeleteForumTopicMessageThreadID(value int64) DeleteForumTopicOption
WithDeleteForumTopicMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread of the forum topic
type DeleteForumTopicParams ¶
type DeleteForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread of the forum topic
MessageThreadID int64 `json:"message_thread_id"`
}
DeleteForumTopicParams contains parameters for Client.DeleteForumTopic.
func (*DeleteForumTopicParams) Option ¶
func (r *DeleteForumTopicParams) Option(opts ...DeleteForumTopicOption) (previous DeleteForumTopicOption)
Option applies one or more DeleteForumTopicOption values and returns the last rollback option.
type DeleteMessageOption ¶
type DeleteMessageOption func(params *DeleteMessageParams) DeleteMessageOption
DeleteMessageOption configures DeleteMessageParams.
func WithDeleteMessageChatID ¶
func WithDeleteMessageChatID(value string) DeleteMessageOption
WithDeleteMessageChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithDeleteMessageMessageID ¶
func WithDeleteMessageMessageID(value int64) DeleteMessageOption
WithDeleteMessageMessageID sets the MessageID field.
Identifier of the message to delete
type DeleteMessageParams ¶
type DeleteMessageParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Identifier of the message to delete
MessageID int64 `json:"message_id"`
}
DeleteMessageParams contains parameters for Client.DeleteMessage.
func (*DeleteMessageParams) Option ¶
func (r *DeleteMessageParams) Option(opts ...DeleteMessageOption) (previous DeleteMessageOption)
Option applies one or more DeleteMessageOption values and returns the last rollback option.
type DeleteMessagesOption ¶
type DeleteMessagesOption func(params *DeleteMessagesParams) DeleteMessagesOption
DeleteMessagesOption configures DeleteMessagesParams.
func WithDeleteMessagesChatID ¶
func WithDeleteMessagesChatID(value string) DeleteMessagesOption
WithDeleteMessagesChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithDeleteMessagesMessageIDs ¶
func WithDeleteMessagesMessageIDs(value []int64) DeleteMessagesOption
WithDeleteMessagesMessageIDs sets the MessageIDs field.
A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted
type DeleteMessagesParams ¶
type DeleteMessagesParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// A JSON-serialized list of 1-100 identifiers of messages to delete.
// See [deleteMessage] for limitations on which messages can be deleted
//
// [deleteMessage]: https://core.telegram.org/bots/api#deletemessage
MessageIDs []int64 `json:"message_ids"`
}
DeleteMessagesParams contains parameters for Client.DeleteMessages.
func (*DeleteMessagesParams) Option ¶
func (r *DeleteMessagesParams) Option(opts ...DeleteMessagesOption) (previous DeleteMessagesOption)
Option applies one or more DeleteMessagesOption values and returns the last rollback option.
type DeleteMyCommandsOption ¶
type DeleteMyCommandsOption func(params *DeleteMyCommandsParams) DeleteMyCommandsOption
DeleteMyCommandsOption configures DeleteMyCommandsParams.
func WithDeleteMyCommandsLanguageCode ¶
func WithDeleteMyCommandsLanguageCode(value string) DeleteMyCommandsOption
WithDeleteMyCommandsLanguageCode sets the LanguageCode field.
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 WithDeleteMyCommandsScope ¶
func WithDeleteMyCommandsScope(value *BotCommandScope) DeleteMyCommandsOption
WithDeleteMyCommandsScope sets the Scope field.
A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
type DeleteMyCommandsParams ¶
type DeleteMyCommandsParams struct {
// A JSON-serialized object, describing scope of users for which the commands are relevant.
// Defaults to [BotCommandScopeDefault].
//
// [BotCommandScopeDefault]: https://core.telegram.org/bots/api#botcommandscopedefault
Scope *BotCommandScope `json:"scope,omitempty"`
// 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
LanguageCode string `json:"language_code,omitempty"`
}
DeleteMyCommandsParams contains parameters for Client.DeleteMyCommands.
func (*DeleteMyCommandsParams) Option ¶
func (r *DeleteMyCommandsParams) Option(opts ...DeleteMyCommandsOption) (previous DeleteMyCommandsOption)
Option applies one or more DeleteMyCommandsOption values and returns the last rollback option.
type DeleteStickerFromSetOption ¶
type DeleteStickerFromSetOption func(params *DeleteStickerFromSetParams) DeleteStickerFromSetOption
DeleteStickerFromSetOption configures DeleteStickerFromSetParams.
func WithDeleteStickerFromSetSticker ¶
func WithDeleteStickerFromSetSticker(value string) DeleteStickerFromSetOption
WithDeleteStickerFromSetSticker sets the Sticker field.
File identifier of the sticker
type DeleteStickerFromSetParams ¶
type DeleteStickerFromSetParams struct {
// File identifier of the sticker
Sticker string `json:"sticker"`
}
DeleteStickerFromSetParams contains parameters for Client.DeleteStickerFromSet.
func (*DeleteStickerFromSetParams) Option ¶
func (r *DeleteStickerFromSetParams) Option(opts ...DeleteStickerFromSetOption) (previous DeleteStickerFromSetOption)
Option applies one or more DeleteStickerFromSetOption values and returns the last rollback option.
type DeleteStickerSetOption ¶
type DeleteStickerSetOption func(params *DeleteStickerSetParams) DeleteStickerSetOption
DeleteStickerSetOption configures DeleteStickerSetParams.
func WithDeleteStickerSetName ¶
func WithDeleteStickerSetName(value string) DeleteStickerSetOption
WithDeleteStickerSetName sets the Name field.
Sticker set name
type DeleteStickerSetParams ¶
type DeleteStickerSetParams struct {
// Sticker set name
Name string `json:"name"`
}
DeleteStickerSetParams contains parameters for Client.DeleteStickerSet.
func (*DeleteStickerSetParams) Option ¶
func (r *DeleteStickerSetParams) Option(opts ...DeleteStickerSetOption) (previous DeleteStickerSetOption)
Option applies one or more DeleteStickerSetOption values and returns the last rollback option.
type DeleteStoryOption ¶
type DeleteStoryOption func(params *DeleteStoryParams) DeleteStoryOption
DeleteStoryOption configures DeleteStoryParams.
func WithDeleteStoryBusinessConnectionID ¶
func WithDeleteStoryBusinessConnectionID(value string) DeleteStoryOption
WithDeleteStoryBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithDeleteStoryStoryID ¶
func WithDeleteStoryStoryID(value int64) DeleteStoryOption
WithDeleteStoryStoryID sets the StoryID field.
Unique identifier of the story to delete
type DeleteStoryParams ¶
type DeleteStoryParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the story to delete
StoryID int64 `json:"story_id"`
}
DeleteStoryParams contains parameters for Client.DeleteStory.
func (*DeleteStoryParams) Option ¶
func (r *DeleteStoryParams) Option(opts ...DeleteStoryOption) (previous DeleteStoryOption)
Option applies one or more DeleteStoryOption values and returns the last rollback option.
type DeleteWebhookOption ¶
type DeleteWebhookOption func(params *DeleteWebhookParams) DeleteWebhookOption
DeleteWebhookOption configures DeleteWebhookParams.
func WithDeleteWebhookDropPendingUpdates ¶
func WithDeleteWebhookDropPendingUpdates(value bool) DeleteWebhookOption
WithDeleteWebhookDropPendingUpdates sets the DropPendingUpdates field.
Pass True to drop all pending updates
type DeleteWebhookParams ¶
type DeleteWebhookParams struct {
// Pass True to drop all pending updates
DropPendingUpdates bool `json:"drop_pending_updates,omitempty"`
}
DeleteWebhookParams contains parameters for Client.DeleteWebhook.
func (*DeleteWebhookParams) Option ¶
func (r *DeleteWebhookParams) Option(opts ...DeleteWebhookOption) (previous DeleteWebhookOption)
Option applies one or more DeleteWebhookOption values and returns the last rollback option.
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 int64 `json:"value"`
}
Dice
This object represents an animated emoji that displays a random value.
type DirectMessagePriceChanged ¶
type DirectMessagePriceChanged struct {
// True, if direct messages are enabled for the channel chat; false otherwise
AreDirectMessagesEnabled bool `json:"are_direct_messages_enabled"`
// Optional.
// The new number of Telegram Stars that must be paid by users for each direct message sent to the channel.
// Does not apply to users who have been exempted by administrators.
// Defaults to 0.
DirectMessageStarCount int64 `json:"direct_message_star_count,omitempty"`
}
DirectMessagePriceChanged
Describes a service message about a change in the price of direct messages sent to a channel chat.
type DirectMessagesTopic ¶
type DirectMessagesTopic struct {
// Unique identifier of the topic.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
TopicID int64 `json:"topic_id"`
// Optional.
// Information about the user that created the topic.
// Currently, it is always present
User *User `json:"user,omitempty"`
}
DirectMessagesTopic
Describes a topic of a direct messages chat.
type Document ¶
type Document 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"`
// Optional.
// Document thumbnail as defined by the sender
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
// Optional.
// Original filename as defined by the sender
FileName string `json:"file_name,omitempty"`
// Optional.
// MIME type of the file as defined by the sender
MimeType string `json:"mime_type,omitempty"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
FileSize int64 `json:"file_size,omitempty"`
}
Document
This object represents a general file (as opposed to photos, voice messages and audio files).
type EditChatInviteLinkOption ¶
type EditChatInviteLinkOption func(params *EditChatInviteLinkParams) EditChatInviteLinkOption
EditChatInviteLinkOption configures EditChatInviteLinkParams.
func WithEditChatInviteLinkChatID ¶
func WithEditChatInviteLinkChatID(value string) EditChatInviteLinkOption
WithEditChatInviteLinkChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithEditChatInviteLinkCreatesJoinRequest ¶
func WithEditChatInviteLinkCreatesJoinRequest(value bool) EditChatInviteLinkOption
WithEditChatInviteLinkCreatesJoinRequest sets the CreatesJoinRequest field.
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 WithEditChatInviteLinkExpireDate ¶
func WithEditChatInviteLinkExpireDate(value int64) EditChatInviteLinkOption
WithEditChatInviteLinkExpireDate sets the ExpireDate field.
Point in time (Unix timestamp) when the link will expire
func WithEditChatInviteLinkInviteLink ¶
func WithEditChatInviteLinkInviteLink(value string) EditChatInviteLinkOption
WithEditChatInviteLinkInviteLink sets the InviteLink field.
The invite link to edit
func WithEditChatInviteLinkMemberLimit ¶
func WithEditChatInviteLinkMemberLimit(value int64) EditChatInviteLinkOption
WithEditChatInviteLinkMemberLimit sets the MemberLimit field.
The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
func WithEditChatInviteLinkName ¶
func WithEditChatInviteLinkName(value string) EditChatInviteLinkOption
WithEditChatInviteLinkName sets the Name field.
Invite link name; 0-32 characters
type EditChatInviteLinkParams ¶
type EditChatInviteLinkParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// The invite link to edit
InviteLink string `json:"invite_link"`
// Invite link name; 0-32 characters
Name string `json:"name,omitempty"`
// Point in time (Unix timestamp) when the link will expire
ExpireDate int64 `json:"expire_date,omitempty"`
// The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
MemberLimit int64 `json:"member_limit,omitempty"`
// True, if users joining the chat via the link need to be approved by chat administrators.
// If True, member_limit can't be specified
CreatesJoinRequest bool `json:"creates_join_request,omitempty"`
}
EditChatInviteLinkParams contains parameters for Client.EditChatInviteLink.
func (*EditChatInviteLinkParams) Option ¶
func (r *EditChatInviteLinkParams) Option(opts ...EditChatInviteLinkOption) (previous EditChatInviteLinkOption)
Option applies one or more EditChatInviteLinkOption values and returns the last rollback option.
type EditChatSubscriptionInviteLinkOption ¶
type EditChatSubscriptionInviteLinkOption func(params *EditChatSubscriptionInviteLinkParams) EditChatSubscriptionInviteLinkOption
EditChatSubscriptionInviteLinkOption configures EditChatSubscriptionInviteLinkParams.
func WithEditChatSubscriptionInviteLinkChatID ¶
func WithEditChatSubscriptionInviteLinkChatID(value string) EditChatSubscriptionInviteLinkOption
WithEditChatSubscriptionInviteLinkChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithEditChatSubscriptionInviteLinkInviteLink ¶
func WithEditChatSubscriptionInviteLinkInviteLink(value string) EditChatSubscriptionInviteLinkOption
WithEditChatSubscriptionInviteLinkInviteLink sets the InviteLink field.
The invite link to edit
func WithEditChatSubscriptionInviteLinkName ¶
func WithEditChatSubscriptionInviteLinkName(value string) EditChatSubscriptionInviteLinkOption
WithEditChatSubscriptionInviteLinkName sets the Name field.
Invite link name; 0-32 characters
type EditChatSubscriptionInviteLinkParams ¶
type EditChatSubscriptionInviteLinkParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// The invite link to edit
InviteLink string `json:"invite_link"`
// Invite link name; 0-32 characters
Name string `json:"name,omitempty"`
}
EditChatSubscriptionInviteLinkParams contains parameters for Client.EditChatSubscriptionInviteLink.
func (*EditChatSubscriptionInviteLinkParams) Option ¶
func (r *EditChatSubscriptionInviteLinkParams) Option(opts ...EditChatSubscriptionInviteLinkOption) (previous EditChatSubscriptionInviteLinkOption)
Option applies one or more EditChatSubscriptionInviteLinkOption values and returns the last rollback option.
type EditForumTopicOption ¶
type EditForumTopicOption func(params *EditForumTopicParams) EditForumTopicOption
EditForumTopicOption configures EditForumTopicParams.
func WithEditForumTopicChatID ¶
func WithEditForumTopicChatID(value string) EditForumTopicOption
WithEditForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithEditForumTopicIconCustomEmojiID ¶
func WithEditForumTopicIconCustomEmojiID(value string) EditForumTopicOption
WithEditForumTopicIconCustomEmojiID sets the IconCustomEmojiID field.
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 WithEditForumTopicMessageThreadID ¶
func WithEditForumTopicMessageThreadID(value int64) EditForumTopicOption
WithEditForumTopicMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread of the forum topic
func WithEditForumTopicName ¶
func WithEditForumTopicName(value string) EditForumTopicOption
WithEditForumTopicName sets the Name field.
New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept
type EditForumTopicParams ¶
type EditForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread of the forum topic
MessageThreadID int64 `json:"message_thread_id"`
// New topic name, 0-128 characters.
// If not specified or empty, the current name of the topic will be kept
Name string `json:"name,omitempty"`
// 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
//
// [getForumTopicIconStickers]: https://core.telegram.org/bots/api#getforumtopiciconstickers
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
}
EditForumTopicParams contains parameters for Client.EditForumTopic.
func (*EditForumTopicParams) Option ¶
func (r *EditForumTopicParams) Option(opts ...EditForumTopicOption) (previous EditForumTopicOption)
Option applies one or more EditForumTopicOption values and returns the last rollback option.
type EditGeneralForumTopicOption ¶
type EditGeneralForumTopicOption func(params *EditGeneralForumTopicParams) EditGeneralForumTopicOption
EditGeneralForumTopicOption configures EditGeneralForumTopicParams.
func WithEditGeneralForumTopicChatID ¶
func WithEditGeneralForumTopicChatID(value string) EditGeneralForumTopicOption
WithEditGeneralForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithEditGeneralForumTopicName ¶
func WithEditGeneralForumTopicName(value string) EditGeneralForumTopicOption
WithEditGeneralForumTopicName sets the Name field.
New topic name, 1-128 characters
type EditGeneralForumTopicParams ¶
type EditGeneralForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// New topic name, 1-128 characters
Name string `json:"name"`
}
EditGeneralForumTopicParams contains parameters for Client.EditGeneralForumTopic.
func (*EditGeneralForumTopicParams) Option ¶
func (r *EditGeneralForumTopicParams) Option(opts ...EditGeneralForumTopicOption) (previous EditGeneralForumTopicOption)
Option applies one or more EditGeneralForumTopicOption values and returns the last rollback option.
type EditMessageCaptionOption ¶
type EditMessageCaptionOption func(params *EditMessageCaptionParams) EditMessageCaptionOption
EditMessageCaptionOption configures EditMessageCaptionParams.
func WithEditMessageCaptionBusinessConnectionID ¶
func WithEditMessageCaptionBusinessConnectionID(value string) EditMessageCaptionOption
WithEditMessageCaptionBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithEditMessageCaptionCaption ¶
func WithEditMessageCaptionCaption(value string) EditMessageCaptionOption
WithEditMessageCaptionCaption sets the Caption field.
New caption of the message, 0-1024 characters after entities parsing
func WithEditMessageCaptionCaptionEntities ¶
func WithEditMessageCaptionCaptionEntities(value []MessageEntity) EditMessageCaptionOption
WithEditMessageCaptionCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithEditMessageCaptionChatID ¶
func WithEditMessageCaptionChatID(value string) EditMessageCaptionOption
WithEditMessageCaptionChatID sets the ChatID field.
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 WithEditMessageCaptionInlineMessageID ¶
func WithEditMessageCaptionInlineMessageID(value string) EditMessageCaptionOption
WithEditMessageCaptionInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithEditMessageCaptionMessageID ¶
func WithEditMessageCaptionMessageID(value int64) EditMessageCaptionOption
WithEditMessageCaptionMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the message to edit
func WithEditMessageCaptionParseMode ¶
func WithEditMessageCaptionParseMode(value string) EditMessageCaptionOption
WithEditMessageCaptionParseMode sets the ParseMode field.
Mode for parsing entities in the message caption. See formatting options for more details.
func WithEditMessageCaptionReplyMarkup ¶
func WithEditMessageCaptionReplyMarkup(value *InlineKeyboardMarkup) EditMessageCaptionOption
WithEditMessageCaptionReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for an inline keyboard.
func WithEditMessageCaptionShowCaptionAboveMedia ¶
func WithEditMessageCaptionShowCaptionAboveMedia(value bool) EditMessageCaptionOption
WithEditMessageCaptionShowCaptionAboveMedia sets the ShowCaptionAboveMedia field.
Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.
type EditMessageCaptionParams ¶
type EditMessageCaptionParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the message to edit
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// New caption of the message, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the message caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media.
// Supported only for animation, photo and video messages.
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// A JSON-serialized object for an [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
EditMessageCaptionParams contains parameters for Client.EditMessageCaption.
func (*EditMessageCaptionParams) Option ¶
func (r *EditMessageCaptionParams) Option(opts ...EditMessageCaptionOption) (previous EditMessageCaptionOption)
Option applies one or more EditMessageCaptionOption values and returns the last rollback option.
type EditMessageChecklistOption ¶
type EditMessageChecklistOption func(params *EditMessageChecklistParams) EditMessageChecklistOption
EditMessageChecklistOption configures EditMessageChecklistParams.
func WithEditMessageChecklistBusinessConnectionID ¶
func WithEditMessageChecklistBusinessConnectionID(value string) EditMessageChecklistOption
WithEditMessageChecklistBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithEditMessageChecklistChatID ¶
func WithEditMessageChecklistChatID(value int64) EditMessageChecklistOption
WithEditMessageChecklistChatID sets the ChatID field.
Unique identifier for the target chat
func WithEditMessageChecklistChecklist ¶
func WithEditMessageChecklistChecklist(value InputChecklist) EditMessageChecklistOption
WithEditMessageChecklistChecklist sets the Checklist field.
A JSON-serialized object for the new checklist
func WithEditMessageChecklistMessageID ¶
func WithEditMessageChecklistMessageID(value int64) EditMessageChecklistOption
WithEditMessageChecklistMessageID sets the MessageID field.
Unique identifier for the target message
func WithEditMessageChecklistReplyMarkup ¶
func WithEditMessageChecklistReplyMarkup(value *InlineKeyboardMarkup) EditMessageChecklistOption
WithEditMessageChecklistReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for the new inline keyboard for the message
type EditMessageChecklistParams ¶
type EditMessageChecklistParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier for the target chat
ChatID int64 `json:"chat_id"`
// Unique identifier for the target message
MessageID int64 `json:"message_id"`
// A JSON-serialized object for the new checklist
Checklist InputChecklist `json:"checklist"`
// A JSON-serialized object for the new [inline keyboard] for the message
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
EditMessageChecklistParams contains parameters for Client.EditMessageChecklist.
func (*EditMessageChecklistParams) Option ¶
func (r *EditMessageChecklistParams) Option(opts ...EditMessageChecklistOption) (previous EditMessageChecklistOption)
Option applies one or more EditMessageChecklistOption values and returns the last rollback option.
type EditMessageLiveLocationOption ¶
type EditMessageLiveLocationOption func(params *EditMessageLiveLocationParams) EditMessageLiveLocationOption
EditMessageLiveLocationOption configures EditMessageLiveLocationParams.
func WithEditMessageLiveLocationBusinessConnectionID ¶
func WithEditMessageLiveLocationBusinessConnectionID(value string) EditMessageLiveLocationOption
WithEditMessageLiveLocationBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithEditMessageLiveLocationChatID ¶
func WithEditMessageLiveLocationChatID(value string) EditMessageLiveLocationOption
WithEditMessageLiveLocationChatID sets the ChatID field.
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 WithEditMessageLiveLocationHeading ¶
func WithEditMessageLiveLocationHeading(value int64) EditMessageLiveLocationOption
WithEditMessageLiveLocationHeading sets the Heading field.
Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
func WithEditMessageLiveLocationHorizontalAccuracy ¶
func WithEditMessageLiveLocationHorizontalAccuracy(value float64) EditMessageLiveLocationOption
WithEditMessageLiveLocationHorizontalAccuracy sets the HorizontalAccuracy field.
The radius of uncertainty for the location, measured in meters; 0-1500
func WithEditMessageLiveLocationInlineMessageID ¶
func WithEditMessageLiveLocationInlineMessageID(value string) EditMessageLiveLocationOption
WithEditMessageLiveLocationInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithEditMessageLiveLocationLatitude ¶
func WithEditMessageLiveLocationLatitude(value float64) EditMessageLiveLocationOption
WithEditMessageLiveLocationLatitude sets the Latitude field.
Latitude of new location
func WithEditMessageLiveLocationLivePeriod ¶
func WithEditMessageLiveLocationLivePeriod(value int64) EditMessageLiveLocationOption
WithEditMessageLiveLocationLivePeriod sets the LivePeriod field.
New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged
func WithEditMessageLiveLocationLongitude ¶
func WithEditMessageLiveLocationLongitude(value float64) EditMessageLiveLocationOption
WithEditMessageLiveLocationLongitude sets the Longitude field.
Longitude of new location
func WithEditMessageLiveLocationMessageID ¶
func WithEditMessageLiveLocationMessageID(value int64) EditMessageLiveLocationOption
WithEditMessageLiveLocationMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the message to edit
func WithEditMessageLiveLocationProximityAlertRadius ¶
func WithEditMessageLiveLocationProximityAlertRadius(value int64) EditMessageLiveLocationOption
WithEditMessageLiveLocationProximityAlertRadius sets the ProximityAlertRadius field.
The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
func WithEditMessageLiveLocationReplyMarkup ¶
func WithEditMessageLiveLocationReplyMarkup(value *InlineKeyboardMarkup) EditMessageLiveLocationOption
WithEditMessageLiveLocationReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for a new inline keyboard.
type EditMessageLiveLocationParams ¶
type EditMessageLiveLocationParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the message to edit
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// Latitude of new location
Latitude float64 `json:"latitude"`
// Longitude of new location
Longitude float64 `json:"longitude"`
// New period in seconds during which the location can be updated, starting from the message send date.
// If 0x7FFFFFFF is specified, then the location can be updated forever.
// Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days.
// If not specified, then live_period remains unchanged
LivePeriod int64 `json:"live_period,omitempty"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Direction in which the user is moving, in degrees.
// Must be between 1 and 360 if specified.
Heading int64 `json:"heading,omitempty"`
// The maximum distance for proximity alerts about approaching another chat member, in meters.
// Must be between 1 and 100000 if specified.
ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"`
// A JSON-serialized object for a new [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
EditMessageLiveLocationParams contains parameters for Client.EditMessageLiveLocation.
func (*EditMessageLiveLocationParams) Option ¶
func (r *EditMessageLiveLocationParams) Option(opts ...EditMessageLiveLocationOption) (previous EditMessageLiveLocationOption)
Option applies one or more EditMessageLiveLocationOption values and returns the last rollback option.
type EditMessageMediaOption ¶
type EditMessageMediaOption func(params *EditMessageMediaParams) EditMessageMediaOption
EditMessageMediaOption configures EditMessageMediaParams.
func WithEditMessageMediaBusinessConnectionID ¶
func WithEditMessageMediaBusinessConnectionID(value string) EditMessageMediaOption
WithEditMessageMediaBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithEditMessageMediaChatID ¶
func WithEditMessageMediaChatID(value string) EditMessageMediaOption
WithEditMessageMediaChatID sets the ChatID field.
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 WithEditMessageMediaInlineMessageID ¶
func WithEditMessageMediaInlineMessageID(value string) EditMessageMediaOption
WithEditMessageMediaInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithEditMessageMediaMedia ¶
func WithEditMessageMediaMedia(value InputMedia) EditMessageMediaOption
WithEditMessageMediaMedia sets the Media field.
A JSON-serialized object for a new media content of the message
func WithEditMessageMediaMessageID ¶
func WithEditMessageMediaMessageID(value int64) EditMessageMediaOption
WithEditMessageMediaMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the message to edit
func WithEditMessageMediaReplyMarkup ¶
func WithEditMessageMediaReplyMarkup(value *InlineKeyboardMarkup) EditMessageMediaOption
WithEditMessageMediaReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for a new inline keyboard.
type EditMessageMediaParams ¶
type EditMessageMediaParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the message to edit
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// A JSON-serialized object for a new media content of the message
Media InputMedia `json:"media"`
// A JSON-serialized object for a new [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
EditMessageMediaParams contains parameters for Client.EditMessageMedia.
func (*EditMessageMediaParams) Option ¶
func (r *EditMessageMediaParams) Option(opts ...EditMessageMediaOption) (previous EditMessageMediaOption)
Option applies one or more EditMessageMediaOption values and returns the last rollback option.
type EditMessageReplyMarkupOption ¶
type EditMessageReplyMarkupOption func(params *EditMessageReplyMarkupParams) EditMessageReplyMarkupOption
EditMessageReplyMarkupOption configures EditMessageReplyMarkupParams.
func WithEditMessageReplyMarkupBusinessConnectionID ¶
func WithEditMessageReplyMarkupBusinessConnectionID(value string) EditMessageReplyMarkupOption
WithEditMessageReplyMarkupBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithEditMessageReplyMarkupChatID ¶
func WithEditMessageReplyMarkupChatID(value string) EditMessageReplyMarkupOption
WithEditMessageReplyMarkupChatID sets the ChatID field.
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 WithEditMessageReplyMarkupInlineMessageID ¶
func WithEditMessageReplyMarkupInlineMessageID(value string) EditMessageReplyMarkupOption
WithEditMessageReplyMarkupInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithEditMessageReplyMarkupMessageID ¶
func WithEditMessageReplyMarkupMessageID(value int64) EditMessageReplyMarkupOption
WithEditMessageReplyMarkupMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the message to edit
func WithEditMessageReplyMarkupReplyMarkup ¶
func WithEditMessageReplyMarkupReplyMarkup(value *InlineKeyboardMarkup) EditMessageReplyMarkupOption
WithEditMessageReplyMarkupReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for an inline keyboard.
type EditMessageReplyMarkupParams ¶
type EditMessageReplyMarkupParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the message to edit
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// A JSON-serialized object for an [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
EditMessageReplyMarkupParams contains parameters for Client.EditMessageReplyMarkup.
func (*EditMessageReplyMarkupParams) Option ¶
func (r *EditMessageReplyMarkupParams) Option(opts ...EditMessageReplyMarkupOption) (previous EditMessageReplyMarkupOption)
Option applies one or more EditMessageReplyMarkupOption values and returns the last rollback option.
type EditMessageTextOption ¶
type EditMessageTextOption func(params *EditMessageTextParams) EditMessageTextOption
EditMessageTextOption configures EditMessageTextParams.
func WithEditMessageTextBusinessConnectionID ¶
func WithEditMessageTextBusinessConnectionID(value string) EditMessageTextOption
WithEditMessageTextBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithEditMessageTextChatID ¶
func WithEditMessageTextChatID(value string) EditMessageTextOption
WithEditMessageTextChatID sets the ChatID field.
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 WithEditMessageTextEntities ¶
func WithEditMessageTextEntities(value []MessageEntity) EditMessageTextOption
WithEditMessageTextEntities sets the Entities field.
A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
func WithEditMessageTextInlineButtons ¶
func WithEditMessageTextInlineButtons(buttons ...InlineKeyboardButton) EditMessageTextOption
WithEditMessageTextInlineButtons sets the inline keyboard with a single column of buttons for the message to be edited.
func WithEditMessageTextInlineKeyboard ¶
func WithEditMessageTextInlineKeyboard(keyboard [][]InlineKeyboardButton) EditMessageTextOption
WithEditMessageTextInlineKeyboard sets the inline keyboard for the message to be edited.
func WithEditMessageTextInlineMessageID ¶
func WithEditMessageTextInlineMessageID(value string) EditMessageTextOption
WithEditMessageTextInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithEditMessageTextLinkPreviewOptions ¶
func WithEditMessageTextLinkPreviewOptions(value *LinkPreviewOptions) EditMessageTextOption
WithEditMessageTextLinkPreviewOptions sets the LinkPreviewOptions field.
Link preview generation options for the message
func WithEditMessageTextMessageID ¶
func WithEditMessageTextMessageID(value int64) EditMessageTextOption
WithEditMessageTextMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the message to edit
func WithEditMessageTextParseMode ¶
func WithEditMessageTextParseMode(value string) EditMessageTextOption
WithEditMessageTextParseMode sets the ParseMode field.
Mode for parsing entities in the message text. See formatting options for more details.
func WithEditMessageTextReplyMarkup ¶
func WithEditMessageTextReplyMarkup(value *InlineKeyboardMarkup) EditMessageTextOption
WithEditMessageTextReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for an inline keyboard.
func WithEditMessageTextText ¶
func WithEditMessageTextText(value string) EditMessageTextOption
WithEditMessageTextText sets the Text field.
New text of the message, 1-4096 characters after entities parsing
type EditMessageTextParams ¶
type EditMessageTextParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the message to edit
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// New text of the message, 1-4096 characters after entities parsing
Text string `json:"text"`
// Mode for parsing entities in the message text.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
// Link preview generation options for the message
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
// A JSON-serialized object for an [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
EditMessageTextParams contains parameters for Client.EditMessageText.
func (*EditMessageTextParams) Option ¶
func (r *EditMessageTextParams) Option(opts ...EditMessageTextOption) (previous EditMessageTextOption)
Option applies one or more EditMessageTextOption values and returns the last rollback option.
type EditStoryOption ¶
type EditStoryOption func(params *EditStoryParams) EditStoryOption
EditStoryOption configures EditStoryParams.
func WithEditStoryAreas ¶
func WithEditStoryAreas(value []StoryArea) EditStoryOption
WithEditStoryAreas sets the Areas field.
A JSON-serialized list of clickable areas to be shown on the story
func WithEditStoryBusinessConnectionID ¶
func WithEditStoryBusinessConnectionID(value string) EditStoryOption
WithEditStoryBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithEditStoryCaption ¶
func WithEditStoryCaption(value string) EditStoryOption
WithEditStoryCaption sets the Caption field.
Caption of the story, 0-2048 characters after entities parsing
func WithEditStoryCaptionEntities ¶
func WithEditStoryCaptionEntities(value []MessageEntity) EditStoryOption
WithEditStoryCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithEditStoryContent ¶
func WithEditStoryContent(value InputStoryContent) EditStoryOption
WithEditStoryContent sets the Content field.
Content of the story
func WithEditStoryParseMode ¶
func WithEditStoryParseMode(value string) EditStoryOption
WithEditStoryParseMode sets the ParseMode field.
Mode for parsing entities in the story caption. See formatting options for more details.
func WithEditStoryStoryID ¶
func WithEditStoryStoryID(value int64) EditStoryOption
WithEditStoryStoryID sets the StoryID field.
Unique identifier of the story to edit
type EditStoryParams ¶
type EditStoryParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the story to edit
StoryID int64 `json:"story_id"`
// Content of the story
Content InputStoryContent `json:"content"`
// Caption of the story, 0-2048 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the story caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// A JSON-serialized list of clickable areas to be shown on the story
Areas []StoryArea `json:"areas,omitempty"`
}
EditStoryParams contains parameters for Client.EditStory.
func (*EditStoryParams) Option ¶
func (r *EditStoryParams) Option(opts ...EditStoryOption) (previous EditStoryOption)
Option applies one or more EditStoryOption values and returns the last rollback option.
type EditUserStarSubscriptionOption ¶
type EditUserStarSubscriptionOption func(params *EditUserStarSubscriptionParams) EditUserStarSubscriptionOption
EditUserStarSubscriptionOption configures EditUserStarSubscriptionParams.
func WithEditUserStarSubscriptionIsCanceled ¶
func WithEditUserStarSubscriptionIsCanceled(value bool) EditUserStarSubscriptionOption
WithEditUserStarSubscriptionIsCanceled sets the IsCanceled field.
Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.
func WithEditUserStarSubscriptionTelegramPaymentChargeID ¶
func WithEditUserStarSubscriptionTelegramPaymentChargeID(value string) EditUserStarSubscriptionOption
WithEditUserStarSubscriptionTelegramPaymentChargeID sets the TelegramPaymentChargeID field.
Telegram payment identifier for the subscription
func WithEditUserStarSubscriptionUserID ¶
func WithEditUserStarSubscriptionUserID(value int64) EditUserStarSubscriptionOption
WithEditUserStarSubscriptionUserID sets the UserID field.
Identifier of the user whose subscription will be edited
type EditUserStarSubscriptionParams ¶
type EditUserStarSubscriptionParams struct {
// Identifier of the user whose subscription will be edited
UserID int64 `json:"user_id"`
// Telegram payment identifier for the subscription
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
// Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period.
// Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.
IsCanceled bool `json:"is_canceled"`
}
EditUserStarSubscriptionParams contains parameters for Client.EditUserStarSubscription.
func (*EditUserStarSubscriptionParams) Option ¶
func (r *EditUserStarSubscriptionParams) Option(opts ...EditUserStarSubscriptionOption) (previous EditUserStarSubscriptionOption)
Option applies one or more EditUserStarSubscriptionOption values and returns the last rollback option.
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
//
// [EncryptedPassportElement]: https://core.telegram.org/bots/api#encryptedpassportelement
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 only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types.
// Can be decrypted and verified using the accompanying [EncryptedCredentials].
//
// [EncryptedCredentials]: https://core.telegram.org/bots/api#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 only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types.
// Files can be decrypted and verified using the accompanying [EncryptedCredentials].
//
// [EncryptedCredentials]: https://core.telegram.org/bots/api#encryptedcredentials
Files []PassportFile `json:"files,omitempty"`
// Optional.
// Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”.
// The file can be decrypted and verified using the accompanying [EncryptedCredentials].
//
// [EncryptedCredentials]: https://core.telegram.org/bots/api#encryptedcredentials
FrontSide *PassportFile `json:"front_side,omitempty"`
// Optional.
// Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”.
// The file can be decrypted and verified using the accompanying [EncryptedCredentials].
//
// [EncryptedCredentials]: https://core.telegram.org/bots/api#encryptedcredentials
ReverseSide *PassportFile `json:"reverse_side,omitempty"`
// Optional.
// Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”.
// The file can be decrypted and verified using the accompanying [EncryptedCredentials].
//
// [EncryptedCredentials]: https://core.telegram.org/bots/api#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].
//
// [EncryptedCredentials]: https://core.telegram.org/bots/api#encryptedcredentials
Translation []PassportFile `json:"translation,omitempty"`
// Base64-encoded element hash for using in [PassportElementErrorUnspecified]
//
// [PassportElementErrorUnspecified]: https://core.telegram.org/bots/api#passportelementerrorunspecified
Hash string `json:"hash"`
}
EncryptedPassportElement
Describes documents or other Telegram Passport elements shared with the bot by the user.
type ExportChatInviteLinkOption ¶
type ExportChatInviteLinkOption func(params *ExportChatInviteLinkParams) ExportChatInviteLinkOption
ExportChatInviteLinkOption configures ExportChatInviteLinkParams.
func WithExportChatInviteLinkChatID ¶
func WithExportChatInviteLinkChatID(value string) ExportChatInviteLinkOption
WithExportChatInviteLinkChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type ExportChatInviteLinkParams ¶
type ExportChatInviteLinkParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
ExportChatInviteLinkParams contains parameters for Client.ExportChatInviteLink.
func (*ExportChatInviteLinkParams) Option ¶
func (r *ExportChatInviteLinkParams) Option(opts ...ExportChatInviteLinkOption) (previous ExportChatInviteLinkOption)
Option applies one or more ExportChatInviteLinkOption values and returns the last rollback option.
type ExternalReplyInfo ¶
type ExternalReplyInfo struct {
// Origin of the message replied to by the given message
Origin MessageOrigin `json:"origin"`
// Optional.
// Chat the original message belongs to.
// Available only if the chat is a supergroup or a channel.
Chat *Chat `json:"chat,omitempty"`
// Optional.
// Unique message identifier inside the original chat.
// Available only if the original chat is a supergroup or a channel.
MessageID int64 `json:"message_id,omitempty"`
// Optional.
// Options used for link preview generation for the original message, if it is a text message
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
// Optional.
// Message is an animation, information about the animation
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 contains paid media; information about the paid media
PaidMedia *PaidMediaInfo `json:"paid_media,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 forwarded story
Story *Story `json:"story,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
//
// [video note]: https://telegram.org/blog/video-messages-and-telescope
VideoNote *VideoNote `json:"video_note,omitempty"`
// Optional.
// Message is a voice message, information about the file
Voice *Voice `json:"voice,omitempty"`
// Optional.
// True, if the message media is covered by a spoiler animation
HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"`
// Optional.
// Message is a checklist
Checklist *Checklist `json:"checklist,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 »]
//
// [More about games »]: https://core.telegram.org/bots/api#games
Game *Game `json:"game,omitempty"`
// Optional.
// Message is a scheduled giveaway, information about the giveaway
Giveaway *Giveaway `json:"giveaway,omitempty"`
// Optional.
// A giveaway with public winners was completed
GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"`
// Optional.
// Message is an invoice for a [payment], information about the invoice.
// [More about payments »]
//
// [payment]: https://core.telegram.org/bots/api#payments
// [More about payments »]: https://core.telegram.org/bots/api#payments
Invoice *Invoice `json:"invoice,omitempty"`
// Optional.
// Message is a shared location, information about the location
Location *Location `json:"location,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
Venue *Venue `json:"venue,omitempty"`
}
ExternalReplyInfo
This object contains information about a message that is being replied to, which may come from another chat or forum topic.
type File ¶
type File 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"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
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 Filter ¶
Filter is a function that checks if the update matches the condition.
func FilterCommand ¶
FilterCommand creates a filter that matches a command. It supports commands with arguments and bot mentions (e.g., /command, /command@bot, /command arg).
func FilterMessageContact ¶
func FilterMessageContact() Filter
FilterMessageContact creates a filter that matches messages with a contact.
func FilterMessageDocument ¶
func FilterMessageDocument() Filter
FilterMessageDocument creates a filter that matches messages with a document.
func FilterMessageVideo ¶
func FilterMessageVideo() Filter
FilterMessageVideo creates a filter that matches messages with a video.
func FilterRegexp ¶
FilterRegexp creates a filter that matches the message text against a regular expression. Note: It panics if the pattern is invalid.
func FilterText ¶
FilterText creates a filter that matches the message text exactly.
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 to a message in the same chat and forum topic, sender of the original message.
//
// [Message]: https://core.telegram.org/bots/api#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. Not supported in channels and for messages sent on behalf of a Telegram Business account.
type ForumTopic ¶
type ForumTopic struct {
// Unique identifier of the forum topic
MessageThreadID int64 `json:"message_thread_id"`
// Name of the topic
Name string `json:"name"`
// Color of the topic icon in RGB format
IconColor int64 `json:"icon_color"`
// Optional.
// Unique identifier of the custom emoji shown as the topic icon
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
// Optional.
// True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
IsNameImplicit bool `json:"is_name_implicit,omitempty"`
}
ForumTopic
This object represents a forum topic.
type ForumTopicClosed ¶
type ForumTopicClosed struct {
}
ForumTopicClosed
This object represents a service message about a forum topic closed in the chat. Currently holds no information.
type ForumTopicCreated ¶
type ForumTopicCreated struct {
// Name of the topic
Name string `json:"name"`
// Color of the topic icon in RGB format
IconColor int64 `json:"icon_color"`
// Optional.
// Unique identifier of the custom emoji shown as the topic icon
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
// Optional.
// True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
IsNameImplicit bool `json:"is_name_implicit,omitempty"`
}
ForumTopicCreated
This object represents a service message about a new forum topic created in the chat.
type ForumTopicEdited ¶
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 ¶
type ForumTopicReopened struct {
}
ForumTopicReopened
This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
type ForwardMessageOption ¶
type ForwardMessageOption func(params *ForwardMessageParams) ForwardMessageOption
ForwardMessageOption configures ForwardMessageParams.
func WithForwardMessageChatID ¶
func WithForwardMessageChatID(value string) ForwardMessageOption
WithForwardMessageChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithForwardMessageDirectMessagesTopicID ¶
func WithForwardMessageDirectMessagesTopicID(value int64) ForwardMessageOption
WithForwardMessageDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
func WithForwardMessageDisableNotification ¶
func WithForwardMessageDisableNotification(value bool) ForwardMessageOption
WithForwardMessageDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithForwardMessageFromChatID ¶
func WithForwardMessageFromChatID(value string) ForwardMessageOption
WithForwardMessageFromChatID sets the FromChatID field.
Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
func WithForwardMessageMessageEffectID ¶
func WithForwardMessageMessageEffectID(value string) ForwardMessageOption
WithForwardMessageMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; only available when forwarding to private chats
func WithForwardMessageMessageID ¶
func WithForwardMessageMessageID(value int64) ForwardMessageOption
WithForwardMessageMessageID sets the MessageID field.
Message identifier in the chat specified in from_chat_id
func WithForwardMessageMessageThreadID ¶
func WithForwardMessageMessageThreadID(value int64) ForwardMessageOption
WithForwardMessageMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithForwardMessageProtectContent ¶
func WithForwardMessageProtectContent(value bool) ForwardMessageOption
WithForwardMessageProtectContent sets the ProtectContent field.
Protects the contents of the forwarded message from forwarding and saving
func WithForwardMessageSuggestedPostParameters ¶
func WithForwardMessageSuggestedPostParameters(value *SuggestedPostParameters) ForwardMessageOption
WithForwardMessageSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
func WithForwardMessageVideoStartTimestamp ¶
func WithForwardMessageVideoStartTimestamp(value int64) ForwardMessageOption
WithForwardMessageVideoStartTimestamp sets the VideoStartTimestamp field.
New start timestamp for the forwarded video in the message
type ForwardMessageParams ¶
type ForwardMessageParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
FromChatID string `json:"from_chat_id"`
// New start timestamp for the forwarded video in the message
VideoStartTimestamp int64 `json:"video_start_timestamp,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the forwarded message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Unique identifier of the message effect to be added to the message; only available when forwarding to private chats
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Message identifier in the chat specified in from_chat_id
MessageID int64 `json:"message_id"`
}
ForwardMessageParams contains parameters for Client.ForwardMessage.
func (*ForwardMessageParams) Option ¶
func (r *ForwardMessageParams) Option(opts ...ForwardMessageOption) (previous ForwardMessageOption)
Option applies one or more ForwardMessageOption values and returns the last rollback option.
type ForwardMessagesOption ¶
type ForwardMessagesOption func(params *ForwardMessagesParams) ForwardMessagesOption
ForwardMessagesOption configures ForwardMessagesParams.
func WithForwardMessagesChatID ¶
func WithForwardMessagesChatID(value string) ForwardMessagesOption
WithForwardMessagesChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithForwardMessagesDirectMessagesTopicID ¶
func WithForwardMessagesDirectMessagesTopicID(value int64) ForwardMessagesOption
WithForwardMessagesDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
func WithForwardMessagesDisableNotification ¶
func WithForwardMessagesDisableNotification(value bool) ForwardMessagesOption
WithForwardMessagesDisableNotification sets the DisableNotification field.
Sends the messages silently. Users will receive a notification with no sound.
func WithForwardMessagesFromChatID ¶
func WithForwardMessagesFromChatID(value string) ForwardMessagesOption
WithForwardMessagesFromChatID sets the FromChatID field.
Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
func WithForwardMessagesMessageIDs ¶
func WithForwardMessagesMessageIDs(value []int64) ForwardMessagesOption
WithForwardMessagesMessageIDs sets the MessageIDs field.
A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
func WithForwardMessagesMessageThreadID ¶
func WithForwardMessagesMessageThreadID(value int64) ForwardMessagesOption
WithForwardMessagesMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithForwardMessagesProtectContent ¶
func WithForwardMessagesProtectContent(value bool) ForwardMessagesOption
WithForwardMessagesProtectContent sets the ProtectContent field.
Protects the contents of the forwarded messages from forwarding and saving
type ForwardMessagesParams ¶
type ForwardMessagesParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
FromChatID string `json:"from_chat_id"`
// A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward.
// The identifiers must be specified in a strictly increasing order.
MessageIDs []int64 `json:"message_ids"`
// Sends the messages [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the forwarded messages from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
}
ForwardMessagesParams contains parameters for Client.ForwardMessages.
func (*ForwardMessagesParams) Option ¶
func (r *ForwardMessagesParams) Option(opts ...ForwardMessagesOption) (previous ForwardMessagesOption)
Option applies one or more ForwardMessagesOption values and returns the last rollback option.
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.
//
// [setGameScore]: https://core.telegram.org/bots/api#setgamescore
// [editMessageText]: https://core.telegram.org/bots/api#editmessagetext
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]
//
// [BotFather]: https://t.me/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 int64 `json:"position"`
// User
User User `json:"user"`
// Score
Score int64 `json:"score"`
}
GameHighScore
This object represents one row of the high scores table for a game.
type GeneralForumTopicHidden ¶
type GeneralForumTopicHidden struct {
}
GeneralForumTopicHidden
This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
type GeneralForumTopicUnhidden ¶
type GeneralForumTopicUnhidden struct {
}
GeneralForumTopicUnhidden
This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
type GetAvailableGiftsOption ¶
type GetAvailableGiftsOption func(params *GetAvailableGiftsParams) GetAvailableGiftsOption
GetAvailableGiftsOption configures GetAvailableGiftsParams.
type GetAvailableGiftsParams ¶
type GetAvailableGiftsParams struct {
}
GetAvailableGiftsParams contains parameters for Client.GetAvailableGifts.
func (*GetAvailableGiftsParams) Option ¶
func (r *GetAvailableGiftsParams) Option(opts ...GetAvailableGiftsOption) (previous GetAvailableGiftsOption)
Option applies one or more GetAvailableGiftsOption values and returns the last rollback option.
type GetBusinessAccountGiftsOption ¶
type GetBusinessAccountGiftsOption func(params *GetBusinessAccountGiftsParams) GetBusinessAccountGiftsOption
GetBusinessAccountGiftsOption configures GetBusinessAccountGiftsParams.
func WithGetBusinessAccountGiftsBusinessConnectionID ¶
func WithGetBusinessAccountGiftsBusinessConnectionID(value string) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithGetBusinessAccountGiftsExcludeFromBlockchain ¶
func WithGetBusinessAccountGiftsExcludeFromBlockchain(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeFromBlockchain sets the ExcludeFromBlockchain field.
Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
func WithGetBusinessAccountGiftsExcludeLimitedNonUpgradable ¶
func WithGetBusinessAccountGiftsExcludeLimitedNonUpgradable(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeLimitedNonUpgradable sets the ExcludeLimitedNonUpgradable field.
Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
func WithGetBusinessAccountGiftsExcludeLimitedUpgradable ¶
func WithGetBusinessAccountGiftsExcludeLimitedUpgradable(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeLimitedUpgradable sets the ExcludeLimitedUpgradable field.
Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
func WithGetBusinessAccountGiftsExcludeSaved ¶
func WithGetBusinessAccountGiftsExcludeSaved(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeSaved sets the ExcludeSaved field.
Pass True to exclude gifts that are saved to the account's profile page
func WithGetBusinessAccountGiftsExcludeUnique ¶
func WithGetBusinessAccountGiftsExcludeUnique(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeUnique sets the ExcludeUnique field.
Pass True to exclude unique gifts
func WithGetBusinessAccountGiftsExcludeUnlimited ¶
func WithGetBusinessAccountGiftsExcludeUnlimited(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeUnlimited sets the ExcludeUnlimited field.
Pass True to exclude gifts that can be purchased an unlimited number of times
func WithGetBusinessAccountGiftsExcludeUnsaved ¶
func WithGetBusinessAccountGiftsExcludeUnsaved(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsExcludeUnsaved sets the ExcludeUnsaved field.
Pass True to exclude gifts that aren't saved to the account's profile page
func WithGetBusinessAccountGiftsLimit ¶
func WithGetBusinessAccountGiftsLimit(value int64) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsLimit sets the Limit field.
The maximum number of gifts to be returned; 1-100. Defaults to 100
func WithGetBusinessAccountGiftsOffset ¶
func WithGetBusinessAccountGiftsOffset(value string) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsOffset sets the Offset field.
Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
func WithGetBusinessAccountGiftsSortByPrice ¶
func WithGetBusinessAccountGiftsSortByPrice(value bool) GetBusinessAccountGiftsOption
WithGetBusinessAccountGiftsSortByPrice sets the SortByPrice field.
Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.
type GetBusinessAccountGiftsParams ¶
type GetBusinessAccountGiftsParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Pass True to exclude gifts that aren't saved to the account's profile page
ExcludeUnsaved bool `json:"exclude_unsaved,omitempty"`
// Pass True to exclude gifts that are saved to the account's profile page
ExcludeSaved bool `json:"exclude_saved,omitempty"`
// Pass True to exclude gifts that can be purchased an unlimited number of times
ExcludeUnlimited bool `json:"exclude_unlimited,omitempty"`
// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
ExcludeLimitedUpgradable bool `json:"exclude_limited_upgradable,omitempty"`
// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
ExcludeLimitedNonUpgradable bool `json:"exclude_limited_non_upgradable,omitempty"`
// Pass True to exclude unique gifts
ExcludeUnique bool `json:"exclude_unique,omitempty"`
// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
ExcludeFromBlockchain bool `json:"exclude_from_blockchain,omitempty"`
// Pass True to sort results by gift price instead of send date.
// Sorting is applied before pagination.
SortByPrice bool `json:"sort_by_price,omitempty"`
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
Offset string `json:"offset,omitempty"`
// The maximum number of gifts to be returned; 1-100.
// Defaults to 100
Limit int64 `json:"limit,omitempty"`
}
GetBusinessAccountGiftsParams contains parameters for Client.GetBusinessAccountGifts.
func (*GetBusinessAccountGiftsParams) Option ¶
func (r *GetBusinessAccountGiftsParams) Option(opts ...GetBusinessAccountGiftsOption) (previous GetBusinessAccountGiftsOption)
Option applies one or more GetBusinessAccountGiftsOption values and returns the last rollback option.
type GetBusinessAccountStarBalanceOption ¶
type GetBusinessAccountStarBalanceOption func(params *GetBusinessAccountStarBalanceParams) GetBusinessAccountStarBalanceOption
GetBusinessAccountStarBalanceOption configures GetBusinessAccountStarBalanceParams.
func WithGetBusinessAccountStarBalanceBusinessConnectionID ¶
func WithGetBusinessAccountStarBalanceBusinessConnectionID(value string) GetBusinessAccountStarBalanceOption
WithGetBusinessAccountStarBalanceBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
type GetBusinessAccountStarBalanceParams ¶
type GetBusinessAccountStarBalanceParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
}
GetBusinessAccountStarBalanceParams contains parameters for Client.GetBusinessAccountStarBalance.
func (*GetBusinessAccountStarBalanceParams) Option ¶
func (r *GetBusinessAccountStarBalanceParams) Option(opts ...GetBusinessAccountStarBalanceOption) (previous GetBusinessAccountStarBalanceOption)
Option applies one or more GetBusinessAccountStarBalanceOption values and returns the last rollback option.
type GetBusinessConnectionOption ¶
type GetBusinessConnectionOption func(params *GetBusinessConnectionParams) GetBusinessConnectionOption
GetBusinessConnectionOption configures GetBusinessConnectionParams.
func WithGetBusinessConnectionBusinessConnectionID ¶
func WithGetBusinessConnectionBusinessConnectionID(value string) GetBusinessConnectionOption
WithGetBusinessConnectionBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
type GetBusinessConnectionParams ¶
type GetBusinessConnectionParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
}
GetBusinessConnectionParams contains parameters for Client.GetBusinessConnection.
func (*GetBusinessConnectionParams) Option ¶
func (r *GetBusinessConnectionParams) Option(opts ...GetBusinessConnectionOption) (previous GetBusinessConnectionOption)
Option applies one or more GetBusinessConnectionOption values and returns the last rollback option.
type GetChatAdministratorsOption ¶
type GetChatAdministratorsOption func(params *GetChatAdministratorsParams) GetChatAdministratorsOption
GetChatAdministratorsOption configures GetChatAdministratorsParams.
func WithGetChatAdministratorsChatID ¶
func WithGetChatAdministratorsChatID(value string) GetChatAdministratorsOption
WithGetChatAdministratorsChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type GetChatAdministratorsParams ¶
type GetChatAdministratorsParams struct {
// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
GetChatAdministratorsParams contains parameters for Client.GetChatAdministrators.
func (*GetChatAdministratorsParams) Option ¶
func (r *GetChatAdministratorsParams) Option(opts ...GetChatAdministratorsOption) (previous GetChatAdministratorsOption)
Option applies one or more GetChatAdministratorsOption values and returns the last rollback option.
type GetChatGiftsOption ¶
type GetChatGiftsOption func(params *GetChatGiftsParams) GetChatGiftsOption
GetChatGiftsOption configures GetChatGiftsParams.
func WithGetChatGiftsChatID ¶
func WithGetChatGiftsChatID(value string) GetChatGiftsOption
WithGetChatGiftsChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithGetChatGiftsExcludeFromBlockchain ¶
func WithGetChatGiftsExcludeFromBlockchain(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeFromBlockchain sets the ExcludeFromBlockchain field.
Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
func WithGetChatGiftsExcludeLimitedNonUpgradable ¶
func WithGetChatGiftsExcludeLimitedNonUpgradable(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeLimitedNonUpgradable sets the ExcludeLimitedNonUpgradable field.
Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
func WithGetChatGiftsExcludeLimitedUpgradable ¶
func WithGetChatGiftsExcludeLimitedUpgradable(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeLimitedUpgradable sets the ExcludeLimitedUpgradable field.
Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
func WithGetChatGiftsExcludeSaved ¶
func WithGetChatGiftsExcludeSaved(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeSaved sets the ExcludeSaved field.
Pass True to exclude gifts that are saved to the chat's profile page. Always False, unless the bot has the can_post_messages administrator right in the channel.
func WithGetChatGiftsExcludeUnique ¶
func WithGetChatGiftsExcludeUnique(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeUnique sets the ExcludeUnique field.
Pass True to exclude unique gifts
func WithGetChatGiftsExcludeUnlimited ¶
func WithGetChatGiftsExcludeUnlimited(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeUnlimited sets the ExcludeUnlimited field.
Pass True to exclude gifts that can be purchased an unlimited number of times
func WithGetChatGiftsExcludeUnsaved ¶
func WithGetChatGiftsExcludeUnsaved(value bool) GetChatGiftsOption
WithGetChatGiftsExcludeUnsaved sets the ExcludeUnsaved field.
Pass True to exclude gifts that aren't saved to the chat's profile page. Always True, unless the bot has the can_post_messages administrator right in the channel.
func WithGetChatGiftsLimit ¶
func WithGetChatGiftsLimit(value int64) GetChatGiftsOption
WithGetChatGiftsLimit sets the Limit field.
The maximum number of gifts to be returned; 1-100. Defaults to 100
func WithGetChatGiftsOffset ¶
func WithGetChatGiftsOffset(value string) GetChatGiftsOption
WithGetChatGiftsOffset sets the Offset field.
Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
func WithGetChatGiftsSortByPrice ¶
func WithGetChatGiftsSortByPrice(value bool) GetChatGiftsOption
WithGetChatGiftsSortByPrice sets the SortByPrice field.
Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.
type GetChatGiftsParams ¶
type GetChatGiftsParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Pass True to exclude gifts that aren't saved to the chat's profile page.
// Always True, unless the bot has the can_post_messages administrator right in the channel.
ExcludeUnsaved bool `json:"exclude_unsaved,omitempty"`
// Pass True to exclude gifts that are saved to the chat's profile page.
// Always False, unless the bot has the can_post_messages administrator right in the channel.
ExcludeSaved bool `json:"exclude_saved,omitempty"`
// Pass True to exclude gifts that can be purchased an unlimited number of times
ExcludeUnlimited bool `json:"exclude_unlimited,omitempty"`
// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
ExcludeLimitedUpgradable bool `json:"exclude_limited_upgradable,omitempty"`
// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
ExcludeLimitedNonUpgradable bool `json:"exclude_limited_non_upgradable,omitempty"`
// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
ExcludeFromBlockchain bool `json:"exclude_from_blockchain,omitempty"`
// Pass True to exclude unique gifts
ExcludeUnique bool `json:"exclude_unique,omitempty"`
// Pass True to sort results by gift price instead of send date.
// Sorting is applied before pagination.
SortByPrice bool `json:"sort_by_price,omitempty"`
// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
Offset string `json:"offset,omitempty"`
// The maximum number of gifts to be returned; 1-100.
// Defaults to 100
Limit int64 `json:"limit,omitempty"`
}
GetChatGiftsParams contains parameters for Client.GetChatGifts.
func (*GetChatGiftsParams) Option ¶
func (r *GetChatGiftsParams) Option(opts ...GetChatGiftsOption) (previous GetChatGiftsOption)
Option applies one or more GetChatGiftsOption values and returns the last rollback option.
type GetChatMemberCountOption ¶
type GetChatMemberCountOption func(params *GetChatMemberCountParams) GetChatMemberCountOption
GetChatMemberCountOption configures GetChatMemberCountParams.
func WithGetChatMemberCountChatID ¶
func WithGetChatMemberCountChatID(value string) GetChatMemberCountOption
WithGetChatMemberCountChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type GetChatMemberCountParams ¶
type GetChatMemberCountParams struct {
// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
GetChatMemberCountParams contains parameters for Client.GetChatMemberCount.
func (*GetChatMemberCountParams) Option ¶
func (r *GetChatMemberCountParams) Option(opts ...GetChatMemberCountOption) (previous GetChatMemberCountOption)
Option applies one or more GetChatMemberCountOption values and returns the last rollback option.
type GetChatMemberOption ¶
type GetChatMemberOption func(params *GetChatMemberParams) GetChatMemberOption
GetChatMemberOption configures GetChatMemberParams.
func WithGetChatMemberChatID ¶
func WithGetChatMemberChatID(value string) GetChatMemberOption
WithGetChatMemberChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
func WithGetChatMemberUserID ¶
func WithGetChatMemberUserID(value int64) GetChatMemberOption
WithGetChatMemberUserID sets the UserID field.
Unique identifier of the target user
type GetChatMemberParams ¶
type GetChatMemberParams struct {
// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
}
GetChatMemberParams contains parameters for Client.GetChatMember.
func (*GetChatMemberParams) Option ¶
func (r *GetChatMemberParams) Option(opts ...GetChatMemberOption) (previous GetChatMemberOption)
Option applies one or more GetChatMemberOption values and returns the last rollback option.
type GetChatMenuButtonOption ¶
type GetChatMenuButtonOption func(params *GetChatMenuButtonParams) GetChatMenuButtonOption
GetChatMenuButtonOption configures GetChatMenuButtonParams.
func WithGetChatMenuButtonChatID ¶
func WithGetChatMenuButtonChatID(value int64) GetChatMenuButtonOption
WithGetChatMenuButtonChatID sets the ChatID field.
Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
type GetChatMenuButtonParams ¶
type GetChatMenuButtonParams struct {
// Unique identifier for the target private chat.
// If not specified, default bot's menu button will be returned
ChatID int64 `json:"chat_id,omitempty"`
}
GetChatMenuButtonParams contains parameters for Client.GetChatMenuButton.
func (*GetChatMenuButtonParams) Option ¶
func (r *GetChatMenuButtonParams) Option(opts ...GetChatMenuButtonOption) (previous GetChatMenuButtonOption)
Option applies one or more GetChatMenuButtonOption values and returns the last rollback option.
type GetChatOption ¶
type GetChatOption func(params *GetChatParams) GetChatOption
GetChatOption configures GetChatParams.
func WithGetChatChatID ¶
func WithGetChatChatID(value string) GetChatOption
WithGetChatChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
type GetChatParams ¶
type GetChatParams struct {
// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
GetChatParams contains parameters for Client.GetChat.
func (*GetChatParams) Option ¶
func (r *GetChatParams) Option(opts ...GetChatOption) (previous GetChatOption)
Option applies one or more GetChatOption values and returns the last rollback option.
type GetCustomEmojiStickersOption ¶
type GetCustomEmojiStickersOption func(params *GetCustomEmojiStickersParams) GetCustomEmojiStickersOption
GetCustomEmojiStickersOption configures GetCustomEmojiStickersParams.
func WithGetCustomEmojiStickersCustomEmojiIDs ¶
func WithGetCustomEmojiStickersCustomEmojiIDs(value []string) GetCustomEmojiStickersOption
WithGetCustomEmojiStickersCustomEmojiIDs sets the CustomEmojiIDs field.
A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
type GetCustomEmojiStickersParams ¶
type GetCustomEmojiStickersParams struct {
// A JSON-serialized list of custom emoji identifiers.
// At most 200 custom emoji identifiers can be specified.
CustomEmojiIDs []string `json:"custom_emoji_ids"`
}
GetCustomEmojiStickersParams contains parameters for Client.GetCustomEmojiStickers.
func (*GetCustomEmojiStickersParams) Option ¶
func (r *GetCustomEmojiStickersParams) Option(opts ...GetCustomEmojiStickersOption) (previous GetCustomEmojiStickersOption)
Option applies one or more GetCustomEmojiStickersOption values and returns the last rollback option.
type GetFileOption ¶
type GetFileOption func(params *GetFileParams) GetFileOption
GetFileOption configures GetFileParams.
func WithGetFileFileID ¶
func WithGetFileFileID(value string) GetFileOption
WithGetFileFileID sets the FileID field.
File identifier to get information about
type GetFileParams ¶
type GetFileParams struct {
// File identifier to get information about
FileID string `json:"file_id"`
}
GetFileParams contains parameters for Client.GetFile.
func (*GetFileParams) Option ¶
func (r *GetFileParams) Option(opts ...GetFileOption) (previous GetFileOption)
Option applies one or more GetFileOption values and returns the last rollback option.
type GetForumTopicIconStickersOption ¶
type GetForumTopicIconStickersOption func(params *GetForumTopicIconStickersParams) GetForumTopicIconStickersOption
GetForumTopicIconStickersOption configures GetForumTopicIconStickersParams.
type GetForumTopicIconStickersParams ¶
type GetForumTopicIconStickersParams struct {
}
GetForumTopicIconStickersParams contains parameters for Client.GetForumTopicIconStickers.
func (*GetForumTopicIconStickersParams) Option ¶
func (r *GetForumTopicIconStickersParams) Option(opts ...GetForumTopicIconStickersOption) (previous GetForumTopicIconStickersOption)
Option applies one or more GetForumTopicIconStickersOption values and returns the last rollback option.
type GetGameHighScoresOption ¶
type GetGameHighScoresOption func(params *GetGameHighScoresParams) GetGameHighScoresOption
GetGameHighScoresOption configures GetGameHighScoresParams.
func WithGetGameHighScoresChatID ¶
func WithGetGameHighScoresChatID(value int64) GetGameHighScoresOption
WithGetGameHighScoresChatID sets the ChatID field.
Required if inline_message_id is not specified. Unique identifier for the target chat
func WithGetGameHighScoresInlineMessageID ¶
func WithGetGameHighScoresInlineMessageID(value string) GetGameHighScoresOption
WithGetGameHighScoresInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithGetGameHighScoresMessageID ¶
func WithGetGameHighScoresMessageID(value int64) GetGameHighScoresOption
WithGetGameHighScoresMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the sent message
func WithGetGameHighScoresUserID ¶
func WithGetGameHighScoresUserID(value int64) GetGameHighScoresOption
WithGetGameHighScoresUserID sets the UserID field.
Target user id
type GetGameHighScoresParams ¶
type GetGameHighScoresParams struct {
// Target user id
UserID int64 `json:"user_id"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat
ChatID int64 `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the sent message
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
}
GetGameHighScoresParams contains parameters for Client.GetGameHighScores.
func (*GetGameHighScoresParams) Option ¶
func (r *GetGameHighScoresParams) Option(opts ...GetGameHighScoresOption) (previous GetGameHighScoresOption)
Option applies one or more GetGameHighScoresOption values and returns the last rollback option.
type GetMeOption ¶
type GetMeOption func(params *GetMeParams) GetMeOption
GetMeOption configures GetMeParams.
type GetMeParams ¶
type GetMeParams struct {
}
GetMeParams contains parameters for Client.GetMe.
func (*GetMeParams) Option ¶
func (r *GetMeParams) Option(opts ...GetMeOption) (previous GetMeOption)
Option applies one or more GetMeOption values and returns the last rollback option.
type GetMyCommandsOption ¶
type GetMyCommandsOption func(params *GetMyCommandsParams) GetMyCommandsOption
GetMyCommandsOption configures GetMyCommandsParams.
func WithGetMyCommandsLanguageCode ¶
func WithGetMyCommandsLanguageCode(value string) GetMyCommandsOption
WithGetMyCommandsLanguageCode sets the LanguageCode field.
A two-letter ISO 639-1 language code or an empty string
func WithGetMyCommandsScope ¶
func WithGetMyCommandsScope(value *BotCommandScope) GetMyCommandsOption
WithGetMyCommandsScope sets the Scope field.
A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
type GetMyCommandsParams ¶
type GetMyCommandsParams struct {
// A JSON-serialized object, describing scope of users.
// Defaults to [BotCommandScopeDefault].
//
// [BotCommandScopeDefault]: https://core.telegram.org/bots/api#botcommandscopedefault
Scope *BotCommandScope `json:"scope,omitempty"`
// A two-letter ISO 639-1 language code or an empty string
LanguageCode string `json:"language_code,omitempty"`
}
GetMyCommandsParams contains parameters for Client.GetMyCommands.
func (*GetMyCommandsParams) Option ¶
func (r *GetMyCommandsParams) Option(opts ...GetMyCommandsOption) (previous GetMyCommandsOption)
Option applies one or more GetMyCommandsOption values and returns the last rollback option.
type GetMyDefaultAdministratorRightsOption ¶
type GetMyDefaultAdministratorRightsOption func(params *GetMyDefaultAdministratorRightsParams) GetMyDefaultAdministratorRightsOption
GetMyDefaultAdministratorRightsOption configures GetMyDefaultAdministratorRightsParams.
func WithGetMyDefaultAdministratorRightsForChannels ¶
func WithGetMyDefaultAdministratorRightsForChannels(value bool) GetMyDefaultAdministratorRightsOption
WithGetMyDefaultAdministratorRightsForChannels sets the ForChannels field.
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 GetMyDefaultAdministratorRightsParams ¶
type GetMyDefaultAdministratorRightsParams struct {
// 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.
ForChannels bool `json:"for_channels,omitempty"`
}
GetMyDefaultAdministratorRightsParams contains parameters for Client.GetMyDefaultAdministratorRights.
func (*GetMyDefaultAdministratorRightsParams) Option ¶
func (r *GetMyDefaultAdministratorRightsParams) Option(opts ...GetMyDefaultAdministratorRightsOption) (previous GetMyDefaultAdministratorRightsOption)
Option applies one or more GetMyDefaultAdministratorRightsOption values and returns the last rollback option.
type GetMyDescriptionOption ¶
type GetMyDescriptionOption func(params *GetMyDescriptionParams) GetMyDescriptionOption
GetMyDescriptionOption configures GetMyDescriptionParams.
func WithGetMyDescriptionLanguageCode ¶
func WithGetMyDescriptionLanguageCode(value string) GetMyDescriptionOption
WithGetMyDescriptionLanguageCode sets the LanguageCode field.
A two-letter ISO 639-1 language code or an empty string
type GetMyDescriptionParams ¶
type GetMyDescriptionParams struct {
// A two-letter ISO 639-1 language code or an empty string
LanguageCode string `json:"language_code,omitempty"`
}
GetMyDescriptionParams contains parameters for Client.GetMyDescription.
func (*GetMyDescriptionParams) Option ¶
func (r *GetMyDescriptionParams) Option(opts ...GetMyDescriptionOption) (previous GetMyDescriptionOption)
Option applies one or more GetMyDescriptionOption values and returns the last rollback option.
type GetMyNameOption ¶
type GetMyNameOption func(params *GetMyNameParams) GetMyNameOption
GetMyNameOption configures GetMyNameParams.
func WithGetMyNameLanguageCode ¶
func WithGetMyNameLanguageCode(value string) GetMyNameOption
WithGetMyNameLanguageCode sets the LanguageCode field.
A two-letter ISO 639-1 language code or an empty string
type GetMyNameParams ¶
type GetMyNameParams struct {
// A two-letter ISO 639-1 language code or an empty string
LanguageCode string `json:"language_code,omitempty"`
}
GetMyNameParams contains parameters for Client.GetMyName.
func (*GetMyNameParams) Option ¶
func (r *GetMyNameParams) Option(opts ...GetMyNameOption) (previous GetMyNameOption)
Option applies one or more GetMyNameOption values and returns the last rollback option.
type GetMyShortDescriptionOption ¶
type GetMyShortDescriptionOption func(params *GetMyShortDescriptionParams) GetMyShortDescriptionOption
GetMyShortDescriptionOption configures GetMyShortDescriptionParams.
func WithGetMyShortDescriptionLanguageCode ¶
func WithGetMyShortDescriptionLanguageCode(value string) GetMyShortDescriptionOption
WithGetMyShortDescriptionLanguageCode sets the LanguageCode field.
A two-letter ISO 639-1 language code or an empty string
type GetMyShortDescriptionParams ¶
type GetMyShortDescriptionParams struct {
// A two-letter ISO 639-1 language code or an empty string
LanguageCode string `json:"language_code,omitempty"`
}
GetMyShortDescriptionParams contains parameters for Client.GetMyShortDescription.
func (*GetMyShortDescriptionParams) Option ¶
func (r *GetMyShortDescriptionParams) Option(opts ...GetMyShortDescriptionOption) (previous GetMyShortDescriptionOption)
Option applies one or more GetMyShortDescriptionOption values and returns the last rollback option.
type GetMyStarBalanceOption ¶
type GetMyStarBalanceOption func(params *GetMyStarBalanceParams) GetMyStarBalanceOption
GetMyStarBalanceOption configures GetMyStarBalanceParams.
type GetMyStarBalanceParams ¶
type GetMyStarBalanceParams struct {
}
GetMyStarBalanceParams contains parameters for Client.GetMyStarBalance.
func (*GetMyStarBalanceParams) Option ¶
func (r *GetMyStarBalanceParams) Option(opts ...GetMyStarBalanceOption) (previous GetMyStarBalanceOption)
Option applies one or more GetMyStarBalanceOption values and returns the last rollback option.
type GetStarTransactionsOption ¶
type GetStarTransactionsOption func(params *GetStarTransactionsParams) GetStarTransactionsOption
GetStarTransactionsOption configures GetStarTransactionsParams.
func WithGetStarTransactionsLimit ¶
func WithGetStarTransactionsLimit(value int64) GetStarTransactionsOption
WithGetStarTransactionsLimit sets the Limit field.
The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100.
func WithGetStarTransactionsOffset ¶
func WithGetStarTransactionsOffset(value int64) GetStarTransactionsOption
WithGetStarTransactionsOffset sets the Offset field.
Number of transactions to skip in the response
type GetStarTransactionsParams ¶
type GetStarTransactionsParams struct {
// Number of transactions to skip in the response
Offset int64 `json:"offset,omitempty"`
// The maximum number of transactions to be retrieved.
// Values between 1-100 are accepted.
// Defaults to 100.
Limit int64 `json:"limit,omitempty"`
}
GetStarTransactionsParams contains parameters for Client.GetStarTransactions.
func (*GetStarTransactionsParams) Option ¶
func (r *GetStarTransactionsParams) Option(opts ...GetStarTransactionsOption) (previous GetStarTransactionsOption)
Option applies one or more GetStarTransactionsOption values and returns the last rollback option.
type GetStickerSetOption ¶
type GetStickerSetOption func(params *GetStickerSetParams) GetStickerSetOption
GetStickerSetOption configures GetStickerSetParams.
func WithGetStickerSetName ¶
func WithGetStickerSetName(value string) GetStickerSetOption
WithGetStickerSetName sets the Name field.
Name of the sticker set
type GetStickerSetParams ¶
type GetStickerSetParams struct {
// Name of the sticker set
Name string `json:"name"`
}
GetStickerSetParams contains parameters for Client.GetStickerSet.
func (*GetStickerSetParams) Option ¶
func (r *GetStickerSetParams) Option(opts ...GetStickerSetOption) (previous GetStickerSetOption)
Option applies one or more GetStickerSetOption values and returns the last rollback option.
type GetUpdatesOption ¶
type GetUpdatesOption func(params *GetUpdatesParams) GetUpdatesOption
GetUpdatesOption configures GetUpdatesParams.
func WithGetUpdatesAllowedUpdates ¶
func WithGetUpdatesAllowedUpdates(value []string) GetUpdatesOption
WithGetUpdatesAllowedUpdates sets the AllowedUpdates field.
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, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.
func WithGetUpdatesLimit ¶
func WithGetUpdatesLimit(value int64) GetUpdatesOption
WithGetUpdatesLimit sets the Limit field.
Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
func WithGetUpdatesOffset ¶
func WithGetUpdatesOffset(value int64) GetUpdatesOption
WithGetUpdatesOffset sets the Offset field.
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 WithGetUpdatesTimeout ¶
func WithGetUpdatesTimeout(value int64) GetUpdatesOption
WithGetUpdatesTimeout sets the Timeout field.
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 GetUpdatesParams ¶
type GetUpdatesParams struct {
// Identifier of the first update to be returned.
// Must be greater by one than the highest among the identifiers of previously received updates.
// By default, updates starting with the earliest unconfirmed update are returned.
// An update is considered confirmed as soon as [getUpdates] is called with an offset higher than its update_id.
// The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue.
// All previous updates will be forgotten.
//
// [getUpdates]: https://core.telegram.org/bots/api#getupdates
Offset int64 `json:"offset,omitempty"`
// Limits the number of updates to be retrieved.
// Values between 1-100 are accepted.
// Defaults to 100.
Limit int64 `json:"limit,omitempty"`
// Timeout in seconds for long polling.
// Defaults to 0, i.e.
// usual short polling.
// Should be positive, short polling should be used for testing purposes only.
Timeout int64 `json:"timeout,omitempty"`
// 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, message_reaction, and message_reaction_count (default).
// If not specified, the previous setting will be used.
//
// Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.
//
// [Update]: https://core.telegram.org/bots/api#update
AllowedUpdates []string `json:"allowed_updates,omitempty"`
}
GetUpdatesParams contains parameters for Client.GetUpdates.
func (*GetUpdatesParams) Option ¶
func (r *GetUpdatesParams) Option(opts ...GetUpdatesOption) (previous GetUpdatesOption)
Option applies one or more GetUpdatesOption values and returns the last rollback option.
type GetUserChatBoostsOption ¶
type GetUserChatBoostsOption func(params *GetUserChatBoostsParams) GetUserChatBoostsOption
GetUserChatBoostsOption configures GetUserChatBoostsParams.
func WithGetUserChatBoostsChatID ¶
func WithGetUserChatBoostsChatID(value string) GetUserChatBoostsOption
WithGetUserChatBoostsChatID sets the ChatID field.
Unique identifier for the chat or username of the channel (in the format @channelusername)
func WithGetUserChatBoostsUserID ¶
func WithGetUserChatBoostsUserID(value int64) GetUserChatBoostsOption
WithGetUserChatBoostsUserID sets the UserID field.
Unique identifier of the target user
type GetUserChatBoostsParams ¶
type GetUserChatBoostsParams struct {
// Unique identifier for the chat or username of the channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
}
GetUserChatBoostsParams contains parameters for Client.GetUserChatBoosts.
func (*GetUserChatBoostsParams) Option ¶
func (r *GetUserChatBoostsParams) Option(opts ...GetUserChatBoostsOption) (previous GetUserChatBoostsOption)
Option applies one or more GetUserChatBoostsOption values and returns the last rollback option.
type GetUserGiftsOption ¶
type GetUserGiftsOption func(params *GetUserGiftsParams) GetUserGiftsOption
GetUserGiftsOption configures GetUserGiftsParams.
func WithGetUserGiftsExcludeFromBlockchain ¶
func WithGetUserGiftsExcludeFromBlockchain(value bool) GetUserGiftsOption
WithGetUserGiftsExcludeFromBlockchain sets the ExcludeFromBlockchain field.
Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
func WithGetUserGiftsExcludeLimitedNonUpgradable ¶
func WithGetUserGiftsExcludeLimitedNonUpgradable(value bool) GetUserGiftsOption
WithGetUserGiftsExcludeLimitedNonUpgradable sets the ExcludeLimitedNonUpgradable field.
Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
func WithGetUserGiftsExcludeLimitedUpgradable ¶
func WithGetUserGiftsExcludeLimitedUpgradable(value bool) GetUserGiftsOption
WithGetUserGiftsExcludeLimitedUpgradable sets the ExcludeLimitedUpgradable field.
Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
func WithGetUserGiftsExcludeUnique ¶
func WithGetUserGiftsExcludeUnique(value bool) GetUserGiftsOption
WithGetUserGiftsExcludeUnique sets the ExcludeUnique field.
Pass True to exclude unique gifts
func WithGetUserGiftsExcludeUnlimited ¶
func WithGetUserGiftsExcludeUnlimited(value bool) GetUserGiftsOption
WithGetUserGiftsExcludeUnlimited sets the ExcludeUnlimited field.
Pass True to exclude gifts that can be purchased an unlimited number of times
func WithGetUserGiftsLimit ¶
func WithGetUserGiftsLimit(value int64) GetUserGiftsOption
WithGetUserGiftsLimit sets the Limit field.
The maximum number of gifts to be returned; 1-100. Defaults to 100
func WithGetUserGiftsOffset ¶
func WithGetUserGiftsOffset(value string) GetUserGiftsOption
WithGetUserGiftsOffset sets the Offset field.
Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
func WithGetUserGiftsSortByPrice ¶
func WithGetUserGiftsSortByPrice(value bool) GetUserGiftsOption
WithGetUserGiftsSortByPrice sets the SortByPrice field.
Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.
func WithGetUserGiftsUserID ¶
func WithGetUserGiftsUserID(value int64) GetUserGiftsOption
WithGetUserGiftsUserID sets the UserID field.
Unique identifier of the user
type GetUserGiftsParams ¶
type GetUserGiftsParams struct {
// Unique identifier of the user
UserID int64 `json:"user_id"`
// Pass True to exclude gifts that can be purchased an unlimited number of times
ExcludeUnlimited bool `json:"exclude_unlimited,omitempty"`
// Pass True to exclude gifts that can be purchased a limited number of times and can be upgraded to unique
ExcludeLimitedUpgradable bool `json:"exclude_limited_upgradable,omitempty"`
// Pass True to exclude gifts that can be purchased a limited number of times and can't be upgraded to unique
ExcludeLimitedNonUpgradable bool `json:"exclude_limited_non_upgradable,omitempty"`
// Pass True to exclude gifts that were assigned from the TON blockchain and can't be resold or transferred in Telegram
ExcludeFromBlockchain bool `json:"exclude_from_blockchain,omitempty"`
// Pass True to exclude unique gifts
ExcludeUnique bool `json:"exclude_unique,omitempty"`
// Pass True to sort results by gift price instead of send date.
// Sorting is applied before pagination.
SortByPrice bool `json:"sort_by_price,omitempty"`
// Offset of the first entry to return as received from the previous request; use an empty string to get the first chunk of results
Offset string `json:"offset,omitempty"`
// The maximum number of gifts to be returned; 1-100.
// Defaults to 100
Limit int64 `json:"limit,omitempty"`
}
GetUserGiftsParams contains parameters for Client.GetUserGifts.
func (*GetUserGiftsParams) Option ¶
func (r *GetUserGiftsParams) Option(opts ...GetUserGiftsOption) (previous GetUserGiftsOption)
Option applies one or more GetUserGiftsOption values and returns the last rollback option.
type GetUserProfileAudiosOption ¶
type GetUserProfileAudiosOption func(params *GetUserProfileAudiosParams) GetUserProfileAudiosOption
GetUserProfileAudiosOption configures GetUserProfileAudiosParams.
func WithGetUserProfileAudiosLimit ¶
func WithGetUserProfileAudiosLimit(value int64) GetUserProfileAudiosOption
WithGetUserProfileAudiosLimit sets the Limit field.
Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.
func WithGetUserProfileAudiosOffset ¶
func WithGetUserProfileAudiosOffset(value int64) GetUserProfileAudiosOption
WithGetUserProfileAudiosOffset sets the Offset field.
Sequential number of the first audio to be returned. By default, all audios are returned.
func WithGetUserProfileAudiosUserID ¶
func WithGetUserProfileAudiosUserID(value int64) GetUserProfileAudiosOption
WithGetUserProfileAudiosUserID sets the UserID field.
Unique identifier of the target user
type GetUserProfileAudiosParams ¶
type GetUserProfileAudiosParams struct {
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// Sequential number of the first audio to be returned.
// By default, all audios are returned.
Offset int64 `json:"offset,omitempty"`
// Limits the number of audios to be retrieved.
// Values between 1-100 are accepted.
// Defaults to 100.
Limit int64 `json:"limit,omitempty"`
}
GetUserProfileAudiosParams contains parameters for Client.GetUserProfileAudios.
func (*GetUserProfileAudiosParams) Option ¶
func (r *GetUserProfileAudiosParams) Option(opts ...GetUserProfileAudiosOption) (previous GetUserProfileAudiosOption)
Option applies one or more GetUserProfileAudiosOption values and returns the last rollback option.
type GetUserProfilePhotosOption ¶
type GetUserProfilePhotosOption func(params *GetUserProfilePhotosParams) GetUserProfilePhotosOption
GetUserProfilePhotosOption configures GetUserProfilePhotosParams.
func WithGetUserProfilePhotosLimit ¶
func WithGetUserProfilePhotosLimit(value int64) GetUserProfilePhotosOption
WithGetUserProfilePhotosLimit sets the Limit field.
Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
func WithGetUserProfilePhotosOffset ¶
func WithGetUserProfilePhotosOffset(value int64) GetUserProfilePhotosOption
WithGetUserProfilePhotosOffset sets the Offset field.
Sequential number of the first photo to be returned. By default, all photos are returned.
func WithGetUserProfilePhotosUserID ¶
func WithGetUserProfilePhotosUserID(value int64) GetUserProfilePhotosOption
WithGetUserProfilePhotosUserID sets the UserID field.
Unique identifier of the target user
type GetUserProfilePhotosParams ¶
type GetUserProfilePhotosParams struct {
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// Sequential number of the first photo to be returned.
// By default, all photos are returned.
Offset int64 `json:"offset,omitempty"`
// Limits the number of photos to be retrieved.
// Values between 1-100 are accepted.
// Defaults to 100.
Limit int64 `json:"limit,omitempty"`
}
GetUserProfilePhotosParams contains parameters for Client.GetUserProfilePhotos.
func (*GetUserProfilePhotosParams) Option ¶
func (r *GetUserProfilePhotosParams) Option(opts ...GetUserProfilePhotosOption) (previous GetUserProfilePhotosOption)
Option applies one or more GetUserProfilePhotosOption values and returns the last rollback option.
type GetWebhookInfoOption ¶
type GetWebhookInfoOption func(params *GetWebhookInfoParams) GetWebhookInfoOption
GetWebhookInfoOption configures GetWebhookInfoParams.
type GetWebhookInfoParams ¶
type GetWebhookInfoParams struct {
}
GetWebhookInfoParams contains parameters for Client.GetWebhookInfo.
func (*GetWebhookInfoParams) Option ¶
func (r *GetWebhookInfoParams) Option(opts ...GetWebhookInfoOption) (previous GetWebhookInfoOption)
Option applies one or more GetWebhookInfoOption values and returns the last rollback option.
type Gift ¶
type Gift struct {
// Unique identifier of the gift
ID string `json:"id"`
// The sticker that represents the gift
Sticker Sticker `json:"sticker"`
// The number of Telegram Stars that must be paid to send the sticker
StarCount int64 `json:"star_count"`
// Optional.
// The number of Telegram Stars that must be paid to upgrade the gift to a unique one
UpgradeStarCount int64 `json:"upgrade_star_count,omitempty"`
// Optional.
// True, if the gift can only be purchased by Telegram Premium subscribers
IsPremium bool `json:"is_premium,omitempty"`
// Optional.
// True, if the gift can be used (after being upgraded) to customize a user's appearance
HasColors bool `json:"has_colors,omitempty"`
// Optional.
// The total number of gifts of this type that can be sent by all users; for limited gifts only
TotalCount int64 `json:"total_count,omitempty"`
// Optional.
// The number of remaining gifts of this type that can be sent by all users; for limited gifts only
RemainingCount int64 `json:"remaining_count,omitempty"`
// Optional.
// The total number of gifts of this type that can be sent by the bot; for limited gifts only
PersonalTotalCount int64 `json:"personal_total_count,omitempty"`
// Optional.
// The number of remaining gifts of this type that can be sent by the bot; for limited gifts only
PersonalRemainingCount int64 `json:"personal_remaining_count,omitempty"`
// Optional.
// Background of the gift
Background *GiftBackground `json:"background,omitempty"`
// Optional.
// The total number of different unique gifts that can be obtained by upgrading the gift
UniqueGiftVariantCount int64 `json:"unique_gift_variant_count,omitempty"`
// Optional.
// Information about the chat that published the gift
PublisherChat *Chat `json:"publisher_chat,omitempty"`
}
Gift
This object represents a gift that can be sent by the bot.
type GiftBackground ¶
type GiftBackground struct {
// Center color of the background in RGB format
CenterColor int64 `json:"center_color"`
// Edge color of the background in RGB format
EdgeColor int64 `json:"edge_color"`
// Text color of the background in RGB format
TextColor int64 `json:"text_color"`
}
GiftBackground
This object describes the background of a gift.
type GiftInfo ¶
type GiftInfo struct {
// Information about the gift
Gift Gift `json:"gift"`
// Optional.
// Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
OwnedGiftID string `json:"owned_gift_id,omitempty"`
// Optional.
// Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible
ConvertStarCount int64 `json:"convert_star_count,omitempty"`
// Optional.
// Number of Telegram Stars that were prepaid for the ability to upgrade the gift
PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count,omitempty"`
// Optional.
// True, if the gift's upgrade was purchased after the gift was sent
IsUpgradeSeparate bool `json:"is_upgrade_separate,omitempty"`
// Optional.
// True, if the gift can be upgraded to a unique gift
CanBeUpgraded bool `json:"can_be_upgraded,omitempty"`
// Optional.
// Text of the message that was added to the gift
Text string `json:"text,omitempty"`
// Optional.
// Special entities that appear in the text
Entities []MessageEntity `json:"entities,omitempty"`
// Optional.
// True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
IsPrivate bool `json:"is_private,omitempty"`
// Optional.
// Unique number reserved for this gift when upgraded.
// See the number field in [UniqueGift]
//
// [UniqueGift]: https://core.telegram.org/bots/api#uniquegift
UniqueGiftNumber int64 `json:"unique_gift_number,omitempty"`
}
GiftInfo
Describes a service message about a regular gift that was sent or received.
type GiftPremiumSubscriptionOption ¶
type GiftPremiumSubscriptionOption func(params *GiftPremiumSubscriptionParams) GiftPremiumSubscriptionOption
GiftPremiumSubscriptionOption configures GiftPremiumSubscriptionParams.
func WithGiftPremiumSubscriptionMonthCount ¶
func WithGiftPremiumSubscriptionMonthCount(value int64) GiftPremiumSubscriptionOption
WithGiftPremiumSubscriptionMonthCount sets the MonthCount field.
Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
func WithGiftPremiumSubscriptionStarCount ¶
func WithGiftPremiumSubscriptionStarCount(value int64) GiftPremiumSubscriptionOption
WithGiftPremiumSubscriptionStarCount sets the StarCount field.
Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
func WithGiftPremiumSubscriptionText ¶
func WithGiftPremiumSubscriptionText(value string) GiftPremiumSubscriptionOption
WithGiftPremiumSubscriptionText sets the Text field.
Text that will be shown along with the service message about the subscription; 0-128 characters
func WithGiftPremiumSubscriptionTextEntities ¶
func WithGiftPremiumSubscriptionTextEntities(value []MessageEntity) GiftPremiumSubscriptionOption
WithGiftPremiumSubscriptionTextEntities sets the TextEntities field.
A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
func WithGiftPremiumSubscriptionTextParseMode ¶
func WithGiftPremiumSubscriptionTextParseMode(value string) GiftPremiumSubscriptionOption
WithGiftPremiumSubscriptionTextParseMode sets the TextParseMode field.
Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
func WithGiftPremiumSubscriptionUserID ¶
func WithGiftPremiumSubscriptionUserID(value int64) GiftPremiumSubscriptionOption
WithGiftPremiumSubscriptionUserID sets the UserID field.
Unique identifier of the target user who will receive a Telegram Premium subscription
type GiftPremiumSubscriptionParams ¶
type GiftPremiumSubscriptionParams struct {
// Unique identifier of the target user who will receive a Telegram Premium subscription
UserID int64 `json:"user_id"`
// Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
MonthCount int64 `json:"month_count"`
// Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
StarCount int64 `json:"star_count"`
// Text that will be shown along with the service message about the subscription; 0-128 characters
Text string `json:"text,omitempty"`
// Mode for parsing entities in the text.
// See [formatting options] for more details.
// Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
TextParseMode string `json:"text_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the gift text.
// It can be specified instead of text_parse_mode.
// Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
TextEntities []MessageEntity `json:"text_entities,omitempty"`
}
GiftPremiumSubscriptionParams contains parameters for Client.GiftPremiumSubscription.
func (*GiftPremiumSubscriptionParams) Option ¶
func (r *GiftPremiumSubscriptionParams) Option(opts ...GiftPremiumSubscriptionOption) (previous GiftPremiumSubscriptionOption)
Option applies one or more GiftPremiumSubscriptionOption values and returns the last rollback option.
type Gifts ¶
type Gifts struct {
// The list of gifts
Gifts []Gift `json:"gifts"`
}
Gifts
This object represent a list of gifts.
type Giveaway ¶
type Giveaway struct {
// The list of chats which the user must join to participate in the giveaway
Chats []Chat `json:"chats"`
// Point in time (Unix timestamp) when winners of the giveaway will be selected
WinnersSelectionDate int64 `json:"winners_selection_date"`
// The number of users which are supposed to be selected as winners of the giveaway
WinnerCount int64 `json:"winner_count"`
// Optional.
// True, if only users who join the chats after the giveaway started should be eligible to win
OnlyNewMembers bool `json:"only_new_members,omitempty"`
// Optional.
// True, if the list of giveaway winners will be visible to everyone
HasPublicWinners bool `json:"has_public_winners,omitempty"`
// Optional.
// Description of additional giveaway prize
PrizeDescription string `json:"prize_description,omitempty"`
// Optional.
// A list of two-letter [ISO 3166-1 alpha-2] country codes indicating the countries from which eligible users for the giveaway must come.
// If empty, then all users can participate in the giveaway.
// Users with a phone number that was bought on Fragment can always participate in giveaways.
//
// [ISO 3166-1 alpha-2]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
CountryCodes []string `json:"country_codes,omitempty"`
// Optional.
// The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
PrizeStarCount int64 `json:"prize_star_count,omitempty"`
// Optional.
// The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
PremiumSubscriptionMonthCount int64 `json:"premium_subscription_month_count,omitempty"`
}
Giveaway
This object represents a message about a scheduled giveaway.
type GiveawayCompleted ¶
type GiveawayCompleted struct {
// Number of winners in the giveaway
WinnerCount int64 `json:"winner_count"`
// Optional.
// Number of undistributed prizes
UnclaimedPrizeCount int64 `json:"unclaimed_prize_count,omitempty"`
// Optional.
// Message with the giveaway that was completed, if it wasn't deleted
GiveawayMessage *Message `json:"giveaway_message,omitempty"`
// Optional.
// True, if the giveaway is a Telegram Star giveaway.
// Otherwise, currently, the giveaway is a Telegram Premium giveaway.
IsStarGiveaway bool `json:"is_star_giveaway,omitempty"`
}
GiveawayCompleted
This object represents a service message about the completion of a giveaway without public winners.
type GiveawayCreated ¶
type GiveawayCreated struct {
// Optional.
// The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
PrizeStarCount int64 `json:"prize_star_count,omitempty"`
}
GiveawayCreated
This object represents a service message about the creation of a scheduled giveaway.
type GiveawayWinners ¶
type GiveawayWinners struct {
// The chat that created the giveaway
Chat Chat `json:"chat"`
// Identifier of the message with the giveaway in the chat
GiveawayMessageID int64 `json:"giveaway_message_id"`
// Point in time (Unix timestamp) when winners of the giveaway were selected
WinnersSelectionDate int64 `json:"winners_selection_date"`
// Total number of winners in the giveaway
WinnerCount int64 `json:"winner_count"`
// List of up to 100 winners of the giveaway
Winners []User `json:"winners"`
// Optional.
// The number of other chats the user had to join in order to be eligible for the giveaway
AdditionalChatCount int64 `json:"additional_chat_count,omitempty"`
// Optional.
// The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
PrizeStarCount int64 `json:"prize_star_count,omitempty"`
// Optional.
// The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
PremiumSubscriptionMonthCount int64 `json:"premium_subscription_month_count,omitempty"`
// Optional.
// Number of undistributed prizes
UnclaimedPrizeCount int64 `json:"unclaimed_prize_count,omitempty"`
// Optional.
// True, if only users who had joined the chats after the giveaway started were eligible to win
OnlyNewMembers bool `json:"only_new_members,omitempty"`
// Optional.
// True, if the giveaway was canceled because the payment for it was refunded
WasRefunded bool `json:"was_refunded,omitempty"`
// Optional.
// Description of additional giveaway prize
PrizeDescription string `json:"prize_description,omitempty"`
}
GiveawayWinners
This object represents a message about the completion of a giveaway with public winners.
type HandlerFunc ¶
HandlerFunc is a function that handles a request.
type HandlerFuncErr ¶
HandlerFuncErr is a function that handles an error.
type HandlerFuncPanic ¶
HandlerFuncPanic is a function that handles a panic.
type HideGeneralForumTopicOption ¶
type HideGeneralForumTopicOption func(params *HideGeneralForumTopicParams) HideGeneralForumTopicOption
HideGeneralForumTopicOption configures HideGeneralForumTopicParams.
func WithHideGeneralForumTopicChatID ¶
func WithHideGeneralForumTopicChatID(value string) HideGeneralForumTopicOption
WithHideGeneralForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type HideGeneralForumTopicParams ¶
type HideGeneralForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
}
HideGeneralForumTopicParams contains parameters for Client.HideGeneralForumTopic.
func (*HideGeneralForumTopicParams) Option ¶
func (r *HideGeneralForumTopicParams) Option(opts ...HideGeneralForumTopicOption) (previous HideGeneralForumTopicOption)
Option applies one or more HideGeneralForumTopicOption values and returns the last rollback option.
type Identifier ¶
type Identifier interface {
Identifier() string
}
Identifier is an interface for types that have a string identifier.
type InaccessibleMessage ¶
type InaccessibleMessage struct {
// Chat the message belonged to
Chat Chat `json:"chat"`
// Unique message identifier inside the chat
MessageID int64 `json:"message_id"`
// Always 0.
// The field can be used to differentiate regular and inaccessible messages.
Date int64 `json:"date"`
}
InaccessibleMessage
This object describes a message that was deleted or is otherwise inaccessible to the bot.
type InlineKeyboard ¶
type InlineKeyboard = []InlineKeyboardRow
InlineKeyboard represents an inline keyboard markup.
type InlineKeyboardButton ¶
type InlineKeyboardButton struct {
// Label text on the button
Text string `json:"text"`
// Optional.
// Unique identifier of the custom emoji shown before the text of the button.
// Can only be used by bots that purchased additional usernames on [Fragment] or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
//
// [Fragment]: https://fragment.com
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
// Optional.
// Style of the button.
// Must be one of “danger” (red), “success” (green) or “primary” (blue).
// If omitted, then an app-specific style is used.
Style string `json:"style,omitempty"`
// 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 identifier 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 the button is pressed, 1-64 bytes
//
// [callback query]: https://core.telegram.org/bots/api#callbackquery
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.
// Not supported for messages sent on behalf of a Telegram Business account.
//
// [Web App]: https://core.telegram.org/bots/webapps
// [answerWebAppQuery]: https://core.telegram.org/bots/api#answerwebappquery
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].
//
// [Telegram Login Widget]: https://core.telegram.org/widgets/login
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.
// Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
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.
// Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
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.
// Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_chat,omitempty"`
// Optional.
// Description of the button that copies the specified text to the clipboard.
CopyText *CopyTextButton `json:"copy_text,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].
// Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
//
// NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
//
// [Pay button]: https://core.telegram.org/bots/api#payments
Pay bool `json:"pay,omitempty"`
}
InlineKeyboardButton
This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.
func (*InlineKeyboardButton) SetText ¶
func (b *InlineKeyboardButton) SetText(text string) *InlineKeyboardButton
SetText sets the text of the button.
func (*InlineKeyboardButton) WithArgs ¶
func (b *InlineKeyboardButton) WithArgs(args ...string) InlineKeyboardButton
WithArgs returns a copy of the button with CallbackData appended with arguments. Format: 'callback_data args[0] args[1] ... args[N-1] args[N]'.
func (*InlineKeyboardButton) WithPayload ¶
func (b *InlineKeyboardButton) WithPayload(payload string) InlineKeyboardButton
WithPayload returns a copy of the button with CallbackData appended with a payload. Format: 'callback_data payload'.
type InlineKeyboardMarkup ¶
type InlineKeyboardMarkup struct {
// Array of button rows, each represented by an Array of [InlineKeyboardButton] objects
//
// [InlineKeyboardButton]: https://core.telegram.org/bots/api#inlinekeyboardbutton
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}
InlineKeyboardMarkup
This object represents an inline keyboard that appears right next to the message it belongs to.
type InlineKeyboardRow ¶
type InlineKeyboardRow = []InlineKeyboardButton
InlineKeyboardRow represents a row of inline keyboard buttons.
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 string `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 ¶
type InlineQueryResult struct {
*InlineQueryResultCachedAudio
*InlineQueryResultCachedDocument
*InlineQueryResultCachedGif
*InlineQueryResultCachedMpeg4Gif
*InlineQueryResultCachedPhoto
*InlineQueryResultCachedSticker
*InlineQueryResultCachedVideo
*InlineQueryResultCachedVoice
*InlineQueryResultArticle
*InlineQueryResultAudio
*InlineQueryResultContact
*InlineQueryResultGame
*InlineQueryResultDocument
*InlineQueryResultGif
*InlineQueryResultLocation
*InlineQueryResultMpeg4Gif
*InlineQueryResultPhoto
*InlineQueryResultVenue
*InlineQueryResultVideo
*InlineQueryResultVoice
}
InlineQueryResult
This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
InlineQueryResultCachedDocument
InlineQueryResultCachedMpeg4Gif
InlineQueryResultCachedSticker
Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.
func (*InlineQueryResult) MarshalJSON ¶
func (r *InlineQueryResult) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of InlineQueryResult.
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
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Optional.
// URL of the result
URL string `json:"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 int64 `json:"thumbnail_width,omitempty"`
// Optional.
// Thumbnail height
ThumbnailHeight int64 `json:"thumbnail_height,omitempty"`
}
InlineQueryResultArticle
Represents a link to an article or web page.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Performer
Performer string `json:"performer,omitempty"`
// Optional.
// Audio duration in seconds
AudioDuration int64 `json:"audio_duration,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
type InlineQueryResultCachedGif ¶
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
type InlineQueryResultCachedMpeg4Gif ¶
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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]: https://en.wikipedia.org/wiki/VCard
Vcard string `json:"vcard,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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 int64 `json:"thumbnail_width,omitempty"`
// Optional.
// Thumbnail height
ThumbnailHeight int64 `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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// A valid URL for the file
DocumentUrl string `json:"document_url"`
// 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
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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 int64 `json:"thumbnail_width,omitempty"`
// Optional.
// Thumbnail height
ThumbnailHeight int64 `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.
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
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
InlineQueryResultGame
Represents a Game.
type InlineQueryResultGif ¶
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
GifUrl string `json:"gif_url"`
// Optional.
// Width of the GIF
GifWidth int64 `json:"gif_width,omitempty"`
// Optional.
// Height of the GIF
GifHeight int64 `json:"gif_height,omitempty"`
// Optional.
// Duration of the GIF in seconds
GifDuration int64 `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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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 during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
LivePeriod int64 `json:"live_period,omitempty"`
// Optional.
// For live locations, a direction in which the user is moving, in degrees.
// Must be between 1 and 360 if specified.
Heading int64 `json:"heading,omitempty"`
// Optional.
// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters.
// Must be between 1 and 100000 if specified.
ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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 int64 `json:"thumbnail_width,omitempty"`
// Optional.
// Thumbnail height
ThumbnailHeight int64 `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.
type InlineQueryResultMpeg4Gif ¶
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
Mpeg4Url string `json:"mpeg4_url"`
// Optional.
// Video width
Mpeg4Width int64 `json:"mpeg4_width,omitempty"`
// Optional.
// Video height
Mpeg4Height int64 `json:"mpeg4_height,omitempty"`
// Optional.
// Video duration in seconds
Mpeg4Duration int64 `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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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 int64 `json:"photo_width,omitempty"`
// Optional.
// Height of the photo
PhotoHeight int64 `json:"photo_height,omitempty"`
// Optional.
// Title for the result
Title string `json:"title,omitempty"`
// Optional.
// Short description of the result
Description string `json:"description,omitempty"`
// Optional.
// Caption of the photo to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional.
// Mode for parsing entities in the photo caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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].)
//
// [supported types]: https://developers.google.com/places/web-service/supported_types
GooglePlaceType string `json:"google_place_type,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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 int64 `json:"thumbnail_width,omitempty"`
// Optional.
// Thumbnail height
ThumbnailHeight int64 `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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// Video width
VideoWidth int64 `json:"video_width,omitempty"`
// Optional.
// Video height
VideoHeight int64 `json:"video_height,omitempty"`
// Optional.
// Video duration in seconds
VideoDuration int64 `json:"video_duration,omitempty"`
// Optional.
// Short description of the result
Description string `json:"description,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Recording duration in seconds
VoiceDuration int64 `json:"voice_duration,omitempty"`
// Optional.
// [Inline keyboard] attached to the message
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
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.
type InlineQueryResultsButton ¶
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.
//
// [Web App]: https://core.telegram.org/bots/webapps
// [switchInlineQuery]: https://core.telegram.org/bots/webapps#initializing-mini-apps
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.
//
// [Deep-linking]: https://core.telegram.org/bots/features#deep-linking
// [switch_inline]: https://core.telegram.org/bots/api#inlinekeyboardmarkup
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 InputChecklist ¶
type InputChecklist struct {
// Title of the checklist; 1-255 characters after entities parsing
Title string `json:"title"`
// Optional.
// Mode for parsing entities in the title.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the title, which can be specified instead of parse_mode.
// Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed.
TitleEntities []MessageEntity `json:"title_entities,omitempty"`
// List of 1-30 tasks in the checklist
Tasks []InputChecklistTask `json:"tasks"`
// Optional.
// Pass True if other users can add tasks to the checklist
OthersCanAddTasks bool `json:"others_can_add_tasks,omitempty"`
// Optional.
// Pass True if other users can mark tasks as done or not done in the checklist
OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"`
}
InputChecklist
Describes a checklist to create.
type InputChecklistTask ¶
type InputChecklistTask struct {
// Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist
ID int64 `json:"id"`
// Text of the task; 1-100 characters after entities parsing
Text string `json:"text"`
// Optional.
// Mode for parsing entities in the text.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the text, which can be specified instead of parse_mode.
// Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are allowed.
TextEntities []MessageEntity `json:"text_entities,omitempty"`
}
InputChecklistTask
Describes a task to add to a checklist.
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]: https://en.wikipedia.org/wiki/VCard
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 {
FileID string
FileURL string
File io.Reader
FileName string
// contains filtered or unexported fields
}
InputFile represents a file upload or an existing file reference.
func (*InputFile) AppendText ¶
AppendText implements encoding.TextAppender interface.
func (*InputFile) MarshalText ¶
MarshalText implements encoding.TextMarshaler interface.
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 it for your internal processes.
Payload string `json:"payload"`
// Optional.
// Payment provider token, obtained via [@BotFather].
// Pass an empty string for payments in [Telegram Stars].
//
// [@BotFather]: https://t.me/botfather
// [Telegram Stars]: https://t.me/BotNews/90
ProviderToken string `json:"provider_token,omitempty"`
// Three-letter ISO 4217 currency code, see [more on currencies].
// Pass “XTR” for payments in [Telegram Stars].
//
// [more on currencies]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
Currency string `json:"currency"`
// Price breakdown, a JSON-serialized list of components (e.g.
// product price, tax, discount, delivery cost, delivery tax, bonus, etc.).
// Must contain exactly one item for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
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.
// Not supported for payments in [Telegram Stars].
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
// [Telegram Stars]: https://t.me/BotNews/90
MaxTipAmount int64 `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 []int64 `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 int64 `json:"photo_size,omitempty"`
// Optional.
// Photo width
PhotoWidth int64 `json:"photo_width,omitempty"`
// Optional.
// Photo height
PhotoHeight int64 `json:"photo_height,omitempty"`
// Optional.
// Pass True if you require the user's full name to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedName bool `json:"need_name,omitempty"`
// Optional.
// Pass True if you require the user's phone number to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedPhoneNumber bool `json:"need_phone_number,omitempty"`
// Optional.
// Pass True if you require the user's email address to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedEmail bool `json:"need_email,omitempty"`
// Optional.
// Pass True if you require the user's shipping address to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedShippingAddress bool `json:"need_shipping_address,omitempty"`
// Optional.
// Pass True if the user's phone number should be sent to the provider.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"`
// Optional.
// Pass True if the user's email address should be sent to the provider.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
SendEmailToProvider bool `json:"send_email_to_provider,omitempty"`
// Optional.
// Pass True if the final price depends on the shipping method.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
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 during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
LivePeriod int64 `json:"live_period,omitempty"`
// Optional.
// For live locations, a direction in which the user is moving, in degrees.
// Must be between 1 and 360 if specified.
Heading int64 `json:"heading,omitempty"`
// Optional.
// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters.
// Must be between 1 and 100000 if specified.
ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"`
}
InputLocationMessageContent
Represents the content of a location message to be sent as the result of an inline query.
type InputMedia ¶
type InputMedia struct {
*InputMediaAnimation
*InputMediaDocument
*InputMediaAudio
*InputMediaPhoto
*InputMediaVideo
}
InputMedia
This object represents the content of a media message to be sent. It should be one of
func (*InputMedia) MarshalJSON ¶
func (r *InputMedia) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of InputMedia.
func (*InputMedia) UnmarshalJSON ¶
func (r *InputMedia) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching InputMedia subtype.
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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// Animation width
Width int64 `json:"width,omitempty"`
// Optional.
// Animation height
Height int64 `json:"height,omitempty"`
// Optional.
// Animation duration in seconds
Duration int64 `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.
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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Duration of the audio in seconds
Duration int64 `json:"duration,omitempty"`
// Optional.
// Performer of the audio
Performer string `json:"performer,omitempty"`
// Optional.
// Title of the audio
Title string `json:"title,omitempty"`
}
InputMediaAudio
Represents an audio file to be treated as music to be sent.
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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Disables automatic server-side content type detection for files uploaded using multipart/form-data.
// Always True, if the document is sent as part of an album.
DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"`
}
InputMediaDocument
Represents a general file to be sent.
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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,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.
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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Optional.
// Cover for the video in the message.
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Cover *InputFile `json:"cover,omitempty"`
// Optional.
// Start timestamp for the video in the message
StartTimestamp int64 `json:"start_timestamp,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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional.
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// Video width
Width int64 `json:"width,omitempty"`
// Optional.
// Video height
Height int64 `json:"height,omitempty"`
// Optional.
// Video duration in seconds
Duration int64 `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.
type InputMessageContent ¶
type InputMessageContent struct {
*InputTextMessageContent
*InputLocationMessageContent
*InputVenueMessageContent
*InputContactMessageContent
*InputInvoiceMessageContent
}
InputMessageContent
This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:
func (*InputMessageContent) MarshalJSON ¶
func (r *InputMessageContent) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of InputMessageContent.
type InputPaidMedia ¶
type InputPaidMedia struct {
*InputPaidMediaPhoto
*InputPaidMediaVideo
}
InputPaidMedia
This object describes the paid media to be sent. Currently, it can be one of
func (*InputPaidMedia) MarshalJSON ¶
func (r *InputPaidMedia) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of InputPaidMedia.
func (*InputPaidMedia) UnmarshalJSON ¶
func (r *InputPaidMedia) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching InputPaidMedia subtype.
type InputPaidMediaPhoto ¶
type InputPaidMediaPhoto struct {
// Type of the media, 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `json:"media"`
}
InputPaidMediaPhoto
The paid media to send is a photo.
type InputPaidMediaVideo ¶
type InputPaidMediaVideo struct {
// Type of the media, 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Media InputFile `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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Optional.
// Cover for the video in the message.
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Cover *InputFile `json:"cover,omitempty"`
// Optional.
// Start timestamp for the video in the message
StartTimestamp int64 `json:"start_timestamp,omitempty"`
// Optional.
// Video width
Width int64 `json:"width,omitempty"`
// Optional.
// Video height
Height int64 `json:"height,omitempty"`
// Optional.
// Video duration in seconds
Duration int64 `json:"duration,omitempty"`
// Optional.
// Pass True if the uploaded video is suitable for streaming
SupportsStreaming bool `json:"supports_streaming,omitempty"`
}
InputPaidMediaVideo
The paid media to send is a video.
type InputPollOption ¶
type InputPollOption struct {
// Option text, 1-100 characters
Text string `json:"text"`
// Optional.
// Mode for parsing entities in the text.
// See [formatting options] for more details.
// Currently, only custom emoji entities are allowed
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
TextParseMode string `json:"text_parse_mode,omitempty"`
// Optional.
// A JSON-serialized list of special entities that appear in the poll option text.
// It can be specified instead of text_parse_mode
TextEntities []MessageEntity `json:"text_entities,omitempty"`
}
InputPollOption
This object contains information about one answer option in a poll to be sent.
type InputProfilePhoto ¶
type InputProfilePhoto struct {
*InputProfilePhotoStatic
*InputProfilePhotoAnimated
}
InputProfilePhoto
This object describes a profile photo to set. Currently, it can be one of
func (*InputProfilePhoto) MarshalJSON ¶
func (r *InputProfilePhoto) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of InputProfilePhoto.
func (*InputProfilePhoto) UnmarshalJSON ¶
func (r *InputProfilePhoto) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching InputProfilePhoto subtype.
type InputProfilePhotoAnimated ¶
type InputProfilePhotoAnimated struct {
// Type of the profile photo, must be animated
Type string `json:"type"`
// The animated profile photo.
// Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Animation InputFile `json:"animation"`
// Optional.
// Timestamp in seconds of the frame that will be used as the static profile photo.
// Defaults to 0.0.
MainFrameTimestamp float64 `json:"main_frame_timestamp,omitempty"`
}
InputProfilePhotoAnimated
An animated profile photo in the MPEG4 format.
type InputProfilePhotoStatic ¶
type InputProfilePhotoStatic struct {
// Type of the profile photo, must be static
Type string `json:"type"`
// The static profile photo.
// Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Photo InputFile `json:"photo"`
}
InputProfilePhotoStatic
A static profile photo in the .JPG format.
type InputSticker ¶
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, or pass “attach://<file_attach_name>” to upload a new file 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Sticker InputFile `json:"sticker"`
// Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video
Format string `json:"format"`
// 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 InputStoryContent ¶
type InputStoryContent struct {
*InputStoryContentPhoto
*InputStoryContentVideo
}
InputStoryContent
This object describes the content of a story to post. Currently, it can be one of
func (*InputStoryContent) MarshalJSON ¶
func (r *InputStoryContent) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of InputStoryContent.
func (*InputStoryContent) UnmarshalJSON ¶
func (r *InputStoryContent) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching InputStoryContent subtype.
type InputStoryContentPhoto ¶
type InputStoryContentPhoto struct {
// Type of the content, must be photo
Type string `json:"type"`
// The photo to post as a story.
// The photo must be of the size 1080x1920 and must not exceed 10 MB.
// The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the photo was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Photo InputFile `json:"photo"`
}
InputStoryContentPhoto
Describes a photo to post as a story.
type InputStoryContentVideo ¶
type InputStoryContentVideo struct {
// Type of the content, must be video
Type string `json:"type"`
// The video to post as a story.
// The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB.
// The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the video was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Video InputFile `json:"video"`
// Optional.
// Precise duration of the video in seconds; 0-60
Duration float64 `json:"duration,omitempty"`
// Optional.
// Timestamp in seconds of the frame that will be used as the static cover for the story.
// Defaults to 0.0.
CoverFrameTimestamp float64 `json:"cover_frame_timestamp,omitempty"`
// Optional.
// Pass True if the video has no sound
IsAnimation bool `json:"is_animation,omitempty"`
}
InputStoryContentVideo
Describes a video to post as a story.
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.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// Optional.
// List of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
// Optional.
// Link preview generation options for the message
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,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].)
//
// [supported types]: https://developers.google.com/places/web-service/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, or “XTR” for payments in [Telegram Stars]
//
// [currency]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
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).
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
TotalAmount int64 `json:"total_amount"`
}
Invoice
This object contains basic information about an invoice.
type JSONWrapper ¶
type JSONWrapper[T any] struct { // contains filtered or unexported fields }
JSONWrapper is a generic wrapper for handling JSON serialization/deserialization in SQL databases.
func AsJSON ¶
func AsJSON[T any](pointer *T) JSONWrapper[T]
AsJSON wraps a pointer to a struct to implement sql.Scanner and driver.Valuer interfaces. This allows storing complex types as JSON in the database.
func (JSONWrapper[T]) Scan ¶
func (w JSONWrapper[T]) Scan(src any) error
Scan implements the sql.Scanner interface for JSON deserialization.
type KeyboardButton ¶
type KeyboardButton struct {
// Text of the button.
// If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed
Text string `json:"text"`
// Optional.
// Unique identifier of the custom emoji shown before the text of the button.
// Can only be used by bots that purchased additional usernames on [Fragment] or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
//
// [Fragment]: https://fragment.com
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
// Optional.
// Style of the button.
// Must be one of “danger” (red), “success” (green) or “primary” (blue).
// If omitted, then an app-specific style is used.
Style string `json:"style,omitempty"`
// Optional.
// If specified, pressing the button will open a list of suitable users.
// Identifiers of selected users will be sent to the bot in a “users_shared” service message.
// Available in private chats only.
RequestUsers *KeyboardButtonRequestUsers `json:"request_users,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.
//
// [Web App]: https://core.telegram.org/bots/webapps
WebApp *WebAppInfo `json:"web_app,omitempty"`
}
KeyboardButton
This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
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 ¶
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
//
// [ChatShared]: https://core.telegram.org/bots/api#chatshared
RequestID int64 `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"`
// Optional.
// Pass True to request the chat's title
RequestTitle bool `json:"request_title,omitempty"`
// Optional.
// Pass True to request the chat's username
RequestUsername bool `json:"request_username,omitempty"`
// Optional.
// Pass True to request the chat's photo
RequestPhoto bool `json:"request_photo,omitempty"`
}
KeyboardButtonRequestChat
This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats ».
type KeyboardButtonRequestUsers ¶
type KeyboardButtonRequestUsers struct {
// Signed 32-bit identifier of the request that will be received back in the [UsersShared] object.
// Must be unique within the message
//
// [UsersShared]: https://core.telegram.org/bots/api#usersshared
RequestID int64 `json:"request_id"`
// Optional.
// Pass True to request bots, pass False to request regular users.
// If not specified, no additional restrictions are applied.
UserIsBot bool `json:"user_is_bot,omitempty"`
// Optional.
// Pass True to request premium users, pass False to request non-premium users.
// If not specified, no additional restrictions are applied.
UserIsPremium bool `json:"user_is_premium,omitempty"`
// Optional.
// The maximum number of users to be selected; 1-10.
// Defaults to 1.
MaxQuantity int64 `json:"max_quantity,omitempty"`
// Optional.
// Pass True to request the users' first and last names
RequestName bool `json:"request_name,omitempty"`
// Optional.
// Pass True to request the users' usernames
RequestUsername bool `json:"request_username,omitempty"`
// Optional.
// Pass True to request the users' photos
RequestPhoto bool `json:"request_photo,omitempty"`
}
KeyboardButtonRequestUsers
This object defines the criteria used to request suitable users. Information about the selected users 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).
//
// [currency]: https://core.telegram.org/bots/payments#supported-currencies
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
Amount int64 `json:"amount"`
}
LabeledPrice
This object represents a portion of the price for goods or services.
type LeaveChatOption ¶
type LeaveChatOption func(params *LeaveChatParams) LeaveChatOption
LeaveChatOption configures LeaveChatParams.
func WithLeaveChatChatID ¶
func WithLeaveChatChatID(value string) LeaveChatOption
WithLeaveChatChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername). Channel direct messages chats aren't supported; leave the corresponding channel instead.
type LeaveChatParams ¶
type LeaveChatParams struct {
// Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername).
// Channel direct messages chats aren't supported; leave the corresponding channel instead.
ChatID string `json:"chat_id"`
}
LeaveChatParams contains parameters for Client.LeaveChat.
func (*LeaveChatParams) Option ¶
func (r *LeaveChatParams) Option(opts ...LeaveChatOption) (previous LeaveChatOption)
Option applies one or more LeaveChatOption values and returns the last rollback option.
type LinkPreviewOptions ¶
type LinkPreviewOptions struct {
// Optional.
// True, if the link preview is disabled
IsDisabled bool `json:"is_disabled,omitempty"`
// Optional.
// URL to use for the link preview.
// If empty, then the first URL found in the message text will be used
URL string `json:"url,omitempty"`
// Optional.
// True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
PreferSmallMedia bool `json:"prefer_small_media,omitempty"`
// Optional.
// True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
PreferLargeMedia bool `json:"prefer_large_media,omitempty"`
// Optional.
// True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
ShowAboveText bool `json:"show_above_text,omitempty"`
}
LinkPreviewOptions
Describes the options used for link preview generation.
type Location ¶
type Location struct {
// Latitude as defined by the sender
Latitude float64 `json:"latitude"`
// Longitude as defined by the sender
Longitude float64 `json:"longitude"`
// Optional.
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Optional.
// Time relative to the message sending date, during which the location can be updated; in seconds.
// For active live locations only.
LivePeriod int64 `json:"live_period,omitempty"`
// Optional.
// The direction in which user is moving, in degrees; 1-360.
// For active live locations only.
Heading int64 `json:"heading,omitempty"`
// Optional.
// The maximum distance for proximity alerts about approaching another chat member, in meters.
// For sent live locations only.
ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"`
}
Location
This object represents a point on the map.
type LocationAddress ¶
type LocationAddress struct {
// The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located
CountryCode string `json:"country_code"`
// Optional.
// State of the location
State string `json:"state,omitempty"`
// Optional.
// City of the location
City string `json:"city,omitempty"`
// Optional.
// Street address of the location
Street string `json:"street,omitempty"`
}
LocationAddress
Describes the physical address of a location.
type LogOutOption ¶
type LogOutOption func(params *LogOutParams) LogOutOption
LogOutOption configures LogOutParams.
type LogOutParams ¶
type LogOutParams struct {
}
LogOutParams contains parameters for Client.LogOut.
func (*LogOutParams) Option ¶
func (r *LogOutParams) Option(opts ...LogOutOption) (previous LogOutOption)
Option applies one or more LogOutOption values and returns the last rollback option.
type LoginUrl ¶
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].
//
// [Receiving authorization data]: https://core.telegram.org/widgets/login#receiving-authorization-data
// [Checking authorization]: https://core.telegram.org/widgets/login#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.
//
// [Setting up a bot]: https://core.telegram.org/widgets/login#setting-up-a-bot
// [Linking your domain to the bot]: https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot
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: Telegram apps support these buttons as of version 5.7.
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 MaybeInaccessibleMessage ¶
type MaybeInaccessibleMessage struct {
*Message
*InaccessibleMessage
}
MaybeInaccessibleMessage
This object describes a message that can be inaccessible to the bot. It can be one of
func (*MaybeInaccessibleMessage) Chat ¶
func (r *MaybeInaccessibleMessage) Chat() *Chat
Chat returns the chat of the underlying message.
func (*MaybeInaccessibleMessage) MarshalJSON ¶
func (r *MaybeInaccessibleMessage) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of MaybeInaccessibleMessage.
func (*MaybeInaccessibleMessage) MessageID ¶
func (r *MaybeInaccessibleMessage) MessageID() int64
MessageID returns the message ID of the underlying message.
func (*MaybeInaccessibleMessage) UnmarshalJSON ¶
func (r *MaybeInaccessibleMessage) UnmarshalJSON(bs []byte) error
UnmarshalJSON implements the json.Unmarshaler interface. It attempts to unmarshal the JSON into a Message or InaccessibleMessage.
type MenuButton ¶
type MenuButton struct {
*MenuButtonCommands
*MenuButtonWebApp
*MenuButtonDefault
}
MenuButton
This object describes the bot's menu button in a private chat. It should be one of
If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.
func (*MenuButton) MarshalJSON ¶
func (r *MenuButton) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of MenuButton.
func (*MenuButton) UnmarshalJSON ¶
func (r *MenuButton) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching MenuButton subtype.
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.
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.
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].
// Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link.
//
// [answerWebAppQuery]: https://core.telegram.org/bots/api#answerwebappquery
WebApp WebAppInfo `json:"web_app"`
}
MenuButtonWebApp
Represents a menu button, which launches a Web App.
type Message ¶
type Message struct {
// Unique message identifier inside this chat.
// In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately.
// In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
MessageID int64 `json:"message_id"`
// Optional.
// Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Optional.
// Information about the direct messages chat topic that contains the message
DirectMessagesTopic *DirectMessagesTopic `json:"direct_messages_topic,omitempty"`
// Optional.
// Sender of the message; may be empty for messages sent to channels.
// For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
From *User `json:"from,omitempty"`
// Optional.
// Sender of the message when sent on behalf of a chat.
// For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group.
// For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.
SenderChat *Chat `json:"sender_chat,omitempty"`
// Optional.
// If the sender of the message boosted the chat, the number of boosts added by the user
SenderBoostCount int64 `json:"sender_boost_count,omitempty"`
// Optional.
// The bot that actually sent the message on behalf of the business account.
// Available only for outgoing messages sent on behalf of the connected business account.
SenderBusinessBot *User `json:"sender_business_bot,omitempty"`
// Optional.
// Tag or custom title of the sender of the message; for supergroups only
SenderTag string `json:"sender_tag,omitempty"`
// Date the message was sent in Unix time.
// It is always a positive number, representing a valid date.
Date int64 `json:"date"`
// Optional.
// Unique identifier of the business connection from which the message was received.
// If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Chat the message belongs to
Chat Chat `json:"chat"`
// Optional.
// Information about the original message for forwarded messages
ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"`
// Optional.
// True, if the message is sent to a topic in a forum supergroup or a private chat with the bot
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 in the same chat and message thread, 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.
//
// [Message]: https://core.telegram.org/bots/api#message
ReplyToMessage *Message `json:"reply_to_message,omitempty"`
// Optional.
// Information about the message that is being replied to, which may come from another chat or forum topic
ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"`
// Optional.
// For replies that quote part of the original message, the quoted part of the message
Quote *TextQuote `json:"quote,omitempty"`
// Optional.
// For replies to a story, the original story
ReplyToStory *Story `json:"reply_to_story,omitempty"`
// Optional.
// Identifier of the specific checklist task that is being replied to
ReplyToChecklistTaskID int64 `json:"reply_to_checklist_task_id,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.
// True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
IsFromOffline bool `json:"is_from_offline,omitempty"`
// Optional.
// True, if the message is a paid post.
// Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited.
IsPaidPost bool `json:"is_paid_post,omitempty"`
// Optional.
// The unique identifier inside this chat 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.
// The number of Telegram Stars that were paid by the sender of the message to send it
PaidStarCount int64 `json:"paid_star_count,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.
// Options used for link preview generation for the message, if it is a text message and link preview options were changed
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
// Optional.
// Information about suggested post parameters if the message is a suggested post in a channel direct messages chat.
// If the message is an approved or declined suggested post, then it can't be edited.
SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info,omitempty"`
// Optional.
// Unique identifier of the message effect added to the message
EffectID string `json:"effect_id,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 contains paid media; information about the paid media
PaidMedia *PaidMediaInfo `json:"paid_media,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 forwarded story
Story *Story `json:"story,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
//
// [video note]: https://telegram.org/blog/video-messages-and-telescope
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, paid media, 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 caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Optional.
// True, if the message media is covered by a spoiler animation
HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"`
// Optional.
// Message is a checklist
Checklist *Checklist `json:"checklist,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 »]
//
// [More about games »]: https://core.telegram.org/bots/api#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.
// Service message: chat owner has left
ChatOwnerLeft *ChatOwnerLeft `json:"chat_owner_left,omitempty"`
// Optional.
// Service message: chat owner has changed
ChatOwnerChanged *ChatOwnerChanged `json:"chat_owner_changed,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.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
// Optional.
// The supergroup has been migrated from a group with the specified identifier.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
MigrateFromChatID int64 `json:"migrate_from_chat_id,omitempty"`
// Optional.
// Specified message was pinned.
// Note that the [Message] object in this field will not contain further reply_to_message fields even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
PinnedMessage *MaybeInaccessibleMessage `json:"pinned_message,omitempty"`
// Optional.
// Message is an invoice for a [payment], information about the invoice.
// [More about payments »]
//
// [payment]: https://core.telegram.org/bots/api#payments
// [More about payments »]: https://core.telegram.org/bots/api#payments
Invoice *Invoice `json:"invoice,omitempty"`
// Optional.
// Message is a service message about a successful payment, information about the payment.
// [More about payments »]
//
// [More about payments »]: https://core.telegram.org/bots/api#payments
SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"`
// Optional.
// Message is a service message about a refunded payment, information about the payment.
// [More about payments »]
//
// [More about payments »]: https://core.telegram.org/bots/api#payments
RefundedPayment *RefundedPayment `json:"refunded_payment,omitempty"`
// Service message: users were shared with the bot
UsersShared *UsersShared `json:"users_shared,omitempty"`
// Service message: a chat was shared with the bot
ChatShared *ChatShared `json:"chat_shared,omitempty"`
// Optional.
// Service message: a regular gift was sent or received
Gift *GiftInfo `json:"gift,omitempty"`
// Optional.
// Service message: a unique gift was sent or received
UniqueGift *UniqueGiftInfo `json:"unique_gift,omitempty"`
// Optional.
// Service message: upgrade of a gift was purchased after the gift was sent
GiftUpgradeSent *GiftInfo `json:"gift_upgrade_sent,omitempty"`
// Optional.
// The domain name of the website on which the user has logged in.
// [More about Telegram Login »]
//
// [More about Telegram Login »]: https://core.telegram.org/widgets/login
ConnectedWebsite string `json:"connected_website,omitempty"`
// Optional.
// Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method [requestWriteAccess]
//
// [requestWriteAccess]: https://core.telegram.org/bots/webapps#initializing-mini-apps
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: user boosted the chat
BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"`
// Optional.
// Service message: chat background set
ChatBackgroundSet *ChatBackground `json:"chat_background_set,omitempty"`
// Optional.
// Service message: some tasks in a checklist were marked as done or not done
ChecklistTasksDone *ChecklistTasksDone `json:"checklist_tasks_done,omitempty"`
// Optional.
// Service message: tasks were added to a checklist
ChecklistTasksAdded *ChecklistTasksAdded `json:"checklist_tasks_added,omitempty"`
// Optional.
// Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed
DirectMessagePriceChanged *DirectMessagePriceChanged `json:"direct_message_price_changed,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"`
// Service message: the 'General' forum topic unhidden
GeneralForumTopicUnhidden *GeneralForumTopicUnhidden `json:"general_forum_topic_unhidden,omitempty"`
// Optional.
// Service message: a scheduled giveaway was created
GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"`
// Optional.
// The message is a scheduled giveaway message
Giveaway *Giveaway `json:"giveaway,omitempty"`
// Optional.
// A giveaway with public winners was completed
GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"`
// Optional.
// Service message: a giveaway without public winners was completed
GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"`
// Optional.
// Service message: the price for paid messages has changed in the chat
PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"`
// Optional.
// Service message: a suggested post was approved
SuggestedPostApproved *SuggestedPostApproved `json:"suggested_post_approved,omitempty"`
// Optional.
// Service message: approval of a suggested post has failed
SuggestedPostApprovalFailed *SuggestedPostApprovalFailed `json:"suggested_post_approval_failed,omitempty"`
// Optional.
// Service message: a suggested post was declined
SuggestedPostDeclined *SuggestedPostDeclined `json:"suggested_post_declined,omitempty"`
// Optional.
// Service message: payment for a suggested post was received
SuggestedPostPaid *SuggestedPostPaid `json:"suggested_post_paid,omitempty"`
// Optional.
// Service message: payment for a suggested post was refunded
SuggestedPostRefunded *SuggestedPostRefunded `json:"suggested_post_refunded,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.
//
// [Inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
Message
This object represents a message.
func (*Message) Args ¶
Args extracts arguments from the message text (strings separated by spaces, excluding the first word).
type MessageAutoDeleteTimerChanged ¶
type MessageAutoDeleteTimerChanged struct {
// New auto-delete time for messages in the chat; in seconds
MessageAutoDeleteTime int64 `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 or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” ([email protected]), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “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), or “date_time” (for formatted date and time)
//
// [without usernames]: https://telegram.org/blog/edit#new-mentions
Type string `json:"type"`
// Offset in [UTF-16 code units] to the start of the entity
//
// [UTF-16 code units]: https://core.telegram.org/api/entities#entity-length
Offset int64 `json:"offset"`
// Length of the entity in [UTF-16 code units]
//
// [UTF-16 code units]: https://core.telegram.org/api/entities#entity-length
Length int64 `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
//
// [getCustomEmojiStickers]: https://core.telegram.org/bots/api#getcustomemojistickers
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
// Optional.
// For “date_time” only, the Unix time associated with the entity
UnixTime int64 `json:"unix_time,omitempty"`
// Optional.
// For “date_time” only, the string that defines the formatting of the date and time.
// See [date-time entity formatting] for more details.
//
// [date-time entity formatting]: https://core.telegram.org/bots/api#date-time-entity-formatting
DateTimeFormat string `json:"date_time_format,omitempty"`
}
MessageEntity
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
type MessageId ¶
type MessageId struct {
// Unique message identifier.
// In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately.
// In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent
MessageID int64 `json:"message_id"`
}
MessageId
This object represents a unique message identifier.
type MessageOrigin ¶
type MessageOrigin struct {
*MessageOriginUser
*MessageOriginHiddenUser
*MessageOriginChat
*MessageOriginChannel
}
MessageOrigin
This object describes the origin of a message. It can be one of
func (*MessageOrigin) MarshalJSON ¶
func (r *MessageOrigin) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of MessageOrigin.
func (*MessageOrigin) UnmarshalJSON ¶
func (r *MessageOrigin) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching MessageOrigin subtype.
type MessageOriginChannel ¶
type MessageOriginChannel struct {
// Type of the message origin, always “channel”
Type string `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// Channel chat to which the message was originally sent
Chat Chat `json:"chat"`
// Unique message identifier inside the chat
MessageID int64 `json:"message_id"`
// Optional.
// Signature of the original post author
AuthorSignature string `json:"author_signature,omitempty"`
}
MessageOriginChannel
The message was originally sent to a channel chat.
type MessageOriginChat ¶
type MessageOriginChat struct {
// Type of the message origin, always “chat”
Type string `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// Chat that sent the message originally
SenderChat Chat `json:"sender_chat"`
// Optional.
// For messages originally sent by an anonymous chat administrator, original message author signature
AuthorSignature string `json:"author_signature,omitempty"`
}
MessageOriginChat
The message was originally sent on behalf of a chat to a group chat.
type MessageOriginHiddenUser ¶
type MessageOriginHiddenUser struct {
// Type of the message origin, always “hidden_user”
Type string `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// Name of the user that sent the message originally
SenderUserName string `json:"sender_user_name"`
}
MessageOriginHiddenUser
The message was originally sent by an unknown user.
type MessageOriginUser ¶
type MessageOriginUser struct {
// Type of the message origin, always “user”
Type string `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// User that sent the message originally
SenderUser User `json:"sender_user"`
}
MessageOriginUser
The message was originally sent by a known user.
type MessageReactionCountUpdated ¶
type MessageReactionCountUpdated struct {
// The chat containing the message
Chat Chat `json:"chat"`
// Unique message identifier inside the chat
MessageID int64 `json:"message_id"`
// Date of the change in Unix time
Date int64 `json:"date"`
// List of reactions that are present on the message
Reactions []ReactionCount `json:"reactions"`
}
MessageReactionCountUpdated
This object represents reaction changes on a message with anonymous reactions.
type MessageReactionUpdated ¶
type MessageReactionUpdated struct {
// The chat containing the message the user reacted to
Chat Chat `json:"chat"`
// Unique identifier of the message inside the chat
MessageID int64 `json:"message_id"`
// Optional.
// The user that changed the reaction, if the user isn't anonymous
User *User `json:"user,omitempty"`
// Optional.
// The chat on behalf of which the reaction was changed, if the user is anonymous
ActorChat *Chat `json:"actor_chat,omitempty"`
// Date of the change in Unix time
Date int64 `json:"date"`
// Previous list of reaction types that were set by the user
OldReaction []ReactionType `json:"old_reaction"`
// New list of reaction types that have been set by the user
NewReaction []ReactionType `json:"new_reaction"`
}
MessageReactionUpdated
This object represents a change of a reaction on a message performed by a user.
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandlerFunc) HandlerFunc
MiddlewareFunc is a function that wraps a HandlerFunc.
type MigrateError ¶
MigrateError represents a chat migration error. It indicates that the group has been migrated to a supergroup with a new identifier.
func (*MigrateError) Error ¶
func (e *MigrateError) Error() string
func (*MigrateError) Unwrap ¶
func (e *MigrateError) Unwrap() error
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 OwnedGift ¶
type OwnedGift struct {
*OwnedGiftRegular
*OwnedGiftUnique
}
OwnedGift
This object describes a gift received and owned by a user or a chat. Currently, it can be one of
func (*OwnedGift) MarshalJSON ¶
MarshalJSON marshals the currently set subtype of OwnedGift.
func (*OwnedGift) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON into the matching OwnedGift subtype.
type OwnedGiftRegular ¶
type OwnedGiftRegular struct {
// Type of the gift, always “regular”
Type string `json:"type"`
// Information about the regular gift
Gift Gift `json:"gift"`
// Optional.
// Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
OwnedGiftID string `json:"owned_gift_id,omitempty"`
// Optional.
// Sender of the gift if it is a known user
SenderUser *User `json:"sender_user,omitempty"`
// Date the gift was sent in Unix time
SendDate int64 `json:"send_date"`
// Optional.
// Text of the message that was added to the gift
Text string `json:"text,omitempty"`
// Optional.
// Special entities that appear in the text
Entities []MessageEntity `json:"entities,omitempty"`
// Optional.
// True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
IsPrivate bool `json:"is_private,omitempty"`
// Optional.
// True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only
IsSaved bool `json:"is_saved,omitempty"`
// Optional.
// True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only
CanBeUpgraded bool `json:"can_be_upgraded,omitempty"`
// Optional.
// True, if the gift was refunded and isn't available anymore
WasRefunded bool `json:"was_refunded,omitempty"`
// Optional.
// Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only
ConvertStarCount int64 `json:"convert_star_count,omitempty"`
// Optional.
// Number of Telegram Stars that were paid for the ability to upgrade the gift
PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count,omitempty"`
// Optional.
// True, if the gift's upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only
IsUpgradeSeparate bool `json:"is_upgrade_separate,omitempty"`
// Optional.
// Unique number reserved for this gift when upgraded.
// See the number field in [UniqueGift]
//
// [UniqueGift]: https://core.telegram.org/bots/api#uniquegift
UniqueGiftNumber int64 `json:"unique_gift_number,omitempty"`
}
OwnedGiftRegular
Describes a regular gift owned by a user or a chat.
type OwnedGiftUnique ¶
type OwnedGiftUnique struct {
// Type of the gift, always “unique”
Type string `json:"type"`
// Information about the unique gift
Gift UniqueGift `json:"gift"`
// Optional.
// Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only
OwnedGiftID string `json:"owned_gift_id,omitempty"`
// Optional.
// Sender of the gift if it is a known user
SenderUser *User `json:"sender_user,omitempty"`
// Date the gift was sent in Unix time
SendDate int64 `json:"send_date"`
// Optional.
// True, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only
IsSaved bool `json:"is_saved,omitempty"`
// Optional.
// True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only
CanBeTransferred bool `json:"can_be_transferred,omitempty"`
// Optional.
// Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
TransferStarCount int64 `json:"transfer_star_count,omitempty"`
// Optional.
// Point in time (Unix timestamp) when the gift can be transferred.
// If it is in the past, then the gift can be transferred now
NextTransferDate int64 `json:"next_transfer_date,omitempty"`
}
OwnedGiftUnique
Describes a unique gift received and owned by a user or a chat.
type OwnedGifts ¶
type OwnedGifts struct {
// The total number of gifts owned by the user or the chat
TotalCount int64 `json:"total_count"`
// The list of gifts
Gifts []OwnedGift `json:"gifts"`
// Optional.
// Offset for the next request.
// If empty, then there are no more results
NextOffset string `json:"next_offset,omitempty"`
}
OwnedGifts
Contains the list of gifts received and owned by a user or a chat.
type PaidMedia ¶
type PaidMedia struct {
*PaidMediaPreview
*PaidMediaPhoto
*PaidMediaVideo
}
PaidMedia
This object describes paid media. Currently, it can be one of
func (*PaidMedia) MarshalJSON ¶
MarshalJSON marshals the currently set subtype of PaidMedia.
func (*PaidMedia) UnmarshalJSON ¶
UnmarshalJSON unmarshals JSON into the matching PaidMedia subtype.
type PaidMediaInfo ¶
type PaidMediaInfo struct {
// The number of Telegram Stars that must be paid to buy access to the media
StarCount int64 `json:"star_count"`
// Information about the paid media
PaidMedia []PaidMedia `json:"paid_media"`
}
PaidMediaInfo
Describes the paid media added to a message.
type PaidMediaPhoto ¶
type PaidMediaPhoto struct {
// Type of the paid media, always “photo”
Type string `json:"type"`
// The photo
Photo []PhotoSize `json:"photo"`
}
PaidMediaPhoto
The paid media is a photo.
type PaidMediaPreview ¶
type PaidMediaPreview struct {
// Type of the paid media, always “preview”
Type string `json:"type"`
// Optional.
// Media width as defined by the sender
Width int64 `json:"width,omitempty"`
// Optional.
// Media height as defined by the sender
Height int64 `json:"height,omitempty"`
// Optional.
// Duration of the media in seconds as defined by the sender
Duration int64 `json:"duration,omitempty"`
}
PaidMediaPreview
The paid media isn't available before the payment.
type PaidMediaPurchased ¶
type PaidMediaPurchased struct {
// User who purchased the media
From User `json:"from"`
// Bot-specified paid media payload
PaidMediaPayload string `json:"paid_media_payload"`
}
PaidMediaPurchased
This object contains information about a paid media purchase.
type PaidMediaVideo ¶
type PaidMediaVideo struct {
// Type of the paid media, always “video”
Type string `json:"type"`
// The video
Video Video `json:"video"`
}
PaidMediaVideo
The paid media is a video.
type PaidMessagePriceChanged ¶
type PaidMessagePriceChanged struct {
// The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
PaidMessageStarCount int64 `json:"paid_message_star_count"`
}
PaidMessagePriceChanged
Describes a service message about a change in the price of paid messages within a chat.
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 {
*PassportElementErrorDataField
*PassportElementErrorFrontSide
*PassportElementErrorReverseSide
*PassportElementErrorSelfie
*PassportElementErrorFile
*PassportElementErrorFiles
*PassportElementErrorTranslationFile
*PassportElementErrorTranslationFiles
*PassportElementErrorUnspecified
}
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:
PassportElementErrorReverseSide
PassportElementErrorTranslationFile
PassportElementErrorTranslationFiles
PassportElementErrorUnspecified
func (*PassportElementError) MarshalJSON ¶
func (r *PassportElementError) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of PassportElementError.
func (*PassportElementError) UnmarshalJSON ¶
func (r *PassportElementError) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching PassportElementError subtype.
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 int64 `json:"file_size"`
// Unix time when the file was uploaded
FileDate int64 `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 PhotoSize ¶
type PhotoSize 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"`
// Photo width
Width int64 `json:"width"`
// Photo height
Height int64 `json:"height"`
// Optional.
// File size in bytes
FileSize int64 `json:"file_size,omitempty"`
}
PhotoSize
This object represents one size of a photo or a file / sticker thumbnail.
func PhotoBiggest ¶
PhotoBiggest returns the largest photo from a list of PhotoSize.
type PinChatMessageOption ¶
type PinChatMessageOption func(params *PinChatMessageParams) PinChatMessageOption
PinChatMessageOption configures PinChatMessageParams.
func WithPinChatMessageBusinessConnectionID ¶
func WithPinChatMessageBusinessConnectionID(value string) PinChatMessageOption
WithPinChatMessageBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be pinned
func WithPinChatMessageChatID ¶
func WithPinChatMessageChatID(value string) PinChatMessageOption
WithPinChatMessageChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithPinChatMessageDisableNotification ¶
func WithPinChatMessageDisableNotification(value bool) PinChatMessageOption
WithPinChatMessageDisableNotification sets the DisableNotification field.
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 WithPinChatMessageMessageID ¶
func WithPinChatMessageMessageID(value int64) PinChatMessageOption
WithPinChatMessageMessageID sets the MessageID field.
Identifier of a message to pin
type PinChatMessageParams ¶
type PinChatMessageParams struct {
// Unique identifier of the business connection on behalf of which the message will be pinned
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Identifier of a message to pin
MessageID int64 `json:"message_id"`
// Pass True if it is not necessary to send a notification to all chat members about the new pinned message.
// Notifications are always disabled in channels and private chats.
DisableNotification bool `json:"disable_notification,omitempty"`
}
PinChatMessageParams contains parameters for Client.PinChatMessage.
func (*PinChatMessageParams) Option ¶
func (r *PinChatMessageParams) Option(opts ...PinChatMessageOption) (previous PinChatMessageOption)
Option applies one or more PinChatMessageOption values and returns the last rollback option.
type Poll ¶
type Poll struct {
// Unique poll identifier
ID string `json:"id"`
// Poll question, 1-300 characters
Question string `json:"question"`
// Optional.
// Special entities that appear in the question.
// Currently, only custom emoji entities are allowed in poll questions
QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
// List of poll options
Options []PollOption `json:"options"`
// Total number of users that voted in the poll
TotalVoterCount int64 `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 int64 `json:"correct_option_id,omitempty"`
// Optional.
// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
Explanation string `json:"explanation,omitempty"`
// Optional.
// Special entities like usernames, URLs, bot commands, etc.
// that appear in the explanation
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
// Optional.
// Amount of time in seconds the poll will be active after creation
OpenPeriod int64 `json:"open_period,omitempty"`
// Optional.
// Point in time (Unix timestamp) when the poll will be automatically closed
CloseDate int64 `json:"close_date,omitempty"`
}
Poll
This object contains information about a poll.
type PollAnswer ¶
type PollAnswer struct {
// Unique poll identifier
PollID string `json:"poll_id"`
// Optional.
// The chat that changed the answer to the poll, if the voter is anonymous
VoterChat *Chat `json:"voter_chat,omitempty"`
// Optional.
// The user that changed the answer to the poll, if the voter isn't anonymous
User *User `json:"user,omitempty"`
// 0-based identifiers of chosen answer options.
// May be empty if the vote was retracted.
OptionIDs []int64 `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"`
// Optional.
// Special entities that appear in the option text.
// Currently, only custom emoji entities are allowed in poll option texts
TextEntities []MessageEntity `json:"text_entities,omitempty"`
// Number of users that voted for this option
VoterCount int64 `json:"voter_count"`
}
PollOption
This object contains information about one answer option in a poll.
type PostStoryOption ¶
type PostStoryOption func(params *PostStoryParams) PostStoryOption
PostStoryOption configures PostStoryParams.
func WithPostStoryActivePeriod ¶
func WithPostStoryActivePeriod(value int64) PostStoryOption
WithPostStoryActivePeriod sets the ActivePeriod field.
Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
func WithPostStoryAreas ¶
func WithPostStoryAreas(value []StoryArea) PostStoryOption
WithPostStoryAreas sets the Areas field.
A JSON-serialized list of clickable areas to be shown on the story
func WithPostStoryBusinessConnectionID ¶
func WithPostStoryBusinessConnectionID(value string) PostStoryOption
WithPostStoryBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithPostStoryCaption ¶
func WithPostStoryCaption(value string) PostStoryOption
WithPostStoryCaption sets the Caption field.
Caption of the story, 0-2048 characters after entities parsing
func WithPostStoryCaptionEntities ¶
func WithPostStoryCaptionEntities(value []MessageEntity) PostStoryOption
WithPostStoryCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithPostStoryContent ¶
func WithPostStoryContent(value InputStoryContent) PostStoryOption
WithPostStoryContent sets the Content field.
Content of the story
func WithPostStoryParseMode ¶
func WithPostStoryParseMode(value string) PostStoryOption
WithPostStoryParseMode sets the ParseMode field.
Mode for parsing entities in the story caption. See formatting options for more details.
func WithPostStoryPostToChatPage ¶
func WithPostStoryPostToChatPage(value bool) PostStoryOption
WithPostStoryPostToChatPage sets the PostToChatPage field.
Pass True to keep the story accessible after it expires
func WithPostStoryProtectContent ¶
func WithPostStoryProtectContent(value bool) PostStoryOption
WithPostStoryProtectContent sets the ProtectContent field.
Pass True if the content of the story must be protected from forwarding and screenshotting
type PostStoryParams ¶
type PostStoryParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Content of the story
Content InputStoryContent `json:"content"`
// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
ActivePeriod int64 `json:"active_period"`
// Caption of the story, 0-2048 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the story caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// A JSON-serialized list of clickable areas to be shown on the story
Areas []StoryArea `json:"areas,omitempty"`
// Pass True to keep the story accessible after it expires
PostToChatPage bool `json:"post_to_chat_page,omitempty"`
// Pass True if the content of the story must be protected from forwarding and screenshotting
ProtectContent bool `json:"protect_content,omitempty"`
}
PostStoryParams contains parameters for Client.PostStory.
func (*PostStoryParams) Option ¶
func (r *PostStoryParams) Option(opts ...PostStoryOption) (previous PostStoryOption)
Option applies one or more PostStoryOption values and returns the last rollback option.
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, or “XTR” for payments in [Telegram Stars]
//
// [currency]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
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).
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
TotalAmount int64 `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 PreparedInlineMessage ¶
type PreparedInlineMessage struct {
// Unique identifier of the prepared message
ID string `json:"id"`
// Expiration date of the prepared message, in Unix time.
// Expired prepared messages can no longer be used
ExpirationDate int64 `json:"expiration_date"`
}
PreparedInlineMessage
Describes an inline message to be sent by a user of a Mini App.
type PromoteChatMemberOption ¶
type PromoteChatMemberOption func(params *PromoteChatMemberParams) PromoteChatMemberOption
PromoteChatMemberOption configures PromoteChatMemberParams.
func WithPromoteChatMemberCanChangeInfo ¶
func WithPromoteChatMemberCanChangeInfo(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanChangeInfo sets the CanChangeInfo field.
Pass True if the administrator can change chat title, photo and other settings
func WithPromoteChatMemberCanDeleteMessages ¶
func WithPromoteChatMemberCanDeleteMessages(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanDeleteMessages sets the CanDeleteMessages field.
Pass True if the administrator can delete messages of other users
func WithPromoteChatMemberCanDeleteStories ¶
func WithPromoteChatMemberCanDeleteStories(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanDeleteStories sets the CanDeleteStories field.
Pass True if the administrator can delete stories posted by other users
func WithPromoteChatMemberCanEditMessages ¶
func WithPromoteChatMemberCanEditMessages(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanEditMessages sets the CanEditMessages field.
Pass True if the administrator can edit messages of other users and can pin messages; for channels only
func WithPromoteChatMemberCanEditStories ¶
func WithPromoteChatMemberCanEditStories(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanEditStories sets the CanEditStories field.
Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
func WithPromoteChatMemberCanInviteUsers ¶
func WithPromoteChatMemberCanInviteUsers(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanInviteUsers sets the CanInviteUsers field.
Pass True if the administrator can invite new users to the chat
func WithPromoteChatMemberCanManageChat ¶
func WithPromoteChatMemberCanManageChat(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanManageChat sets the CanManageChat field.
Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
func WithPromoteChatMemberCanManageDirectMessages ¶
func WithPromoteChatMemberCanManageDirectMessages(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanManageDirectMessages sets the CanManageDirectMessages field.
Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only
func WithPromoteChatMemberCanManageTags ¶
func WithPromoteChatMemberCanManageTags(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanManageTags sets the CanManageTags field.
Pass True if the administrator can edit the tags of regular members; for groups and supergroups only
func WithPromoteChatMemberCanManageTopics ¶
func WithPromoteChatMemberCanManageTopics(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanManageTopics sets the CanManageTopics field.
Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
func WithPromoteChatMemberCanManageVideoChats ¶
func WithPromoteChatMemberCanManageVideoChats(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanManageVideoChats sets the CanManageVideoChats field.
Pass True if the administrator can manage video chats
func WithPromoteChatMemberCanPinMessages ¶
func WithPromoteChatMemberCanPinMessages(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanPinMessages sets the CanPinMessages field.
Pass True if the administrator can pin messages; for supergroups only
func WithPromoteChatMemberCanPostMessages ¶
func WithPromoteChatMemberCanPostMessages(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanPostMessages sets the CanPostMessages field.
Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
func WithPromoteChatMemberCanPostStories ¶
func WithPromoteChatMemberCanPostStories(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanPostStories sets the CanPostStories field.
Pass True if the administrator can post stories to the chat
func WithPromoteChatMemberCanPromoteMembers ¶
func WithPromoteChatMemberCanPromoteMembers(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanPromoteMembers sets the CanPromoteMembers field.
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 WithPromoteChatMemberCanRestrictMembers ¶
func WithPromoteChatMemberCanRestrictMembers(value bool) PromoteChatMemberOption
WithPromoteChatMemberCanRestrictMembers sets the CanRestrictMembers field.
Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics. For backward compatibility, defaults to True for promotions of channel administrators
func WithPromoteChatMemberChatID ¶
func WithPromoteChatMemberChatID(value string) PromoteChatMemberOption
WithPromoteChatMemberChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithPromoteChatMemberIsAnonymous ¶
func WithPromoteChatMemberIsAnonymous(value bool) PromoteChatMemberOption
WithPromoteChatMemberIsAnonymous sets the IsAnonymous field.
Pass True if the administrator's presence in the chat is hidden
func WithPromoteChatMemberUserID ¶
func WithPromoteChatMemberUserID(value int64) PromoteChatMemberOption
WithPromoteChatMemberUserID sets the UserID field.
Unique identifier of the target user
type PromoteChatMemberParams ¶
type PromoteChatMemberParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// Pass True if the administrator's presence in the chat is hidden
IsAnonymous bool `json:"is_anonymous,omitempty"`
// Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars.
// Implied by any other administrator privilege.
CanManageChat bool `json:"can_manage_chat,omitempty"`
// Pass True if the administrator can delete messages of other users
CanDeleteMessages bool `json:"can_delete_messages,omitempty"`
// Pass True if the administrator can manage video chats
CanManageVideoChats bool `json:"can_manage_video_chats,omitempty"`
// Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics.
// For backward compatibility, defaults to True for promotions of channel administrators
CanRestrictMembers bool `json:"can_restrict_members,omitempty"`
// 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)
CanPromoteMembers bool `json:"can_promote_members,omitempty"`
// Pass True if the administrator can change chat title, photo and other settings
CanChangeInfo bool `json:"can_change_info,omitempty"`
// Pass True if the administrator can invite new users to the chat
CanInviteUsers bool `json:"can_invite_users,omitempty"`
// Pass True if the administrator can post stories to the chat
CanPostStories bool `json:"can_post_stories,omitempty"`
// Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive
CanEditStories bool `json:"can_edit_stories,omitempty"`
// Pass True if the administrator can delete stories posted by other users
CanDeleteStories bool `json:"can_delete_stories,omitempty"`
// Pass True if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only
CanPostMessages bool `json:"can_post_messages,omitempty"`
// Pass True if the administrator can edit messages of other users and can pin messages; for channels only
CanEditMessages bool `json:"can_edit_messages,omitempty"`
// Pass True if the administrator can pin messages; for supergroups only
CanPinMessages bool `json:"can_pin_messages,omitempty"`
// Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
CanManageTopics bool `json:"can_manage_topics,omitempty"`
// Pass True if the administrator can manage direct messages within the channel and decline suggested posts; for channels only
CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"`
// Pass True if the administrator can edit the tags of regular members; for groups and supergroups only
CanManageTags bool `json:"can_manage_tags,omitempty"`
}
PromoteChatMemberParams contains parameters for Client.PromoteChatMember.
func (*PromoteChatMemberParams) Option ¶
func (r *PromoteChatMemberParams) Option(opts ...PromoteChatMemberOption) (previous PromoteChatMemberOption)
Option applies one or more PromoteChatMemberOption values and returns the last rollback option.
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 int64 `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 ReactionCount ¶
type ReactionCount struct {
// Type of the reaction
Type ReactionType `json:"type"`
// Number of times the reaction was added
TotalCount int64 `json:"total_count"`
}
ReactionCount
Represents a reaction added to a message along with the number of times it was added.
type ReactionType ¶
type ReactionType struct {
*ReactionTypeEmoji
*ReactionTypeCustomEmoji
*ReactionTypePaid
}
ReactionType
This object describes the type of a reaction. Currently, it can be one of
func (*ReactionType) MarshalJSON ¶
func (r *ReactionType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of ReactionType.
func (*ReactionType) UnmarshalJSON ¶
func (r *ReactionType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching ReactionType subtype.
type ReactionTypeCustomEmoji ¶
type ReactionTypeCustomEmoji struct {
// Type of the reaction, always “custom_emoji”
Type string `json:"type"`
// Custom emoji identifier
CustomEmojiID string `json:"custom_emoji_id"`
}
ReactionTypeCustomEmoji
The reaction is based on a custom emoji.
type ReactionTypeEmoji ¶
type ReactionTypeEmoji struct {
// Type of the reaction, always “emoji”
Type string `json:"type"`
// Reaction emoji.
// Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
Emoji string `json:"emoji"`
}
ReactionTypeEmoji
The reaction is based on an emoji.
type ReactionTypePaid ¶
type ReactionTypePaid struct {
// Type of the reaction, always “paid”
Type string `json:"type"`
}
ReactionTypePaid
The reaction is paid.
type ReadBusinessMessageOption ¶
type ReadBusinessMessageOption func(params *ReadBusinessMessageParams) ReadBusinessMessageOption
ReadBusinessMessageOption configures ReadBusinessMessageParams.
func WithReadBusinessMessageBusinessConnectionID ¶
func WithReadBusinessMessageBusinessConnectionID(value string) ReadBusinessMessageOption
WithReadBusinessMessageBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which to read the message
func WithReadBusinessMessageChatID ¶
func WithReadBusinessMessageChatID(value int64) ReadBusinessMessageOption
WithReadBusinessMessageChatID sets the ChatID field.
Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
func WithReadBusinessMessageMessageID ¶
func WithReadBusinessMessageMessageID(value int64) ReadBusinessMessageOption
WithReadBusinessMessageMessageID sets the MessageID field.
Unique identifier of the message to mark as read
type ReadBusinessMessageParams ¶
type ReadBusinessMessageParams struct {
// Unique identifier of the business connection on behalf of which to read the message
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the chat in which the message was received.
// The chat must have been active in the last 24 hours.
ChatID int64 `json:"chat_id"`
// Unique identifier of the message to mark as read
MessageID int64 `json:"message_id"`
}
ReadBusinessMessageParams contains parameters for Client.ReadBusinessMessage.
func (*ReadBusinessMessageParams) Option ¶
func (r *ReadBusinessMessageParams) Option(opts ...ReadBusinessMessageOption) (previous ReadBusinessMessageOption)
Option applies one or more ReadBusinessMessageOption values and returns the last rollback option.
type RefundStarPaymentOption ¶
type RefundStarPaymentOption func(params *RefundStarPaymentParams) RefundStarPaymentOption
RefundStarPaymentOption configures RefundStarPaymentParams.
func WithRefundStarPaymentTelegramPaymentChargeID ¶
func WithRefundStarPaymentTelegramPaymentChargeID(value string) RefundStarPaymentOption
WithRefundStarPaymentTelegramPaymentChargeID sets the TelegramPaymentChargeID field.
Telegram payment identifier
func WithRefundStarPaymentUserID ¶
func WithRefundStarPaymentUserID(value int64) RefundStarPaymentOption
WithRefundStarPaymentUserID sets the UserID field.
Identifier of the user whose payment will be refunded
type RefundStarPaymentParams ¶
type RefundStarPaymentParams struct {
// Identifier of the user whose payment will be refunded
UserID int64 `json:"user_id"`
// Telegram payment identifier
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
}
RefundStarPaymentParams contains parameters for Client.RefundStarPayment.
func (*RefundStarPaymentParams) Option ¶
func (r *RefundStarPaymentParams) Option(opts ...RefundStarPaymentOption) (previous RefundStarPaymentOption)
Option applies one or more RefundStarPaymentOption values and returns the last rollback option.
type RefundedPayment ¶
type RefundedPayment struct {
// Three-letter ISO 4217 [currency] code, or “XTR” for payments in [Telegram Stars].
// Currently, always “XTR”
//
// [currency]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
Currency string `json:"currency"`
// Total refunded price in the smallest units of the currency (integer, not float/double).
// For example, for a price of US$ 1.45, total_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).
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
TotalAmount int64 `json:"total_amount"`
// Bot-specified invoice payload
InvoicePayload string `json:"invoice_payload"`
// Telegram payment identifier
TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`
// Optional.
// Provider payment identifier
ProviderPaymentChargeID string `json:"provider_payment_charge_id,omitempty"`
}
RefundedPayment
This object contains basic information about a refunded payment.
type RemoveBusinessAccountProfilePhotoOption ¶
type RemoveBusinessAccountProfilePhotoOption func(params *RemoveBusinessAccountProfilePhotoParams) RemoveBusinessAccountProfilePhotoOption
RemoveBusinessAccountProfilePhotoOption configures RemoveBusinessAccountProfilePhotoParams.
func WithRemoveBusinessAccountProfilePhotoBusinessConnectionID ¶
func WithRemoveBusinessAccountProfilePhotoBusinessConnectionID(value string) RemoveBusinessAccountProfilePhotoOption
WithRemoveBusinessAccountProfilePhotoBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithRemoveBusinessAccountProfilePhotoIsPublic ¶
func WithRemoveBusinessAccountProfilePhotoIsPublic(value bool) RemoveBusinessAccountProfilePhotoOption
WithRemoveBusinessAccountProfilePhotoIsPublic sets the IsPublic field.
Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings. After the main photo is removed, the previous profile photo (if present) becomes the main photo.
type RemoveBusinessAccountProfilePhotoParams ¶
type RemoveBusinessAccountProfilePhotoParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Pass True to remove the public photo, which is visible even if the main photo is hidden by the business account's privacy settings.
// After the main photo is removed, the previous profile photo (if present) becomes the main photo.
IsPublic bool `json:"is_public,omitempty"`
}
RemoveBusinessAccountProfilePhotoParams contains parameters for Client.RemoveBusinessAccountProfilePhoto.
func (*RemoveBusinessAccountProfilePhotoParams) Option ¶
func (r *RemoveBusinessAccountProfilePhotoParams) Option(opts ...RemoveBusinessAccountProfilePhotoOption) (previous RemoveBusinessAccountProfilePhotoOption)
Option applies one or more RemoveBusinessAccountProfilePhotoOption values and returns the last rollback option.
type RemoveChatVerificationOption ¶
type RemoveChatVerificationOption func(params *RemoveChatVerificationParams) RemoveChatVerificationOption
RemoveChatVerificationOption configures RemoveChatVerificationParams.
func WithRemoveChatVerificationChatID ¶
func WithRemoveChatVerificationChatID(value string) RemoveChatVerificationOption
WithRemoveChatVerificationChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type RemoveChatVerificationParams ¶
type RemoveChatVerificationParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
RemoveChatVerificationParams contains parameters for Client.RemoveChatVerification.
func (*RemoveChatVerificationParams) Option ¶
func (r *RemoveChatVerificationParams) Option(opts ...RemoveChatVerificationOption) (previous RemoveChatVerificationOption)
Option applies one or more RemoveChatVerificationOption values and returns the last rollback option.
type RemoveMyProfilePhotoOption ¶
type RemoveMyProfilePhotoOption func(params *RemoveMyProfilePhotoParams) RemoveMyProfilePhotoOption
RemoveMyProfilePhotoOption configures RemoveMyProfilePhotoParams.
type RemoveMyProfilePhotoParams ¶
type RemoveMyProfilePhotoParams struct {
}
RemoveMyProfilePhotoParams contains parameters for Client.RemoveMyProfilePhoto.
func (*RemoveMyProfilePhotoParams) Option ¶
func (r *RemoveMyProfilePhotoParams) Option(opts ...RemoveMyProfilePhotoOption) (previous RemoveMyProfilePhotoOption)
Option applies one or more RemoveMyProfilePhotoOption values and returns the last rollback option.
type RemoveUserVerificationOption ¶
type RemoveUserVerificationOption func(params *RemoveUserVerificationParams) RemoveUserVerificationOption
RemoveUserVerificationOption configures RemoveUserVerificationParams.
func WithRemoveUserVerificationUserID ¶
func WithRemoveUserVerificationUserID(value int64) RemoveUserVerificationOption
WithRemoveUserVerificationUserID sets the UserID field.
Unique identifier of the target user
type RemoveUserVerificationParams ¶
type RemoveUserVerificationParams struct {
// Unique identifier of the target user
UserID int64 `json:"user_id"`
}
RemoveUserVerificationParams contains parameters for Client.RemoveUserVerification.
func (*RemoveUserVerificationParams) Option ¶
func (r *RemoveUserVerificationParams) Option(opts ...RemoveUserVerificationOption) (previous RemoveUserVerificationOption)
Option applies one or more RemoveUserVerificationOption values and returns the last rollback option.
type ReopenForumTopicOption ¶
type ReopenForumTopicOption func(params *ReopenForumTopicParams) ReopenForumTopicOption
ReopenForumTopicOption configures ReopenForumTopicParams.
func WithReopenForumTopicChatID ¶
func WithReopenForumTopicChatID(value string) ReopenForumTopicOption
WithReopenForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithReopenForumTopicMessageThreadID ¶
func WithReopenForumTopicMessageThreadID(value int64) ReopenForumTopicOption
WithReopenForumTopicMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread of the forum topic
type ReopenForumTopicParams ¶
type ReopenForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread of the forum topic
MessageThreadID int64 `json:"message_thread_id"`
}
ReopenForumTopicParams contains parameters for Client.ReopenForumTopic.
func (*ReopenForumTopicParams) Option ¶
func (r *ReopenForumTopicParams) Option(opts ...ReopenForumTopicOption) (previous ReopenForumTopicOption)
Option applies one or more ReopenForumTopicOption values and returns the last rollback option.
type ReopenGeneralForumTopicOption ¶
type ReopenGeneralForumTopicOption func(params *ReopenGeneralForumTopicParams) ReopenGeneralForumTopicOption
ReopenGeneralForumTopicOption configures ReopenGeneralForumTopicParams.
func WithReopenGeneralForumTopicChatID ¶
func WithReopenGeneralForumTopicChatID(value string) ReopenGeneralForumTopicOption
WithReopenGeneralForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type ReopenGeneralForumTopicParams ¶
type ReopenGeneralForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
}
ReopenGeneralForumTopicParams contains parameters for Client.ReopenGeneralForumTopic.
func (*ReopenGeneralForumTopicParams) Option ¶
func (r *ReopenGeneralForumTopicParams) Option(opts ...ReopenGeneralForumTopicOption) (previous ReopenGeneralForumTopicOption)
Option applies one or more ReopenGeneralForumTopicOption values and returns the last rollback option.
type ReplaceStickerInSetOption ¶
type ReplaceStickerInSetOption func(params *ReplaceStickerInSetParams) ReplaceStickerInSetOption
ReplaceStickerInSetOption configures ReplaceStickerInSetParams.
func WithReplaceStickerInSetName ¶
func WithReplaceStickerInSetName(value string) ReplaceStickerInSetOption
WithReplaceStickerInSetName sets the Name field.
Sticker set name
func WithReplaceStickerInSetOldSticker ¶
func WithReplaceStickerInSetOldSticker(value string) ReplaceStickerInSetOption
WithReplaceStickerInSetOldSticker sets the OldSticker field.
File identifier of the replaced sticker
func WithReplaceStickerInSetSticker ¶
func WithReplaceStickerInSetSticker(value InputSticker) ReplaceStickerInSetOption
WithReplaceStickerInSetSticker sets the Sticker field.
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 remains unchanged.
func WithReplaceStickerInSetUserID ¶
func WithReplaceStickerInSetUserID(value int64) ReplaceStickerInSetOption
WithReplaceStickerInSetUserID sets the UserID field.
User identifier of the sticker set owner
type ReplaceStickerInSetParams ¶
type ReplaceStickerInSetParams struct {
// User identifier of the sticker set owner
UserID int64 `json:"user_id"`
// Sticker set name
Name string `json:"name"`
// File identifier of the replaced sticker
OldSticker string `json:"old_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 remains unchanged.
Sticker InputSticker `json:"sticker"`
}
ReplaceStickerInSetParams contains parameters for Client.ReplaceStickerInSet.
func (*ReplaceStickerInSetParams) Option ¶
func (r *ReplaceStickerInSetParams) Option(opts ...ReplaceStickerInSetOption) (previous ReplaceStickerInSetOption)
Option applies one or more ReplaceStickerInSetOption values and returns the last rollback option.
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct {
// Array of button rows, each represented by an Array of [KeyboardButton] objects
//
// [KeyboardButton]: https://core.telegram.org/bots/api#keyboardbutton
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 to a message in the same chat and forum topic, 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.
//
// [Message]: https://core.telegram.org/bots/api#message
Selective bool `json:"selective,omitempty"`
}
ReplyKeyboardMarkup
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.
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])
//
// [ReplyKeyboardMarkup]: https://core.telegram.org/bots/api#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 to a message in the same chat and forum topic, 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.
//
// [Message]: https://core.telegram.org/bots/api#message
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). Not supported in channels and for messages sent on behalf of a Telegram Business account.
type ReplyMarkup ¶
type ReplyMarkup struct {
*InlineKeyboardMarkup
*ReplyKeyboardMarkup
*ReplyKeyboardRemove
*ForceReply
}
ReplyMarkup contains one of Telegram reply markup types.
type ReplyParameters ¶
type ReplyParameters struct {
// Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified
MessageID int64 `json:"message_id"`
// Optional.
// If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername).
// Not supported for messages sent on behalf of a business account and messages from channel direct messages chats.
ChatID string `json:"chat_id,omitempty"`
// Optional.
// Pass True if the message should be sent even if the specified message to be replied to is not found.
// Always False for replies in another chat or forum topic.
// Always True for messages sent on behalf of a business account.
AllowSendingWithoutReply bool `json:"allow_sending_without_reply,omitempty"`
// Optional.
// Quoted part of the message to be replied to; 0-1024 characters after entities parsing.
// The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities.
// The message will fail to send if the quote isn't found in the original message.
Quote string `json:"quote,omitempty"`
// Optional.
// Mode for parsing entities in the quote.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
QuoteParseMode string `json:"quote_parse_mode,omitempty"`
// Optional.
// A JSON-serialized list of special entities that appear in the quote.
// It can be specified instead of quote_parse_mode.
QuoteEntities []MessageEntity `json:"quote_entities,omitempty"`
// Optional.
// Position of the quote in the original message in UTF-16 code units
QuotePosition int64 `json:"quote_position,omitempty"`
// Optional.
// Identifier of the specific checklist task to be replied to
ChecklistTaskID int64 `json:"checklist_task_id,omitempty"`
}
ReplyParameters
Describes reply parameters for the message that is being sent.
type RepostStoryOption ¶
type RepostStoryOption func(params *RepostStoryParams) RepostStoryOption
RepostStoryOption configures RepostStoryParams.
func WithRepostStoryActivePeriod ¶
func WithRepostStoryActivePeriod(value int64) RepostStoryOption
WithRepostStoryActivePeriod sets the ActivePeriod field.
Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
func WithRepostStoryBusinessConnectionID ¶
func WithRepostStoryBusinessConnectionID(value string) RepostStoryOption
WithRepostStoryBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithRepostStoryFromChatID ¶
func WithRepostStoryFromChatID(value int64) RepostStoryOption
WithRepostStoryFromChatID sets the FromChatID field.
Unique identifier of the chat which posted the story that should be reposted
func WithRepostStoryFromStoryID ¶
func WithRepostStoryFromStoryID(value int64) RepostStoryOption
WithRepostStoryFromStoryID sets the FromStoryID field.
Unique identifier of the story that should be reposted
func WithRepostStoryPostToChatPage ¶
func WithRepostStoryPostToChatPage(value bool) RepostStoryOption
WithRepostStoryPostToChatPage sets the PostToChatPage field.
Pass True to keep the story accessible after it expires
func WithRepostStoryProtectContent ¶
func WithRepostStoryProtectContent(value bool) RepostStoryOption
WithRepostStoryProtectContent sets the ProtectContent field.
Pass True if the content of the story must be protected from forwarding and screenshotting
type RepostStoryParams ¶
type RepostStoryParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the chat which posted the story that should be reposted
FromChatID int64 `json:"from_chat_id"`
// Unique identifier of the story that should be reposted
FromStoryID int64 `json:"from_story_id"`
// Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
ActivePeriod int64 `json:"active_period"`
// Pass True to keep the story accessible after it expires
PostToChatPage bool `json:"post_to_chat_page,omitempty"`
// Pass True if the content of the story must be protected from forwarding and screenshotting
ProtectContent bool `json:"protect_content,omitempty"`
}
RepostStoryParams contains parameters for Client.RepostStory.
func (*RepostStoryParams) Option ¶
func (r *RepostStoryParams) Option(opts ...RepostStoryOption) (previous RepostStoryOption)
Option applies one or more RepostStoryOption values and returns the last rollback option.
type Response ¶
type Response struct {
Parameters *ResponseParameters `json:"parameters,omitempty"`
Description string `json:"description,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
ErrorCode int `json:"error_code,omitempty"`
OK bool `json:"ok"`
}
Response represents a root API JSON object.
type ResponseParameters ¶
type ResponseParameters struct {
// Optional.
// The group has been migrated to a supergroup with the specified identifier.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`
// Optional.
// In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
RetryAfter int64 `json:"retry_after,omitempty"`
}
ResponseParameters
Describes why a request was unsuccessful.
type RestrictChatMemberOption ¶
type RestrictChatMemberOption func(params *RestrictChatMemberParams) RestrictChatMemberOption
RestrictChatMemberOption configures RestrictChatMemberParams.
func WithRestrictChatMemberChatID ¶
func WithRestrictChatMemberChatID(value string) RestrictChatMemberOption
WithRestrictChatMemberChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithRestrictChatMemberPermissions ¶
func WithRestrictChatMemberPermissions(value ChatPermissions) RestrictChatMemberOption
WithRestrictChatMemberPermissions sets the Permissions field.
A JSON-serialized object for new user permissions
func WithRestrictChatMemberUntilDate ¶
func WithRestrictChatMemberUntilDate(value int64) RestrictChatMemberOption
WithRestrictChatMemberUntilDate sets the UntilDate field.
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 WithRestrictChatMemberUseIndependentChatPermissions ¶
func WithRestrictChatMemberUseIndependentChatPermissions(value bool) RestrictChatMemberOption
WithRestrictChatMemberUseIndependentChatPermissions sets the UseIndependentChatPermissions field.
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 WithRestrictChatMemberUserID ¶
func WithRestrictChatMemberUserID(value int64) RestrictChatMemberOption
WithRestrictChatMemberUserID sets the UserID field.
Unique identifier of the target user
type RestrictChatMemberParams ¶
type RestrictChatMemberParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// A JSON-serialized object for new user permissions
Permissions ChatPermissions `json:"permissions"`
// 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.
UseIndependentChatPermissions bool `json:"use_independent_chat_permissions,omitempty"`
// Date when restrictions will be lifted for the user; Unix time.
// If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever
UntilDate int64 `json:"until_date,omitempty"`
}
RestrictChatMemberParams contains parameters for Client.RestrictChatMember.
func (*RestrictChatMemberParams) Option ¶
func (r *RestrictChatMemberParams) Option(opts ...RestrictChatMemberOption) (previous RestrictChatMemberOption)
Option applies one or more RestrictChatMemberOption values and returns the last rollback option.
type RetryError ¶
RetryError represents a rate limit error. It contains the duration to wait before retrying the request.
func (*RetryError) Error ¶
func (e *RetryError) Error() string
func (*RetryError) Unwrap ¶
func (e *RetryError) Unwrap() error
type RevenueWithdrawalState ¶
type RevenueWithdrawalState struct {
*RevenueWithdrawalStatePending
*RevenueWithdrawalStateSucceeded
*RevenueWithdrawalStateFailed
}
RevenueWithdrawalState
This object describes the state of a revenue withdrawal operation. Currently, it can be one of
RevenueWithdrawalStateSucceeded
func (*RevenueWithdrawalState) MarshalJSON ¶
func (r *RevenueWithdrawalState) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of RevenueWithdrawalState.
func (*RevenueWithdrawalState) UnmarshalJSON ¶
func (r *RevenueWithdrawalState) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching RevenueWithdrawalState subtype.
type RevenueWithdrawalStateFailed ¶
type RevenueWithdrawalStateFailed struct {
// Type of the state, always “failed”
Type string `json:"type"`
}
RevenueWithdrawalStateFailed
The withdrawal failed and the transaction was refunded.
type RevenueWithdrawalStatePending ¶
type RevenueWithdrawalStatePending struct {
// Type of the state, always “pending”
Type string `json:"type"`
}
RevenueWithdrawalStatePending
The withdrawal is in progress.
type RevenueWithdrawalStateSucceeded ¶
type RevenueWithdrawalStateSucceeded struct {
// Type of the state, always “succeeded”
Type string `json:"type"`
// Date the withdrawal was completed in Unix time
Date int64 `json:"date"`
// An HTTPS URL that can be used to see transaction details
URL string `json:"url"`
}
RevenueWithdrawalStateSucceeded
The withdrawal succeeded.
type RevokeChatInviteLinkOption ¶
type RevokeChatInviteLinkOption func(params *RevokeChatInviteLinkParams) RevokeChatInviteLinkOption
RevokeChatInviteLinkOption configures RevokeChatInviteLinkParams.
func WithRevokeChatInviteLinkChatID ¶
func WithRevokeChatInviteLinkChatID(value string) RevokeChatInviteLinkOption
WithRevokeChatInviteLinkChatID sets the ChatID field.
Unique identifier of the target chat or username of the target channel (in the format @channelusername)
func WithRevokeChatInviteLinkInviteLink ¶
func WithRevokeChatInviteLinkInviteLink(value string) RevokeChatInviteLinkOption
WithRevokeChatInviteLinkInviteLink sets the InviteLink field.
The invite link to revoke
type RevokeChatInviteLinkParams ¶
type RevokeChatInviteLinkParams struct {
// Unique identifier of the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// The invite link to revoke
InviteLink string `json:"invite_link"`
}
RevokeChatInviteLinkParams contains parameters for Client.RevokeChatInviteLink.
func (*RevokeChatInviteLinkParams) Option ¶
func (r *RevokeChatInviteLinkParams) Option(opts ...RevokeChatInviteLinkOption) (previous RevokeChatInviteLinkOption)
Option applies one or more RevokeChatInviteLinkOption values and returns the last rollback option.
type Router ¶
type Router struct {
*RouterGroup
// contains filtered or unexported fields
}
Router dispatches updates to registered handlers.
func (*Router) HandleInlineKeyboardButton ¶
func (r *Router) HandleInlineKeyboardButton( b *InlineKeyboardButton, handler func(ctx *Context, cq *CallbackQuery, ) error)
HandleInlineKeyboardButton registers a handler for an inline keyboard button.
func (*Router) HandleKeyboardButton ¶
func (r *Router) HandleKeyboardButton(b *KeyboardButton, handler func(ctx *Context, m *Message) error)
HandleKeyboardButton registers a handler for a keyboard button.
func (*Router) SetHandlerDefault ¶
func (r *Router) SetHandlerDefault(handler HandlerFunc)
SetHandlerDefault sets the default handler for updates that don't match any route.
func (*Router) SetHandlerErr ¶
func (r *Router) SetHandlerErr(handler HandlerFuncErr)
SetHandlerErr sets the error handler for the router.
func (*Router) SetHandlerPanic ¶
func (r *Router) SetHandlerPanic(handler HandlerFuncPanic)
SetHandlerPanic sets the panic handler for the router.
func (*Router) Use ¶
func (r *Router) Use(funcs ...MiddlewareFunc)
Use adds middleware to the router. It must be called before handlers, as middlewares are applied in place.
type RouterGroup ¶
type RouterGroup struct {
// contains filtered or unexported fields
}
RouterGroup allows to group handlers with common middlewares and filters.
func (*RouterGroup) Group ¶
func (rg *RouterGroup) Group(filters ...Filter) *RouterGroup
Group creates a new router group with the provided filters.
func (*RouterGroup) HandleOnBusinessConnection ¶
func (rg *RouterGroup) HandleOnBusinessConnection(handler func(*Context, *BusinessConnection) error, filters ...Filter)
HandleOnBusinessConnection registers a handler for updates containing BusinessConnection.
func (*RouterGroup) HandleOnBusinessMessage ¶
func (rg *RouterGroup) HandleOnBusinessMessage(handler func(*Context, *Message) error, filters ...Filter)
HandleOnBusinessMessage registers a handler for updates containing BusinessMessage.
func (*RouterGroup) HandleOnCallbackQuery ¶
func (rg *RouterGroup) HandleOnCallbackQuery(handler func(*Context, *CallbackQuery) error, filters ...Filter)
HandleOnCallbackQuery registers a handler for updates containing CallbackQuery.
func (*RouterGroup) HandleOnChannelPost ¶
func (rg *RouterGroup) HandleOnChannelPost(handler func(*Context, *Message) error, filters ...Filter)
HandleOnChannelPost registers a handler for updates containing ChannelPost.
func (*RouterGroup) HandleOnChatBoost ¶
func (rg *RouterGroup) HandleOnChatBoost(handler func(*Context, *ChatBoostUpdated) error, filters ...Filter)
HandleOnChatBoost registers a handler for updates containing ChatBoost.
func (*RouterGroup) HandleOnChatJoinRequest ¶
func (rg *RouterGroup) HandleOnChatJoinRequest(handler func(*Context, *ChatJoinRequest) error, filters ...Filter)
HandleOnChatJoinRequest registers a handler for updates containing ChatJoinRequest.
func (*RouterGroup) HandleOnChatMember ¶
func (rg *RouterGroup) HandleOnChatMember(handler func(*Context, *ChatMemberUpdated) error, filters ...Filter)
HandleOnChatMember registers a handler for updates containing ChatMember.
func (*RouterGroup) HandleOnChosenInlineResult ¶
func (rg *RouterGroup) HandleOnChosenInlineResult(handler func(*Context, *ChosenInlineResult) error, filters ...Filter)
HandleOnChosenInlineResult registers a handler for updates containing ChosenInlineResult.
func (*RouterGroup) HandleOnDeletedBusinessMessages ¶
func (rg *RouterGroup) HandleOnDeletedBusinessMessages(handler func(*Context, *BusinessMessagesDeleted) error, filters ...Filter)
HandleOnDeletedBusinessMessages registers a handler for updates containing DeletedBusinessMessages.
func (*RouterGroup) HandleOnEditedBusinessMessage ¶
func (rg *RouterGroup) HandleOnEditedBusinessMessage(handler func(*Context, *Message) error, filters ...Filter)
HandleOnEditedBusinessMessage registers a handler for updates containing EditedBusinessMessage.
func (*RouterGroup) HandleOnEditedChannelPost ¶
func (rg *RouterGroup) HandleOnEditedChannelPost(handler func(*Context, *Message) error, filters ...Filter)
HandleOnEditedChannelPost registers a handler for updates containing EditedChannelPost.
func (*RouterGroup) HandleOnEditedMessage ¶
func (rg *RouterGroup) HandleOnEditedMessage(handler func(*Context, *Message) error, filters ...Filter)
HandleOnEditedMessage registers a handler for updates containing EditedMessage.
func (*RouterGroup) HandleOnInlineQuery ¶
func (rg *RouterGroup) HandleOnInlineQuery(handler func(*Context, *InlineQuery) error, filters ...Filter)
HandleOnInlineQuery registers a handler for updates containing InlineQuery.
func (*RouterGroup) HandleOnMessage ¶
func (rg *RouterGroup) HandleOnMessage(handler func(*Context, *Message) error, filters ...Filter)
HandleOnMessage registers a handler for updates containing Message.
func (*RouterGroup) HandleOnMessageReaction ¶
func (rg *RouterGroup) HandleOnMessageReaction(handler func(*Context, *MessageReactionUpdated) error, filters ...Filter)
HandleOnMessageReaction registers a handler for updates containing MessageReaction.
func (*RouterGroup) HandleOnMessageReactionCount ¶
func (rg *RouterGroup) HandleOnMessageReactionCount(handler func(*Context, *MessageReactionCountUpdated) error, filters ...Filter)
HandleOnMessageReactionCount registers a handler for updates containing MessageReactionCount.
func (*RouterGroup) HandleOnMyChatMember ¶
func (rg *RouterGroup) HandleOnMyChatMember(handler func(*Context, *ChatMemberUpdated) error, filters ...Filter)
HandleOnMyChatMember registers a handler for updates containing MyChatMember.
func (*RouterGroup) HandleOnPoll ¶
func (rg *RouterGroup) HandleOnPoll(handler func(*Context, *Poll) error, filters ...Filter)
HandleOnPoll registers a handler for updates containing Poll.
func (*RouterGroup) HandleOnPollAnswer ¶
func (rg *RouterGroup) HandleOnPollAnswer(handler func(*Context, *PollAnswer) error, filters ...Filter)
HandleOnPollAnswer registers a handler for updates containing PollAnswer.
func (*RouterGroup) HandleOnPreCheckoutQuery ¶
func (rg *RouterGroup) HandleOnPreCheckoutQuery(handler func(*Context, *PreCheckoutQuery) error, filters ...Filter)
HandleOnPreCheckoutQuery registers a handler for updates containing PreCheckoutQuery.
func (*RouterGroup) HandleOnPurchasedPaidMedia ¶
func (rg *RouterGroup) HandleOnPurchasedPaidMedia(handler func(*Context, *PaidMediaPurchased) error, filters ...Filter)
HandleOnPurchasedPaidMedia registers a handler for updates containing PurchasedPaidMedia.
func (*RouterGroup) HandleOnRemovedChatBoost ¶
func (rg *RouterGroup) HandleOnRemovedChatBoost(handler func(*Context, *ChatBoostRemoved) error, filters ...Filter)
HandleOnRemovedChatBoost registers a handler for updates containing RemovedChatBoost.
func (*RouterGroup) HandleOnShippingQuery ¶
func (rg *RouterGroup) HandleOnShippingQuery(handler func(*Context, *ShippingQuery) error, filters ...Filter)
HandleOnShippingQuery registers a handler for updates containing ShippingQuery.
func (*RouterGroup) Use ¶
func (rg *RouterGroup) Use(funcs ...MiddlewareFunc)
Use adds middleware to the group.
type SavePreparedInlineMessageOption ¶
type SavePreparedInlineMessageOption func(params *SavePreparedInlineMessageParams) SavePreparedInlineMessageOption
SavePreparedInlineMessageOption configures SavePreparedInlineMessageParams.
func WithSavePreparedInlineMessageAllowBotChats ¶
func WithSavePreparedInlineMessageAllowBotChats(value bool) SavePreparedInlineMessageOption
WithSavePreparedInlineMessageAllowBotChats sets the AllowBotChats field.
Pass True if the message can be sent to private chats with bots
func WithSavePreparedInlineMessageAllowChannelChats ¶
func WithSavePreparedInlineMessageAllowChannelChats(value bool) SavePreparedInlineMessageOption
WithSavePreparedInlineMessageAllowChannelChats sets the AllowChannelChats field.
Pass True if the message can be sent to channel chats
func WithSavePreparedInlineMessageAllowGroupChats ¶
func WithSavePreparedInlineMessageAllowGroupChats(value bool) SavePreparedInlineMessageOption
WithSavePreparedInlineMessageAllowGroupChats sets the AllowGroupChats field.
Pass True if the message can be sent to group and supergroup chats
func WithSavePreparedInlineMessageAllowUserChats ¶
func WithSavePreparedInlineMessageAllowUserChats(value bool) SavePreparedInlineMessageOption
WithSavePreparedInlineMessageAllowUserChats sets the AllowUserChats field.
Pass True if the message can be sent to private chats with users
func WithSavePreparedInlineMessageResult ¶
func WithSavePreparedInlineMessageResult(value InlineQueryResult) SavePreparedInlineMessageOption
WithSavePreparedInlineMessageResult sets the Result field.
A JSON-serialized object describing the message to be sent
func WithSavePreparedInlineMessageUserID ¶
func WithSavePreparedInlineMessageUserID(value int64) SavePreparedInlineMessageOption
WithSavePreparedInlineMessageUserID sets the UserID field.
Unique identifier of the target user that can use the prepared message
type SavePreparedInlineMessageParams ¶
type SavePreparedInlineMessageParams struct {
// Unique identifier of the target user that can use the prepared message
UserID int64 `json:"user_id"`
// A JSON-serialized object describing the message to be sent
Result InlineQueryResult `json:"result"`
// Pass True if the message can be sent to private chats with users
AllowUserChats bool `json:"allow_user_chats,omitempty"`
// Pass True if the message can be sent to private chats with bots
AllowBotChats bool `json:"allow_bot_chats,omitempty"`
// Pass True if the message can be sent to group and supergroup chats
AllowGroupChats bool `json:"allow_group_chats,omitempty"`
// Pass True if the message can be sent to channel chats
AllowChannelChats bool `json:"allow_channel_chats,omitempty"`
}
SavePreparedInlineMessageParams contains parameters for Client.SavePreparedInlineMessage.
func (*SavePreparedInlineMessageParams) Option ¶
func (r *SavePreparedInlineMessageParams) Option(opts ...SavePreparedInlineMessageOption) (previous SavePreparedInlineMessageOption)
Option applies one or more SavePreparedInlineMessageOption values and returns the last rollback option.
type SendAnimationOption ¶
type SendAnimationOption func(params *SendAnimationParams) SendAnimationOption
SendAnimationOption configures SendAnimationParams.
func WithSendAnimationAllowPaidBroadcast ¶
func WithSendAnimationAllowPaidBroadcast(value bool) SendAnimationOption
WithSendAnimationAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendAnimationAnimation ¶
func WithSendAnimationAnimation(value InputFile) SendAnimationOption
WithSendAnimationAnimation sets the Animation field.
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 WithSendAnimationBusinessConnectionID ¶
func WithSendAnimationBusinessConnectionID(value string) SendAnimationOption
WithSendAnimationBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendAnimationCaption ¶
func WithSendAnimationCaption(value string) SendAnimationOption
WithSendAnimationCaption sets the Caption field.
Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
func WithSendAnimationCaptionEntities ¶
func WithSendAnimationCaptionEntities(value []MessageEntity) SendAnimationOption
WithSendAnimationCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendAnimationChatID ¶
func WithSendAnimationChatID(value string) SendAnimationOption
WithSendAnimationChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendAnimationDirectMessagesTopicID ¶
func WithSendAnimationDirectMessagesTopicID(value int64) SendAnimationOption
WithSendAnimationDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendAnimationDisableNotification ¶
func WithSendAnimationDisableNotification(value bool) SendAnimationOption
WithSendAnimationDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendAnimationDuration ¶
func WithSendAnimationDuration(value int64) SendAnimationOption
WithSendAnimationDuration sets the Duration field.
Duration of sent animation in seconds
func WithSendAnimationHasSpoiler ¶
func WithSendAnimationHasSpoiler(value bool) SendAnimationOption
WithSendAnimationHasSpoiler sets the HasSpoiler field.
Pass True if the animation needs to be covered with a spoiler animation
func WithSendAnimationHeight ¶
func WithSendAnimationHeight(value int64) SendAnimationOption
WithSendAnimationHeight sets the Height field.
Animation height
func WithSendAnimationMessageEffectID ¶
func WithSendAnimationMessageEffectID(value string) SendAnimationOption
WithSendAnimationMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendAnimationMessageThreadID ¶
func WithSendAnimationMessageThreadID(value int64) SendAnimationOption
WithSendAnimationMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendAnimationParseMode ¶
func WithSendAnimationParseMode(value string) SendAnimationOption
WithSendAnimationParseMode sets the ParseMode field.
Mode for parsing entities in the animation caption. See formatting options for more details.
func WithSendAnimationProtectContent ¶
func WithSendAnimationProtectContent(value bool) SendAnimationOption
WithSendAnimationProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendAnimationReplyMarkup ¶
func WithSendAnimationReplyMarkup(value *ReplyMarkup) SendAnimationOption
WithSendAnimationReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendAnimationReplyParameters ¶
func WithSendAnimationReplyParameters(value *ReplyParameters) SendAnimationOption
WithSendAnimationReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendAnimationShowCaptionAboveMedia ¶
func WithSendAnimationShowCaptionAboveMedia(value bool) SendAnimationOption
WithSendAnimationShowCaptionAboveMedia sets the ShowCaptionAboveMedia field.
Pass True, if the caption must be shown above the message media
func WithSendAnimationSuggestedPostParameters ¶
func WithSendAnimationSuggestedPostParameters(value *SuggestedPostParameters) SendAnimationOption
WithSendAnimationSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendAnimationThumbnail ¶
func WithSendAnimationThumbnail(value *InputFile) SendAnimationOption
WithSendAnimationThumbnail sets the Thumbnail field.
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 WithSendAnimationWidth ¶
func WithSendAnimationWidth(value int64) SendAnimationOption
WithSendAnimationWidth sets the Width field.
Animation width
type SendAnimationParams ¶
type SendAnimationParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Animation InputFile `json:"animation"`
// Duration of sent animation in seconds
Duration int64 `json:"duration,omitempty"`
// Animation width
Width int64 `json:"width,omitempty"`
// Animation height
Height int64 `json:"height,omitempty"`
// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
// The thumbnail should be in JPEG format and less than 200 kB in size.
// A thumbnail's width and height should not exceed 320.
// Ignored if the file is not uploaded using multipart/form-data.
// Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the animation caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Pass True if the animation needs to be covered with a spoiler animation
HasSpoiler bool `json:"has_spoiler,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendAnimationParams contains parameters for Client.SendAnimation.
func (*SendAnimationParams) Option ¶
func (r *SendAnimationParams) Option(opts ...SendAnimationOption) (previous SendAnimationOption)
Option applies one or more SendAnimationOption values and returns the last rollback option.
type SendAudioOption ¶
type SendAudioOption func(params *SendAudioParams) SendAudioOption
SendAudioOption configures SendAudioParams.
func WithSendAudioAllowPaidBroadcast ¶
func WithSendAudioAllowPaidBroadcast(value bool) SendAudioOption
WithSendAudioAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendAudioAudio ¶
func WithSendAudioAudio(value InputFile) SendAudioOption
WithSendAudioAudio sets the Audio field.
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 WithSendAudioBusinessConnectionID ¶
func WithSendAudioBusinessConnectionID(value string) SendAudioOption
WithSendAudioBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendAudioCaption ¶
func WithSendAudioCaption(value string) SendAudioOption
WithSendAudioCaption sets the Caption field.
Audio caption, 0-1024 characters after entities parsing
func WithSendAudioCaptionEntities ¶
func WithSendAudioCaptionEntities(value []MessageEntity) SendAudioOption
WithSendAudioCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendAudioChatID ¶
func WithSendAudioChatID(value string) SendAudioOption
WithSendAudioChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendAudioDirectMessagesTopicID ¶
func WithSendAudioDirectMessagesTopicID(value int64) SendAudioOption
WithSendAudioDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendAudioDisableNotification ¶
func WithSendAudioDisableNotification(value bool) SendAudioOption
WithSendAudioDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendAudioDuration ¶
func WithSendAudioDuration(value int64) SendAudioOption
WithSendAudioDuration sets the Duration field.
Duration of the audio in seconds
func WithSendAudioMessageEffectID ¶
func WithSendAudioMessageEffectID(value string) SendAudioOption
WithSendAudioMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendAudioMessageThreadID ¶
func WithSendAudioMessageThreadID(value int64) SendAudioOption
WithSendAudioMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendAudioParseMode ¶
func WithSendAudioParseMode(value string) SendAudioOption
WithSendAudioParseMode sets the ParseMode field.
Mode for parsing entities in the audio caption. See formatting options for more details.
func WithSendAudioPerformer ¶
func WithSendAudioPerformer(value string) SendAudioOption
WithSendAudioPerformer sets the Performer field.
Performer
func WithSendAudioProtectContent ¶
func WithSendAudioProtectContent(value bool) SendAudioOption
WithSendAudioProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendAudioReplyMarkup ¶
func WithSendAudioReplyMarkup(value *ReplyMarkup) SendAudioOption
WithSendAudioReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendAudioReplyParameters ¶
func WithSendAudioReplyParameters(value *ReplyParameters) SendAudioOption
WithSendAudioReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendAudioSuggestedPostParameters ¶
func WithSendAudioSuggestedPostParameters(value *SuggestedPostParameters) SendAudioOption
WithSendAudioSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendAudioThumbnail ¶
func WithSendAudioThumbnail(value *InputFile) SendAudioOption
WithSendAudioThumbnail sets the Thumbnail field.
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 WithSendAudioTitle ¶
func WithSendAudioTitle(value string) SendAudioOption
WithSendAudioTitle sets the Title field.
Track name
type SendAudioParams ¶
type SendAudioParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Audio InputFile `json:"audio"`
// Audio caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the audio caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Duration of the audio in seconds
Duration int64 `json:"duration,omitempty"`
// Performer
Performer string `json:"performer,omitempty"`
// Track name
Title string `json:"title,omitempty"`
// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
// The thumbnail should be in JPEG format and less than 200 kB in size.
// A thumbnail's width and height should not exceed 320.
// Ignored if the file is not uploaded using multipart/form-data.
// Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendAudioParams contains parameters for Client.SendAudio.
func (*SendAudioParams) Option ¶
func (r *SendAudioParams) Option(opts ...SendAudioOption) (previous SendAudioOption)
Option applies one or more SendAudioOption values and returns the last rollback option.
type SendChatActionOption ¶
type SendChatActionOption func(params *SendChatActionParams) SendChatActionOption
SendChatActionOption configures SendChatActionParams.
func WithSendChatActionAction ¶
func WithSendChatActionAction(value string) SendChatActionOption
WithSendChatActionAction sets the Action field.
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 WithSendChatActionBusinessConnectionID ¶
func WithSendChatActionBusinessConnectionID(value string) SendChatActionOption
WithSendChatActionBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the action will be sent
func WithSendChatActionChatID ¶
func WithSendChatActionChatID(value string) SendChatActionOption
WithSendChatActionChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername). Channel chats and channel direct messages chats aren't supported.
func WithSendChatActionMessageThreadID ¶
func WithSendChatActionMessageThreadID(value int64) SendChatActionOption
WithSendChatActionMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
type SendChatActionParams ¶
type SendChatActionParams struct {
// Unique identifier of the business connection on behalf of which the action will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername).
// Channel chats and channel direct messages chats aren't supported.
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread or topic of a forum; for supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// 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].
//
// [text messages]: https://core.telegram.org/bots/api#sendmessage
// [photos]: https://core.telegram.org/bots/api#sendphoto
// [videos]: https://core.telegram.org/bots/api#sendvideo
// [voice notes]: https://core.telegram.org/bots/api#sendvoice
// [general files]: https://core.telegram.org/bots/api#senddocument
// [stickers]: https://core.telegram.org/bots/api#sendsticker
// [location data]: https://core.telegram.org/bots/api#sendlocation
// [video notes]: https://core.telegram.org/bots/api#sendvideonote
Action string `json:"action"`
}
SendChatActionParams contains parameters for Client.SendChatAction.
func (*SendChatActionParams) Option ¶
func (r *SendChatActionParams) Option(opts ...SendChatActionOption) (previous SendChatActionOption)
Option applies one or more SendChatActionOption values and returns the last rollback option.
type SendChecklistOption ¶
type SendChecklistOption func(params *SendChecklistParams) SendChecklistOption
SendChecklistOption configures SendChecklistParams.
func WithSendChecklistBusinessConnectionID ¶
func WithSendChecklistBusinessConnectionID(value string) SendChecklistOption
WithSendChecklistBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendChecklistChatID ¶
func WithSendChecklistChatID(value int64) SendChecklistOption
WithSendChecklistChatID sets the ChatID field.
Unique identifier for the target chat
func WithSendChecklistChecklist ¶
func WithSendChecklistChecklist(value InputChecklist) SendChecklistOption
WithSendChecklistChecklist sets the Checklist field.
A JSON-serialized object for the checklist to send
func WithSendChecklistDisableNotification ¶
func WithSendChecklistDisableNotification(value bool) SendChecklistOption
WithSendChecklistDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendChecklistMessageEffectID ¶
func WithSendChecklistMessageEffectID(value string) SendChecklistOption
WithSendChecklistMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message
func WithSendChecklistProtectContent ¶
func WithSendChecklistProtectContent(value bool) SendChecklistOption
WithSendChecklistProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendChecklistReplyMarkup ¶
func WithSendChecklistReplyMarkup(value *InlineKeyboardMarkup) SendChecklistOption
WithSendChecklistReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for an inline keyboard
func WithSendChecklistReplyParameters ¶
func WithSendChecklistReplyParameters(value *ReplyParameters) SendChecklistOption
WithSendChecklistReplyParameters sets the ReplyParameters field.
A JSON-serialized object for description of the message to reply to
type SendChecklistParams ¶
type SendChecklistParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier for the target chat
ChatID int64 `json:"chat_id"`
// A JSON-serialized object for the checklist to send
Checklist InputChecklist `json:"checklist"`
// Sends the message silently.
// Users will receive a notification with no sound.
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Unique identifier of the message effect to be added to the message
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object for description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// A JSON-serialized object for an [inline keyboard]
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
SendChecklistParams contains parameters for Client.SendChecklist.
func (*SendChecklistParams) Option ¶
func (r *SendChecklistParams) Option(opts ...SendChecklistOption) (previous SendChecklistOption)
Option applies one or more SendChecklistOption values and returns the last rollback option.
type SendContactOption ¶
type SendContactOption func(params *SendContactParams) SendContactOption
SendContactOption configures SendContactParams.
func WithSendContactAllowPaidBroadcast ¶
func WithSendContactAllowPaidBroadcast(value bool) SendContactOption
WithSendContactAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendContactBusinessConnectionID ¶
func WithSendContactBusinessConnectionID(value string) SendContactOption
WithSendContactBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendContactChatID ¶
func WithSendContactChatID(value string) SendContactOption
WithSendContactChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendContactDirectMessagesTopicID ¶
func WithSendContactDirectMessagesTopicID(value int64) SendContactOption
WithSendContactDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendContactDisableNotification ¶
func WithSendContactDisableNotification(value bool) SendContactOption
WithSendContactDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendContactFirstName ¶
func WithSendContactFirstName(value string) SendContactOption
WithSendContactFirstName sets the FirstName field.
Contact's first name
func WithSendContactLastName ¶
func WithSendContactLastName(value string) SendContactOption
WithSendContactLastName sets the LastName field.
Contact's last name
func WithSendContactMessageEffectID ¶
func WithSendContactMessageEffectID(value string) SendContactOption
WithSendContactMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendContactMessageThreadID ¶
func WithSendContactMessageThreadID(value int64) SendContactOption
WithSendContactMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendContactPhoneNumber ¶
func WithSendContactPhoneNumber(value string) SendContactOption
WithSendContactPhoneNumber sets the PhoneNumber field.
Contact's phone number
func WithSendContactProtectContent ¶
func WithSendContactProtectContent(value bool) SendContactOption
WithSendContactProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendContactReplyMarkup ¶
func WithSendContactReplyMarkup(value *ReplyMarkup) SendContactOption
WithSendContactReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendContactReplyParameters ¶
func WithSendContactReplyParameters(value *ReplyParameters) SendContactOption
WithSendContactReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendContactSuggestedPostParameters ¶
func WithSendContactSuggestedPostParameters(value *SuggestedPostParameters) SendContactOption
WithSendContactSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendContactVcard ¶
func WithSendContactVcard(value string) SendContactOption
WithSendContactVcard sets the Vcard field.
Additional data about the contact in the form of a vCard, 0-2048 bytes
type SendContactParams ¶
type SendContactParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Contact's phone number
PhoneNumber string `json:"phone_number"`
// Contact's first name
FirstName string `json:"first_name"`
// Contact's last name
LastName string `json:"last_name,omitempty"`
// Additional data about the contact in the form of a [vCard], 0-2048 bytes
//
// [vCard]: https://en.wikipedia.org/wiki/VCard
Vcard string `json:"vcard,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendContactParams contains parameters for Client.SendContact.
func (*SendContactParams) Option ¶
func (r *SendContactParams) Option(opts ...SendContactOption) (previous SendContactOption)
Option applies one or more SendContactOption values and returns the last rollback option.
type SendDiceOption ¶
type SendDiceOption func(params *SendDiceParams) SendDiceOption
SendDiceOption configures SendDiceParams.
func WithSendDiceAllowPaidBroadcast ¶
func WithSendDiceAllowPaidBroadcast(value bool) SendDiceOption
WithSendDiceAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendDiceBusinessConnectionID ¶
func WithSendDiceBusinessConnectionID(value string) SendDiceOption
WithSendDiceBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendDiceChatID ¶
func WithSendDiceChatID(value string) SendDiceOption
WithSendDiceChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendDiceDirectMessagesTopicID ¶
func WithSendDiceDirectMessagesTopicID(value int64) SendDiceOption
WithSendDiceDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendDiceDisableNotification ¶
func WithSendDiceDisableNotification(value bool) SendDiceOption
WithSendDiceDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendDiceEmoji ¶
func WithSendDiceEmoji(value string) SendDiceOption
WithSendDiceEmoji sets the Emoji field.
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 WithSendDiceMessageEffectID ¶
func WithSendDiceMessageEffectID(value string) SendDiceOption
WithSendDiceMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendDiceMessageThreadID ¶
func WithSendDiceMessageThreadID(value int64) SendDiceOption
WithSendDiceMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendDiceProtectContent ¶
func WithSendDiceProtectContent(value bool) SendDiceOption
WithSendDiceProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding
func WithSendDiceReplyMarkup ¶
func WithSendDiceReplyMarkup(value *ReplyMarkup) SendDiceOption
WithSendDiceReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendDiceReplyParameters ¶
func WithSendDiceReplyParameters(value *ReplyParameters) SendDiceOption
WithSendDiceReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendDiceSuggestedPostParameters ¶
func WithSendDiceSuggestedPostParameters(value *SuggestedPostParameters) SendDiceOption
WithSendDiceSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
type SendDiceParams ¶
type SendDiceParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Emoji on which the dice throw animation is based.
// Currently, must be one of “”, “”, “”, “”, “”, or “”.
// Dice can have values 1-6 for “”, “” and “”, values 1-5 for “” and “”, and values 1-64 for “”.
// Defaults to “”
Emoji string `json:"emoji,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendDiceParams contains parameters for Client.SendDice.
func (*SendDiceParams) Option ¶
func (r *SendDiceParams) Option(opts ...SendDiceOption) (previous SendDiceOption)
Option applies one or more SendDiceOption values and returns the last rollback option.
type SendDocumentOption ¶
type SendDocumentOption func(params *SendDocumentParams) SendDocumentOption
SendDocumentOption configures SendDocumentParams.
func WithSendDocumentAllowPaidBroadcast ¶
func WithSendDocumentAllowPaidBroadcast(value bool) SendDocumentOption
WithSendDocumentAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendDocumentBusinessConnectionID ¶
func WithSendDocumentBusinessConnectionID(value string) SendDocumentOption
WithSendDocumentBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendDocumentCaption ¶
func WithSendDocumentCaption(value string) SendDocumentOption
WithSendDocumentCaption sets the Caption field.
Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
func WithSendDocumentCaptionEntities ¶
func WithSendDocumentCaptionEntities(value []MessageEntity) SendDocumentOption
WithSendDocumentCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendDocumentChatID ¶
func WithSendDocumentChatID(value string) SendDocumentOption
WithSendDocumentChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendDocumentDirectMessagesTopicID ¶
func WithSendDocumentDirectMessagesTopicID(value int64) SendDocumentOption
WithSendDocumentDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendDocumentDisableContentTypeDetection ¶
func WithSendDocumentDisableContentTypeDetection(value bool) SendDocumentOption
WithSendDocumentDisableContentTypeDetection sets the DisableContentTypeDetection field.
Disables automatic server-side content type detection for files uploaded using multipart/form-data
func WithSendDocumentDisableNotification ¶
func WithSendDocumentDisableNotification(value bool) SendDocumentOption
WithSendDocumentDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendDocumentDocument ¶
func WithSendDocumentDocument(value InputFile) SendDocumentOption
WithSendDocumentDocument sets the Document field.
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 WithSendDocumentMessageEffectID ¶
func WithSendDocumentMessageEffectID(value string) SendDocumentOption
WithSendDocumentMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendDocumentMessageThreadID ¶
func WithSendDocumentMessageThreadID(value int64) SendDocumentOption
WithSendDocumentMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendDocumentParseMode ¶
func WithSendDocumentParseMode(value string) SendDocumentOption
WithSendDocumentParseMode sets the ParseMode field.
Mode for parsing entities in the document caption. See formatting options for more details.
func WithSendDocumentProtectContent ¶
func WithSendDocumentProtectContent(value bool) SendDocumentOption
WithSendDocumentProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendDocumentReplyMarkup ¶
func WithSendDocumentReplyMarkup(value *ReplyMarkup) SendDocumentOption
WithSendDocumentReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendDocumentReplyParameters ¶
func WithSendDocumentReplyParameters(value *ReplyParameters) SendDocumentOption
WithSendDocumentReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendDocumentSuggestedPostParameters ¶
func WithSendDocumentSuggestedPostParameters(value *SuggestedPostParameters) SendDocumentOption
WithSendDocumentSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendDocumentThumbnail ¶
func WithSendDocumentThumbnail(value *InputFile) SendDocumentOption
WithSendDocumentThumbnail sets the Thumbnail field.
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 SendDocumentParams ¶
type SendDocumentParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Document InputFile `json:"document"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the document caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Disables automatic server-side content type detection for files uploaded using multipart/form-data
DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendDocumentParams contains parameters for Client.SendDocument.
func (*SendDocumentParams) Option ¶
func (r *SendDocumentParams) Option(opts ...SendDocumentOption) (previous SendDocumentOption)
Option applies one or more SendDocumentOption values and returns the last rollback option.
type SendGameOption ¶
type SendGameOption func(params *SendGameParams) SendGameOption
SendGameOption configures SendGameParams.
func WithSendGameAllowPaidBroadcast ¶
func WithSendGameAllowPaidBroadcast(value bool) SendGameOption
WithSendGameAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendGameBusinessConnectionID ¶
func WithSendGameBusinessConnectionID(value string) SendGameOption
WithSendGameBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendGameChatID ¶
func WithSendGameChatID(value int64) SendGameOption
WithSendGameChatID sets the ChatID field.
Unique identifier for the target chat. Games can't be sent to channel direct messages chats and channel chats.
func WithSendGameDisableNotification ¶
func WithSendGameDisableNotification(value bool) SendGameOption
WithSendGameDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendGameGameShortName ¶
func WithSendGameGameShortName(value string) SendGameOption
WithSendGameGameShortName sets the GameShortName field.
Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.
func WithSendGameMessageEffectID ¶
func WithSendGameMessageEffectID(value string) SendGameOption
WithSendGameMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendGameMessageThreadID ¶
func WithSendGameMessageThreadID(value int64) SendGameOption
WithSendGameMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendGameProtectContent ¶
func WithSendGameProtectContent(value bool) SendGameOption
WithSendGameProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendGameReplyMarkup ¶
func WithSendGameReplyMarkup(value *InlineKeyboardMarkup) SendGameOption
WithSendGameReplyMarkup sets the ReplyMarkup field.
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 WithSendGameReplyParameters ¶
func WithSendGameReplyParameters(value *ReplyParameters) SendGameOption
WithSendGameReplyParameters sets the ReplyParameters field.
Description of the message to reply to
type SendGameParams ¶
type SendGameParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat.
// Games can't be sent to channel direct messages chats and channel chats.
ChatID int64 `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Short name of the game, serves as the unique identifier for the game.
// Set up your games via [@BotFather].
//
// [@BotFather]: https://t.me/botfather
GameShortName string `json:"game_short_name"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// A JSON-serialized object for an [inline keyboard].
// If empty, one 'Play game_title' button will be shown.
// If not empty, the first button must launch the game.
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
SendGameParams contains parameters for Client.SendGame.
func (*SendGameParams) Option ¶
func (r *SendGameParams) Option(opts ...SendGameOption) (previous SendGameOption)
Option applies one or more SendGameOption values and returns the last rollback option.
type SendGiftOption ¶
type SendGiftOption func(params *SendGiftParams) SendGiftOption
SendGiftOption configures SendGiftParams.
func WithSendGiftChatID ¶
func WithSendGiftChatID(value string) SendGiftOption
WithSendGiftChatID sets the ChatID field.
Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.
func WithSendGiftGiftID ¶
func WithSendGiftGiftID(value string) SendGiftOption
WithSendGiftGiftID sets the GiftID field.
Identifier of the gift; limited gifts can't be sent to channel chats
func WithSendGiftPayForUpgrade ¶
func WithSendGiftPayForUpgrade(value bool) SendGiftOption
WithSendGiftPayForUpgrade sets the PayForUpgrade field.
Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
func WithSendGiftText ¶
func WithSendGiftText(value string) SendGiftOption
WithSendGiftText sets the Text field.
Text that will be shown along with the gift; 0-128 characters
func WithSendGiftTextEntities ¶
func WithSendGiftTextEntities(value []MessageEntity) SendGiftOption
WithSendGiftTextEntities sets the TextEntities field.
A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
func WithSendGiftTextParseMode ¶
func WithSendGiftTextParseMode(value string) SendGiftOption
WithSendGiftTextParseMode sets the TextParseMode field.
Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
func WithSendGiftUserID ¶
func WithSendGiftUserID(value int64) SendGiftOption
WithSendGiftUserID sets the UserID field.
Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.
type SendGiftParams ¶
type SendGiftParams struct {
// Required if chat_id is not specified.
// Unique identifier of the target user who will receive the gift.
UserID int64 `json:"user_id,omitempty"`
// Required if user_id is not specified.
// Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.
ChatID string `json:"chat_id,omitempty"`
// Identifier of the gift; limited gifts can't be sent to channel chats
GiftID string `json:"gift_id"`
// Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
PayForUpgrade bool `json:"pay_for_upgrade,omitempty"`
// Text that will be shown along with the gift; 0-128 characters
Text string `json:"text,omitempty"`
// Mode for parsing entities in the text.
// See [formatting options] for more details.
// Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
TextParseMode string `json:"text_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the gift text.
// It can be specified instead of text_parse_mode.
// Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
TextEntities []MessageEntity `json:"text_entities,omitempty"`
}
SendGiftParams contains parameters for Client.SendGift.
func (*SendGiftParams) Option ¶
func (r *SendGiftParams) Option(opts ...SendGiftOption) (previous SendGiftOption)
Option applies one or more SendGiftOption values and returns the last rollback option.
type SendInvoiceOption ¶
type SendInvoiceOption func(params *SendInvoiceParams) SendInvoiceOption
SendInvoiceOption configures SendInvoiceParams.
func WithSendInvoiceAllowPaidBroadcast ¶
func WithSendInvoiceAllowPaidBroadcast(value bool) SendInvoiceOption
WithSendInvoiceAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendInvoiceChatID ¶
func WithSendInvoiceChatID(value string) SendInvoiceOption
WithSendInvoiceChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendInvoiceCurrency ¶
func WithSendInvoiceCurrency(value string) SendInvoiceOption
WithSendInvoiceCurrency sets the Currency field.
Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
func WithSendInvoiceDescription ¶
func WithSendInvoiceDescription(value string) SendInvoiceOption
WithSendInvoiceDescription sets the Description field.
Product description, 1-255 characters
func WithSendInvoiceDirectMessagesTopicID ¶
func WithSendInvoiceDirectMessagesTopicID(value int64) SendInvoiceOption
WithSendInvoiceDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendInvoiceDisableNotification ¶
func WithSendInvoiceDisableNotification(value bool) SendInvoiceOption
WithSendInvoiceDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendInvoiceIsFlexible ¶
func WithSendInvoiceIsFlexible(value bool) SendInvoiceOption
WithSendInvoiceIsFlexible sets the IsFlexible field.
Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.
func WithSendInvoiceMaxTipAmount ¶
func WithSendInvoiceMaxTipAmount(value int64) SendInvoiceOption
WithSendInvoiceMaxTipAmount sets the MaxTipAmount field.
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. Not supported for payments in Telegram Stars.
func WithSendInvoiceMessageEffectID ¶
func WithSendInvoiceMessageEffectID(value string) SendInvoiceOption
WithSendInvoiceMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendInvoiceMessageThreadID ¶
func WithSendInvoiceMessageThreadID(value int64) SendInvoiceOption
WithSendInvoiceMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendInvoiceNeedEmail ¶
func WithSendInvoiceNeedEmail(value bool) SendInvoiceOption
WithSendInvoiceNeedEmail sets the NeedEmail field.
Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars.
func WithSendInvoiceNeedName ¶
func WithSendInvoiceNeedName(value bool) SendInvoiceOption
WithSendInvoiceNeedName sets the NeedName field.
Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars.
func WithSendInvoiceNeedPhoneNumber ¶
func WithSendInvoiceNeedPhoneNumber(value bool) SendInvoiceOption
WithSendInvoiceNeedPhoneNumber sets the NeedPhoneNumber field.
Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars.
func WithSendInvoiceNeedShippingAddress ¶
func WithSendInvoiceNeedShippingAddress(value bool) SendInvoiceOption
WithSendInvoiceNeedShippingAddress sets the NeedShippingAddress field.
Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars.
func WithSendInvoicePayload ¶
func WithSendInvoicePayload(value string) SendInvoiceOption
WithSendInvoicePayload sets the Payload field.
Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
func WithSendInvoicePhotoHeight ¶
func WithSendInvoicePhotoHeight(value int64) SendInvoiceOption
WithSendInvoicePhotoHeight sets the PhotoHeight field.
Photo height
func WithSendInvoicePhotoSize ¶
func WithSendInvoicePhotoSize(value int64) SendInvoiceOption
WithSendInvoicePhotoSize sets the PhotoSize field.
Photo size in bytes
func WithSendInvoicePhotoUrl ¶
func WithSendInvoicePhotoUrl(value string) SendInvoiceOption
WithSendInvoicePhotoUrl sets the PhotoUrl field.
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 WithSendInvoicePhotoWidth ¶
func WithSendInvoicePhotoWidth(value int64) SendInvoiceOption
WithSendInvoicePhotoWidth sets the PhotoWidth field.
Photo width
func WithSendInvoicePrices ¶
func WithSendInvoicePrices(value []LabeledPrice) SendInvoiceOption
WithSendInvoicePrices sets the Prices field.
Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
func WithSendInvoiceProtectContent ¶
func WithSendInvoiceProtectContent(value bool) SendInvoiceOption
WithSendInvoiceProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendInvoiceProviderData ¶
func WithSendInvoiceProviderData(value string) SendInvoiceOption
WithSendInvoiceProviderData sets the ProviderData field.
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 WithSendInvoiceProviderToken ¶
func WithSendInvoiceProviderToken(value string) SendInvoiceOption
WithSendInvoiceProviderToken sets the ProviderToken field.
Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.
func WithSendInvoiceReplyMarkup ¶
func WithSendInvoiceReplyMarkup(value *InlineKeyboardMarkup) SendInvoiceOption
WithSendInvoiceReplyMarkup sets the ReplyMarkup field.
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 WithSendInvoiceReplyParameters ¶
func WithSendInvoiceReplyParameters(value *ReplyParameters) SendInvoiceOption
WithSendInvoiceReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendInvoiceSendEmailToProvider ¶
func WithSendInvoiceSendEmailToProvider(value bool) SendInvoiceOption
WithSendInvoiceSendEmailToProvider sets the SendEmailToProvider field.
Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars.
func WithSendInvoiceSendPhoneNumberToProvider ¶
func WithSendInvoiceSendPhoneNumberToProvider(value bool) SendInvoiceOption
WithSendInvoiceSendPhoneNumberToProvider sets the SendPhoneNumberToProvider field.
Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars.
func WithSendInvoiceStartParameter ¶
func WithSendInvoiceStartParameter(value string) SendInvoiceOption
WithSendInvoiceStartParameter sets the StartParameter field.
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 WithSendInvoiceSuggestedPostParameters ¶
func WithSendInvoiceSuggestedPostParameters(value *SuggestedPostParameters) SendInvoiceOption
WithSendInvoiceSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendInvoiceSuggestedTipAmounts ¶
func WithSendInvoiceSuggestedTipAmounts(value []int64) SendInvoiceOption
WithSendInvoiceSuggestedTipAmounts sets the SuggestedTipAmounts field.
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 WithSendInvoiceTitle ¶
func WithSendInvoiceTitle(value string) SendInvoiceOption
WithSendInvoiceTitle sets the Title field.
Product name, 1-32 characters
type SendInvoiceParams ¶
type SendInvoiceParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 it for your internal processes.
Payload string `json:"payload"`
// Payment provider token, obtained via [@BotFather].
// Pass an empty string for payments in [Telegram Stars].
//
// [@BotFather]: https://t.me/botfather
// [Telegram Stars]: https://t.me/BotNews/90
ProviderToken string `json:"provider_token,omitempty"`
// Three-letter ISO 4217 currency code, see [more on currencies].
// Pass “XTR” for payments in [Telegram Stars].
//
// [more on currencies]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
Currency string `json:"currency"`
// Price breakdown, a JSON-serialized list of components (e.g.
// product price, tax, discount, delivery cost, delivery tax, bonus, etc.).
// Must contain exactly one item for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
Prices []LabeledPrice `json:"prices"`
// 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.
// Not supported for payments in [Telegram Stars].
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
// [Telegram Stars]: https://t.me/BotNews/90
MaxTipAmount int64 `json:"max_tip_amount,omitempty"`
// 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.
SuggestedTipAmounts []int64 `json:"suggested_tip_amounts,omitempty"`
// 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
StartParameter string `json:"start_parameter,omitempty"`
// JSON-serialized data about the invoice, which will be shared with the payment provider.
// A detailed description of required fields should be provided by the payment provider.
ProviderData string `json:"provider_data,omitempty"`
// URL of the product photo for the invoice.
// Can be a photo of the goods or a marketing image for a service.
// People like it better when they see what they are paying for.
PhotoUrl string `json:"photo_url,omitempty"`
// Photo size in bytes
PhotoSize int64 `json:"photo_size,omitempty"`
// Photo width
PhotoWidth int64 `json:"photo_width,omitempty"`
// Photo height
PhotoHeight int64 `json:"photo_height,omitempty"`
// Pass True if you require the user's full name to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedName bool `json:"need_name,omitempty"`
// Pass True if you require the user's phone number to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedPhoneNumber bool `json:"need_phone_number,omitempty"`
// Pass True if you require the user's email address to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedEmail bool `json:"need_email,omitempty"`
// Pass True if you require the user's shipping address to complete the order.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
NeedShippingAddress bool `json:"need_shipping_address,omitempty"`
// Pass True if the user's phone number should be sent to the provider.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"`
// Pass True if the user's email address should be sent to the provider.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
SendEmailToProvider bool `json:"send_email_to_provider,omitempty"`
// Pass True if the final price depends on the shipping method.
// Ignored for payments in [Telegram Stars].
//
// [Telegram Stars]: https://t.me/BotNews/90
IsFlexible bool `json:"is_flexible,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// A JSON-serialized object for an [inline keyboard].
// If empty, one 'Pay total price' button will be shown.
// If not empty, the first button must be a Pay button.
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
SendInvoiceParams contains parameters for Client.SendInvoice.
func (*SendInvoiceParams) Option ¶
func (r *SendInvoiceParams) Option(opts ...SendInvoiceOption) (previous SendInvoiceOption)
Option applies one or more SendInvoiceOption values and returns the last rollback option.
type SendLocationOption ¶
type SendLocationOption func(params *SendLocationParams) SendLocationOption
SendLocationOption configures SendLocationParams.
func WithSendLocationAllowPaidBroadcast ¶
func WithSendLocationAllowPaidBroadcast(value bool) SendLocationOption
WithSendLocationAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendLocationBusinessConnectionID ¶
func WithSendLocationBusinessConnectionID(value string) SendLocationOption
WithSendLocationBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendLocationChatID ¶
func WithSendLocationChatID(value string) SendLocationOption
WithSendLocationChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendLocationDirectMessagesTopicID ¶
func WithSendLocationDirectMessagesTopicID(value int64) SendLocationOption
WithSendLocationDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendLocationDisableNotification ¶
func WithSendLocationDisableNotification(value bool) SendLocationOption
WithSendLocationDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendLocationHeading ¶
func WithSendLocationHeading(value int64) SendLocationOption
WithSendLocationHeading sets the Heading field.
For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
func WithSendLocationHorizontalAccuracy ¶
func WithSendLocationHorizontalAccuracy(value float64) SendLocationOption
WithSendLocationHorizontalAccuracy sets the HorizontalAccuracy field.
The radius of uncertainty for the location, measured in meters; 0-1500
func WithSendLocationLatitude ¶
func WithSendLocationLatitude(value float64) SendLocationOption
WithSendLocationLatitude sets the Latitude field.
Latitude of the location
func WithSendLocationLivePeriod ¶
func WithSendLocationLivePeriod(value int64) SendLocationOption
WithSendLocationLivePeriod sets the LivePeriod field.
Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
func WithSendLocationLongitude ¶
func WithSendLocationLongitude(value float64) SendLocationOption
WithSendLocationLongitude sets the Longitude field.
Longitude of the location
func WithSendLocationMessageEffectID ¶
func WithSendLocationMessageEffectID(value string) SendLocationOption
WithSendLocationMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendLocationMessageThreadID ¶
func WithSendLocationMessageThreadID(value int64) SendLocationOption
WithSendLocationMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendLocationProtectContent ¶
func WithSendLocationProtectContent(value bool) SendLocationOption
WithSendLocationProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendLocationProximityAlertRadius ¶
func WithSendLocationProximityAlertRadius(value int64) SendLocationOption
WithSendLocationProximityAlertRadius sets the ProximityAlertRadius field.
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 WithSendLocationReplyMarkup ¶
func WithSendLocationReplyMarkup(value *ReplyMarkup) SendLocationOption
WithSendLocationReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendLocationReplyParameters ¶
func WithSendLocationReplyParameters(value *ReplyParameters) SendLocationOption
WithSendLocationReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendLocationSuggestedPostParameters ¶
func WithSendLocationSuggestedPostParameters(value *SuggestedPostParameters) SendLocationOption
WithSendLocationSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
type SendLocationParams ¶
type SendLocationParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Latitude of the location
Latitude float64 `json:"latitude"`
// Longitude of the location
Longitude float64 `json:"longitude"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
// Period in seconds during which the location will be updated (see [Live Locations], should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely.
//
// [Live Locations]: https://telegram.org/blog/live-locations
LivePeriod int64 `json:"live_period,omitempty"`
// For live locations, a direction in which the user is moving, in degrees.
// Must be between 1 and 360 if specified.
Heading int64 `json:"heading,omitempty"`
// For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters.
// Must be between 1 and 100000 if specified.
ProximityAlertRadius int64 `json:"proximity_alert_radius,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendLocationParams contains parameters for Client.SendLocation.
func (*SendLocationParams) Option ¶
func (r *SendLocationParams) Option(opts ...SendLocationOption) (previous SendLocationOption)
Option applies one or more SendLocationOption values and returns the last rollback option.
type SendMediaGroupOption ¶
type SendMediaGroupOption func(params *SendMediaGroupParams) SendMediaGroupOption
SendMediaGroupOption configures SendMediaGroupParams.
func WithSendMediaGroupAllowPaidBroadcast ¶
func WithSendMediaGroupAllowPaidBroadcast(value bool) SendMediaGroupOption
WithSendMediaGroupAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendMediaGroupBusinessConnectionID ¶
func WithSendMediaGroupBusinessConnectionID(value string) SendMediaGroupOption
WithSendMediaGroupBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendMediaGroupChatID ¶
func WithSendMediaGroupChatID(value string) SendMediaGroupOption
WithSendMediaGroupChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendMediaGroupDirectMessagesTopicID ¶
func WithSendMediaGroupDirectMessagesTopicID(value int64) SendMediaGroupOption
WithSendMediaGroupDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
func WithSendMediaGroupDisableNotification ¶
func WithSendMediaGroupDisableNotification(value bool) SendMediaGroupOption
WithSendMediaGroupDisableNotification sets the DisableNotification field.
Sends messages silently. Users will receive a notification with no sound.
func WithSendMediaGroupMedia ¶
func WithSendMediaGroupMedia(value []InputMedia) SendMediaGroupOption
WithSendMediaGroupMedia sets the Media field.
A JSON-serialized array describing messages to be sent, must include 2-10 items
func WithSendMediaGroupMessageEffectID ¶
func WithSendMediaGroupMessageEffectID(value string) SendMediaGroupOption
WithSendMediaGroupMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendMediaGroupMessageThreadID ¶
func WithSendMediaGroupMessageThreadID(value int64) SendMediaGroupOption
WithSendMediaGroupMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendMediaGroupProtectContent ¶
func WithSendMediaGroupProtectContent(value bool) SendMediaGroupOption
WithSendMediaGroupProtectContent sets the ProtectContent field.
Protects the contents of the sent messages from forwarding and saving
func WithSendMediaGroupReplyParameters ¶
func WithSendMediaGroupReplyParameters(value *ReplyParameters) SendMediaGroupOption
WithSendMediaGroupReplyParameters sets the ReplyParameters field.
Description of the message to reply to
type SendMediaGroupParams ¶
type SendMediaGroupParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// A JSON-serialized array describing messages to be sent, must include 2-10 items
Media []InputMedia `json:"media"`
// Sends messages [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent messages from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
}
SendMediaGroupParams contains parameters for Client.SendMediaGroup.
func (*SendMediaGroupParams) Option ¶
func (r *SendMediaGroupParams) Option(opts ...SendMediaGroupOption) (previous SendMediaGroupOption)
Option applies one or more SendMediaGroupOption values and returns the last rollback option.
type SendMessageDraftOption ¶
type SendMessageDraftOption func(params *SendMessageDraftParams) SendMessageDraftOption
SendMessageDraftOption configures SendMessageDraftParams.
func WithSendMessageDraftChatID ¶
func WithSendMessageDraftChatID(value int64) SendMessageDraftOption
WithSendMessageDraftChatID sets the ChatID field.
Unique identifier for the target private chat
func WithSendMessageDraftDraftID ¶
func WithSendMessageDraftDraftID(value int64) SendMessageDraftOption
WithSendMessageDraftDraftID sets the DraftID field.
Unique identifier of the message draft; must be non-zero. Changes of drafts with the same identifier are animated
func WithSendMessageDraftEntities ¶
func WithSendMessageDraftEntities(value []MessageEntity) SendMessageDraftOption
WithSendMessageDraftEntities sets the Entities field.
A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
func WithSendMessageDraftMessageThreadID ¶
func WithSendMessageDraftMessageThreadID(value int64) SendMessageDraftOption
WithSendMessageDraftMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread
func WithSendMessageDraftParseMode ¶
func WithSendMessageDraftParseMode(value string) SendMessageDraftOption
WithSendMessageDraftParseMode sets the ParseMode field.
Mode for parsing entities in the message text. See formatting options for more details.
func WithSendMessageDraftText ¶
func WithSendMessageDraftText(value string) SendMessageDraftOption
WithSendMessageDraftText sets the Text field.
Text of the message to be sent, 1-4096 characters after entities parsing
type SendMessageDraftParams ¶
type SendMessageDraftParams struct {
// Unique identifier for the target private chat
ChatID int64 `json:"chat_id"`
// Unique identifier for the target message thread
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Unique identifier of the message draft; must be non-zero.
// Changes of drafts with the same identifier are animated
DraftID int64 `json:"draft_id"`
// Text of the message to be sent, 1-4096 characters after entities parsing
Text string `json:"text"`
// Mode for parsing entities in the message text.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
}
SendMessageDraftParams contains parameters for Client.SendMessageDraft.
func (*SendMessageDraftParams) Option ¶
func (r *SendMessageDraftParams) Option(opts ...SendMessageDraftOption) (previous SendMessageDraftOption)
Option applies one or more SendMessageDraftOption values and returns the last rollback option.
type SendMessageOption ¶
type SendMessageOption func(params *SendMessageParams) SendMessageOption
SendMessageOption configures SendMessageParams.
func WithSendMessageAllowPaidBroadcast ¶
func WithSendMessageAllowPaidBroadcast(value bool) SendMessageOption
WithSendMessageAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendMessageBusinessConnectionID ¶
func WithSendMessageBusinessConnectionID(value string) SendMessageOption
WithSendMessageBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendMessageChatID ¶
func WithSendMessageChatID(value string) SendMessageOption
WithSendMessageChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendMessageDirectMessagesTopicID ¶
func WithSendMessageDirectMessagesTopicID(value int64) SendMessageOption
WithSendMessageDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendMessageDisableNotification ¶
func WithSendMessageDisableNotification(value bool) SendMessageOption
WithSendMessageDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendMessageEntities ¶
func WithSendMessageEntities(value []MessageEntity) SendMessageOption
WithSendMessageEntities sets the Entities field.
A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
func WithSendMessageInlineButtons ¶
func WithSendMessageInlineButtons(buttons ...InlineKeyboardButton) SendMessageOption
WithSendMessageInlineButtons sets the inline keyboard with a single column of buttons for the message.
func WithSendMessageInlineKeyboard ¶
func WithSendMessageInlineKeyboard(keyboard [][]InlineKeyboardButton) SendMessageOption
WithSendMessageInlineKeyboard sets the inline keyboard for the message.
func WithSendMessageLinkPreviewOptions ¶
func WithSendMessageLinkPreviewOptions(value *LinkPreviewOptions) SendMessageOption
WithSendMessageLinkPreviewOptions sets the LinkPreviewOptions field.
Link preview generation options for the message
func WithSendMessageMessageEffectID ¶
func WithSendMessageMessageEffectID(value string) SendMessageOption
WithSendMessageMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendMessageMessageThreadID ¶
func WithSendMessageMessageThreadID(value int64) SendMessageOption
WithSendMessageMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendMessageParseMode ¶
func WithSendMessageParseMode(value string) SendMessageOption
WithSendMessageParseMode sets the ParseMode field.
Mode for parsing entities in the message text. See formatting options for more details.
func WithSendMessageProtectContent ¶
func WithSendMessageProtectContent(value bool) SendMessageOption
WithSendMessageProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendMessageReplyMarkup ¶
func WithSendMessageReplyMarkup(value *ReplyMarkup) SendMessageOption
WithSendMessageReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendMessageReplyParameters ¶
func WithSendMessageReplyParameters(value *ReplyParameters) SendMessageOption
WithSendMessageReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendMessageSuggestedPostParameters ¶
func WithSendMessageSuggestedPostParameters(value *SuggestedPostParameters) SendMessageOption
WithSendMessageSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendMessageText ¶
func WithSendMessageText(value string) SendMessageOption
WithSendMessageText sets the Text field.
Text of the message to be sent, 1-4096 characters after entities parsing
type SendMessageParams ¶
type SendMessageParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Text of the message to be sent, 1-4096 characters after entities parsing
Text string `json:"text"`
// Mode for parsing entities in the message text.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
// Link preview generation options for the message
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendMessageParams contains parameters for Client.SendMessage.
func (*SendMessageParams) Option ¶
func (r *SendMessageParams) Option(opts ...SendMessageOption) (previous SendMessageOption)
Option applies one or more SendMessageOption values and returns the last rollback option.
type SendPaidMediaOption ¶
type SendPaidMediaOption func(params *SendPaidMediaParams) SendPaidMediaOption
SendPaidMediaOption configures SendPaidMediaParams.
func WithSendPaidMediaAllowPaidBroadcast ¶
func WithSendPaidMediaAllowPaidBroadcast(value bool) SendPaidMediaOption
WithSendPaidMediaAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendPaidMediaBusinessConnectionID ¶
func WithSendPaidMediaBusinessConnectionID(value string) SendPaidMediaOption
WithSendPaidMediaBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendPaidMediaCaption ¶
func WithSendPaidMediaCaption(value string) SendPaidMediaOption
WithSendPaidMediaCaption sets the Caption field.
Media caption, 0-1024 characters after entities parsing
func WithSendPaidMediaCaptionEntities ¶
func WithSendPaidMediaCaptionEntities(value []MessageEntity) SendPaidMediaOption
WithSendPaidMediaCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendPaidMediaChatID ¶
func WithSendPaidMediaChatID(value string) SendPaidMediaOption
WithSendPaidMediaChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
func WithSendPaidMediaDirectMessagesTopicID ¶
func WithSendPaidMediaDirectMessagesTopicID(value int64) SendPaidMediaOption
WithSendPaidMediaDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendPaidMediaDisableNotification ¶
func WithSendPaidMediaDisableNotification(value bool) SendPaidMediaOption
WithSendPaidMediaDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendPaidMediaMedia ¶
func WithSendPaidMediaMedia(value []InputPaidMedia) SendPaidMediaOption
WithSendPaidMediaMedia sets the Media field.
A JSON-serialized array describing the media to be sent; up to 10 items
func WithSendPaidMediaMessageThreadID ¶
func WithSendPaidMediaMessageThreadID(value int64) SendPaidMediaOption
WithSendPaidMediaMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendPaidMediaParseMode ¶
func WithSendPaidMediaParseMode(value string) SendPaidMediaOption
WithSendPaidMediaParseMode sets the ParseMode field.
Mode for parsing entities in the media caption. See formatting options for more details.
func WithSendPaidMediaPayload ¶
func WithSendPaidMediaPayload(value string) SendPaidMediaOption
WithSendPaidMediaPayload sets the Payload field.
Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes.
func WithSendPaidMediaProtectContent ¶
func WithSendPaidMediaProtectContent(value bool) SendPaidMediaOption
WithSendPaidMediaProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendPaidMediaReplyMarkup ¶
func WithSendPaidMediaReplyMarkup(value *ReplyMarkup) SendPaidMediaOption
WithSendPaidMediaReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendPaidMediaReplyParameters ¶
func WithSendPaidMediaReplyParameters(value *ReplyParameters) SendPaidMediaOption
WithSendPaidMediaReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendPaidMediaShowCaptionAboveMedia ¶
func WithSendPaidMediaShowCaptionAboveMedia(value bool) SendPaidMediaOption
WithSendPaidMediaShowCaptionAboveMedia sets the ShowCaptionAboveMedia field.
Pass True, if the caption must be shown above the message media
func WithSendPaidMediaStarCount ¶
func WithSendPaidMediaStarCount(value int64) SendPaidMediaOption
WithSendPaidMediaStarCount sets the StarCount field.
The number of Telegram Stars that must be paid to buy access to the media; 1-25000
func WithSendPaidMediaSuggestedPostParameters ¶
func WithSendPaidMediaSuggestedPostParameters(value *SuggestedPostParameters) SendPaidMediaOption
WithSendPaidMediaSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
type SendPaidMediaParams ¶
type SendPaidMediaParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername).
// If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance.
// Otherwise, they will be credited to the bot's balance.
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// The number of Telegram Stars that must be paid to buy access to the media; 1-25000
StarCount int64 `json:"star_count"`
// A JSON-serialized array describing the media to be sent; up to 10 items
Media []InputPaidMedia `json:"media"`
// Bot-defined paid media payload, 0-128 bytes.
// This will not be displayed to the user, use it for your internal processes.
Payload string `json:"payload,omitempty"`
// Media caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the media caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendPaidMediaParams contains parameters for Client.SendPaidMedia.
func (*SendPaidMediaParams) Option ¶
func (r *SendPaidMediaParams) Option(opts ...SendPaidMediaOption) (previous SendPaidMediaOption)
Option applies one or more SendPaidMediaOption values and returns the last rollback option.
type SendPhotoOption ¶
type SendPhotoOption func(params *SendPhotoParams) SendPhotoOption
SendPhotoOption configures SendPhotoParams.
func WithSendPhotoAllowPaidBroadcast ¶
func WithSendPhotoAllowPaidBroadcast(value bool) SendPhotoOption
WithSendPhotoAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendPhotoBusinessConnectionID ¶
func WithSendPhotoBusinessConnectionID(value string) SendPhotoOption
WithSendPhotoBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendPhotoCaption ¶
func WithSendPhotoCaption(value string) SendPhotoOption
WithSendPhotoCaption sets the Caption field.
Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
func WithSendPhotoCaptionEntities ¶
func WithSendPhotoCaptionEntities(value []MessageEntity) SendPhotoOption
WithSendPhotoCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendPhotoChatID ¶
func WithSendPhotoChatID(value string) SendPhotoOption
WithSendPhotoChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendPhotoDirectMessagesTopicID ¶
func WithSendPhotoDirectMessagesTopicID(value int64) SendPhotoOption
WithSendPhotoDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendPhotoDisableNotification ¶
func WithSendPhotoDisableNotification(value bool) SendPhotoOption
WithSendPhotoDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendPhotoHasSpoiler ¶
func WithSendPhotoHasSpoiler(value bool) SendPhotoOption
WithSendPhotoHasSpoiler sets the HasSpoiler field.
Pass True if the photo needs to be covered with a spoiler animation
func WithSendPhotoMessageEffectID ¶
func WithSendPhotoMessageEffectID(value string) SendPhotoOption
WithSendPhotoMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendPhotoMessageThreadID ¶
func WithSendPhotoMessageThreadID(value int64) SendPhotoOption
WithSendPhotoMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendPhotoParseMode ¶
func WithSendPhotoParseMode(value string) SendPhotoOption
WithSendPhotoParseMode sets the ParseMode field.
Mode for parsing entities in the photo caption. See formatting options for more details.
func WithSendPhotoPhoto ¶
func WithSendPhotoPhoto(value InputFile) SendPhotoOption
WithSendPhotoPhoto sets the Photo field.
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 WithSendPhotoProtectContent ¶
func WithSendPhotoProtectContent(value bool) SendPhotoOption
WithSendPhotoProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendPhotoReplyMarkup ¶
func WithSendPhotoReplyMarkup(value *ReplyMarkup) SendPhotoOption
WithSendPhotoReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendPhotoReplyParameters ¶
func WithSendPhotoReplyParameters(value *ReplyParameters) SendPhotoOption
WithSendPhotoReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendPhotoShowCaptionAboveMedia ¶
func WithSendPhotoShowCaptionAboveMedia(value bool) SendPhotoOption
WithSendPhotoShowCaptionAboveMedia sets the ShowCaptionAboveMedia field.
Pass True, if the caption must be shown above the message media
func WithSendPhotoSuggestedPostParameters ¶
func WithSendPhotoSuggestedPostParameters(value *SuggestedPostParameters) SendPhotoOption
WithSendPhotoSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
type SendPhotoParams ¶
type SendPhotoParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Photo InputFile `json:"photo"`
// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the photo caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Pass True if the photo needs to be covered with a spoiler animation
HasSpoiler bool `json:"has_spoiler,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendPhotoParams contains parameters for Client.SendPhoto.
func (*SendPhotoParams) Option ¶
func (r *SendPhotoParams) Option(opts ...SendPhotoOption) (previous SendPhotoOption)
Option applies one or more SendPhotoOption values and returns the last rollback option.
type SendPollOption ¶
type SendPollOption func(params *SendPollParams) SendPollOption
SendPollOption configures SendPollParams.
func WithSendPollAllowPaidBroadcast ¶
func WithSendPollAllowPaidBroadcast(value bool) SendPollOption
WithSendPollAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendPollAllowsMultipleAnswers ¶
func WithSendPollAllowsMultipleAnswers(value bool) SendPollOption
WithSendPollAllowsMultipleAnswers sets the AllowsMultipleAnswers field.
True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
func WithSendPollBusinessConnectionID ¶
func WithSendPollBusinessConnectionID(value string) SendPollOption
WithSendPollBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendPollChatID ¶
func WithSendPollChatID(value string) SendPollOption
WithSendPollChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername). Polls can't be sent to channel direct messages chats.
func WithSendPollCloseDate ¶
func WithSendPollCloseDate(value int64) SendPollOption
WithSendPollCloseDate sets the CloseDate field.
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 WithSendPollCorrectOptionID ¶
func WithSendPollCorrectOptionID(value int64) SendPollOption
WithSendPollCorrectOptionID sets the CorrectOptionID field.
0-based identifier of the correct answer option, required for polls in quiz mode
func WithSendPollDisableNotification ¶
func WithSendPollDisableNotification(value bool) SendPollOption
WithSendPollDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendPollExplanation ¶
func WithSendPollExplanation(value string) SendPollOption
WithSendPollExplanation sets the Explanation field.
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 WithSendPollExplanationEntities ¶
func WithSendPollExplanationEntities(value []MessageEntity) SendPollOption
WithSendPollExplanationEntities sets the ExplanationEntities field.
A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode
func WithSendPollExplanationParseMode ¶
func WithSendPollExplanationParseMode(value string) SendPollOption
WithSendPollExplanationParseMode sets the ExplanationParseMode field.
Mode for parsing entities in the explanation. See formatting options for more details.
func WithSendPollIsAnonymous ¶
func WithSendPollIsAnonymous(value bool) SendPollOption
WithSendPollIsAnonymous sets the IsAnonymous field.
True, if the poll needs to be anonymous, defaults to True
func WithSendPollIsClosed ¶
func WithSendPollIsClosed(value bool) SendPollOption
WithSendPollIsClosed sets the IsClosed field.
Pass True if the poll needs to be immediately closed. This can be useful for poll preview.
func WithSendPollMessageEffectID ¶
func WithSendPollMessageEffectID(value string) SendPollOption
WithSendPollMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendPollMessageThreadID ¶
func WithSendPollMessageThreadID(value int64) SendPollOption
WithSendPollMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendPollOpenPeriod ¶
func WithSendPollOpenPeriod(value int64) SendPollOption
WithSendPollOpenPeriod sets the OpenPeriod field.
Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
func WithSendPollOptions ¶
func WithSendPollOptions(value []InputPollOption) SendPollOption
WithSendPollOptions sets the Options field.
A JSON-serialized list of 2-12 answer options
func WithSendPollProtectContent ¶
func WithSendPollProtectContent(value bool) SendPollOption
WithSendPollProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendPollQuestion ¶
func WithSendPollQuestion(value string) SendPollOption
WithSendPollQuestion sets the Question field.
Poll question, 1-300 characters
func WithSendPollQuestionEntities ¶
func WithSendPollQuestionEntities(value []MessageEntity) SendPollOption
WithSendPollQuestionEntities sets the QuestionEntities field.
A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode
func WithSendPollQuestionParseMode ¶
func WithSendPollQuestionParseMode(value string) SendPollOption
WithSendPollQuestionParseMode sets the QuestionParseMode field.
Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed
func WithSendPollReplyMarkup ¶
func WithSendPollReplyMarkup(value *ReplyMarkup) SendPollOption
WithSendPollReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendPollReplyParameters ¶
func WithSendPollReplyParameters(value *ReplyParameters) SendPollOption
WithSendPollReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendPollType ¶
func WithSendPollType(value string) SendPollOption
WithSendPollType sets the Type field.
Poll type, “quiz” or “regular”, defaults to “regular”
type SendPollParams ¶
type SendPollParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername).
// Polls can't be sent to channel direct messages chats.
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Poll question, 1-300 characters
Question string `json:"question"`
// Mode for parsing entities in the question.
// See [formatting options] for more details.
// Currently, only custom emoji entities are allowed
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
QuestionParseMode string `json:"question_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the poll question.
// It can be specified instead of question_parse_mode
QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
// A JSON-serialized list of 2-12 answer options
Options []InputPollOption `json:"options"`
// True, if the poll needs to be anonymous, defaults to True
IsAnonymous bool `json:"is_anonymous,omitempty"`
// Poll type, “quiz” or “regular”, defaults to “regular”
Type string `json:"type,omitempty"`
// True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
AllowsMultipleAnswers bool `json:"allows_multiple_answers,omitempty"`
// 0-based identifier of the correct answer option, required for polls in quiz mode
CorrectOptionID int64 `json:"correct_option_id,omitempty"`
// Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing
Explanation string `json:"explanation,omitempty"`
// Mode for parsing entities in the explanation.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ExplanationParseMode string `json:"explanation_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the poll explanation.
// It can be specified instead of explanation_parse_mode
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
// Amount of time in seconds the poll will be active after creation, 5-600.
// Can't be used together with close_date.
OpenPeriod int64 `json:"open_period,omitempty"`
// Point in time (Unix timestamp) when the poll will be automatically closed.
// Must be at least 5 and no more than 600 seconds in the future.
// Can't be used together with open_period.
CloseDate int64 `json:"close_date,omitempty"`
// Pass True if the poll needs to be immediately closed.
// This can be useful for poll preview.
IsClosed bool `json:"is_closed,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendPollParams contains parameters for Client.SendPoll.
func (*SendPollParams) Option ¶
func (r *SendPollParams) Option(opts ...SendPollOption) (previous SendPollOption)
Option applies one or more SendPollOption values and returns the last rollback option.
type SendStickerOption ¶
type SendStickerOption func(params *SendStickerParams) SendStickerOption
SendStickerOption configures SendStickerParams.
func WithSendStickerAllowPaidBroadcast ¶
func WithSendStickerAllowPaidBroadcast(value bool) SendStickerOption
WithSendStickerAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendStickerBusinessConnectionID ¶
func WithSendStickerBusinessConnectionID(value string) SendStickerOption
WithSendStickerBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendStickerChatID ¶
func WithSendStickerChatID(value string) SendStickerOption
WithSendStickerChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendStickerDirectMessagesTopicID ¶
func WithSendStickerDirectMessagesTopicID(value int64) SendStickerOption
WithSendStickerDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendStickerDisableNotification ¶
func WithSendStickerDisableNotification(value bool) SendStickerOption
WithSendStickerDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendStickerEmoji ¶
func WithSendStickerEmoji(value string) SendStickerOption
WithSendStickerEmoji sets the Emoji field.
Emoji associated with the sticker; only for just uploaded stickers
func WithSendStickerMessageEffectID ¶
func WithSendStickerMessageEffectID(value string) SendStickerOption
WithSendStickerMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendStickerMessageThreadID ¶
func WithSendStickerMessageThreadID(value int64) SendStickerOption
WithSendStickerMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendStickerProtectContent ¶
func WithSendStickerProtectContent(value bool) SendStickerOption
WithSendStickerProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendStickerReplyMarkup ¶
func WithSendStickerReplyMarkup(value *ReplyMarkup) SendStickerOption
WithSendStickerReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendStickerReplyParameters ¶
func WithSendStickerReplyParameters(value *ReplyParameters) SendStickerOption
WithSendStickerReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendStickerSticker ¶
func WithSendStickerSticker(value InputFile) SendStickerOption
WithSendStickerSticker sets the Sticker field.
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, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL.
func WithSendStickerSuggestedPostParameters ¶
func WithSendStickerSuggestedPostParameters(value *SuggestedPostParameters) SendStickerOption
WithSendStickerSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
type SendStickerParams ¶
type SendStickerParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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, .TGS, or .WEBM sticker using multipart/form-data.
// [More information on Sending Files »].
// Video and animated stickers can't be sent via an HTTP URL.
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Sticker InputFile `json:"sticker"`
// Emoji associated with the sticker; only for just uploaded stickers
Emoji string `json:"emoji,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendStickerParams contains parameters for Client.SendSticker.
func (*SendStickerParams) Option ¶
func (r *SendStickerParams) Option(opts ...SendStickerOption) (previous SendStickerOption)
Option applies one or more SendStickerOption values and returns the last rollback option.
type SendVenueOption ¶
type SendVenueOption func(params *SendVenueParams) SendVenueOption
SendVenueOption configures SendVenueParams.
func WithSendVenueAddress ¶
func WithSendVenueAddress(value string) SendVenueOption
WithSendVenueAddress sets the Address field.
Address of the venue
func WithSendVenueAllowPaidBroadcast ¶
func WithSendVenueAllowPaidBroadcast(value bool) SendVenueOption
WithSendVenueAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendVenueBusinessConnectionID ¶
func WithSendVenueBusinessConnectionID(value string) SendVenueOption
WithSendVenueBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendVenueChatID ¶
func WithSendVenueChatID(value string) SendVenueOption
WithSendVenueChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendVenueDirectMessagesTopicID ¶
func WithSendVenueDirectMessagesTopicID(value int64) SendVenueOption
WithSendVenueDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendVenueDisableNotification ¶
func WithSendVenueDisableNotification(value bool) SendVenueOption
WithSendVenueDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendVenueFoursquareID ¶
func WithSendVenueFoursquareID(value string) SendVenueOption
WithSendVenueFoursquareID sets the FoursquareID field.
Foursquare identifier of the venue
func WithSendVenueFoursquareType ¶
func WithSendVenueFoursquareType(value string) SendVenueOption
WithSendVenueFoursquareType sets the FoursquareType field.
Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
func WithSendVenueGooglePlaceID ¶
func WithSendVenueGooglePlaceID(value string) SendVenueOption
WithSendVenueGooglePlaceID sets the GooglePlaceID field.
Google Places identifier of the venue
func WithSendVenueGooglePlaceType ¶
func WithSendVenueGooglePlaceType(value string) SendVenueOption
WithSendVenueGooglePlaceType sets the GooglePlaceType field.
Google Places type of the venue. (See supported types.)
func WithSendVenueLatitude ¶
func WithSendVenueLatitude(value float64) SendVenueOption
WithSendVenueLatitude sets the Latitude field.
Latitude of the venue
func WithSendVenueLongitude ¶
func WithSendVenueLongitude(value float64) SendVenueOption
WithSendVenueLongitude sets the Longitude field.
Longitude of the venue
func WithSendVenueMessageEffectID ¶
func WithSendVenueMessageEffectID(value string) SendVenueOption
WithSendVenueMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendVenueMessageThreadID ¶
func WithSendVenueMessageThreadID(value int64) SendVenueOption
WithSendVenueMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendVenueProtectContent ¶
func WithSendVenueProtectContent(value bool) SendVenueOption
WithSendVenueProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendVenueReplyMarkup ¶
func WithSendVenueReplyMarkup(value *ReplyMarkup) SendVenueOption
WithSendVenueReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendVenueReplyParameters ¶
func WithSendVenueReplyParameters(value *ReplyParameters) SendVenueOption
WithSendVenueReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendVenueSuggestedPostParameters ¶
func WithSendVenueSuggestedPostParameters(value *SuggestedPostParameters) SendVenueOption
WithSendVenueSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendVenueTitle ¶
func WithSendVenueTitle(value string) SendVenueOption
WithSendVenueTitle sets the Title field.
Name of the venue
type SendVenueParams ¶
type SendVenueParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// Latitude of the venue
Latitude float64 `json:"latitude"`
// Longitude of the venue
Longitude float64 `json:"longitude"`
// Name of the venue
Title string `json:"title"`
// Address of the venue
Address string `json:"address"`
// Foursquare identifier of the venue
FoursquareID string `json:"foursquare_id,omitempty"`
// Foursquare type of the venue, if known.
// (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
FoursquareType string `json:"foursquare_type,omitempty"`
// Google Places identifier of the venue
GooglePlaceID string `json:"google_place_id,omitempty"`
// Google Places type of the venue.
// (See [supported types].)
//
// [supported types]: https://developers.google.com/places/web-service/supported_types
GooglePlaceType string `json:"google_place_type,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendVenueParams contains parameters for Client.SendVenue.
func (*SendVenueParams) Option ¶
func (r *SendVenueParams) Option(opts ...SendVenueOption) (previous SendVenueOption)
Option applies one or more SendVenueOption values and returns the last rollback option.
type SendVideoNoteOption ¶
type SendVideoNoteOption func(params *SendVideoNoteParams) SendVideoNoteOption
SendVideoNoteOption configures SendVideoNoteParams.
func WithSendVideoNoteAllowPaidBroadcast ¶
func WithSendVideoNoteAllowPaidBroadcast(value bool) SendVideoNoteOption
WithSendVideoNoteAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendVideoNoteBusinessConnectionID ¶
func WithSendVideoNoteBusinessConnectionID(value string) SendVideoNoteOption
WithSendVideoNoteBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendVideoNoteChatID ¶
func WithSendVideoNoteChatID(value string) SendVideoNoteOption
WithSendVideoNoteChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendVideoNoteDirectMessagesTopicID ¶
func WithSendVideoNoteDirectMessagesTopicID(value int64) SendVideoNoteOption
WithSendVideoNoteDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendVideoNoteDisableNotification ¶
func WithSendVideoNoteDisableNotification(value bool) SendVideoNoteOption
WithSendVideoNoteDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendVideoNoteDuration ¶
func WithSendVideoNoteDuration(value int64) SendVideoNoteOption
WithSendVideoNoteDuration sets the Duration field.
Duration of sent video in seconds
func WithSendVideoNoteLength ¶
func WithSendVideoNoteLength(value int64) SendVideoNoteOption
WithSendVideoNoteLength sets the Length field.
Video width and height, i.e. diameter of the video message
func WithSendVideoNoteMessageEffectID ¶
func WithSendVideoNoteMessageEffectID(value string) SendVideoNoteOption
WithSendVideoNoteMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendVideoNoteMessageThreadID ¶
func WithSendVideoNoteMessageThreadID(value int64) SendVideoNoteOption
WithSendVideoNoteMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendVideoNoteProtectContent ¶
func WithSendVideoNoteProtectContent(value bool) SendVideoNoteOption
WithSendVideoNoteProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendVideoNoteReplyMarkup ¶
func WithSendVideoNoteReplyMarkup(value *ReplyMarkup) SendVideoNoteOption
WithSendVideoNoteReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendVideoNoteReplyParameters ¶
func WithSendVideoNoteReplyParameters(value *ReplyParameters) SendVideoNoteOption
WithSendVideoNoteReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendVideoNoteSuggestedPostParameters ¶
func WithSendVideoNoteSuggestedPostParameters(value *SuggestedPostParameters) SendVideoNoteOption
WithSendVideoNoteSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendVideoNoteThumbnail ¶
func WithSendVideoNoteThumbnail(value *InputFile) SendVideoNoteOption
WithSendVideoNoteThumbnail sets the Thumbnail field.
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 WithSendVideoNoteVideoNote ¶
func WithSendVideoNoteVideoNote(value InputFile) SendVideoNoteOption
WithSendVideoNoteVideoNote sets the VideoNote field.
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 SendVideoNoteParams ¶
type SendVideoNoteParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
VideoNote InputFile `json:"video_note"`
// Duration of sent video in seconds
Duration int64 `json:"duration,omitempty"`
// Video width and height, i.e.
// diameter of the video message
Length int64 `json:"length,omitempty"`
// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
// The thumbnail should be in JPEG format and less than 200 kB in size.
// A thumbnail's width and height should not exceed 320.
// Ignored if the file is not uploaded using multipart/form-data.
// Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendVideoNoteParams contains parameters for Client.SendVideoNote.
func (*SendVideoNoteParams) Option ¶
func (r *SendVideoNoteParams) Option(opts ...SendVideoNoteOption) (previous SendVideoNoteOption)
Option applies one or more SendVideoNoteOption values and returns the last rollback option.
type SendVideoOption ¶
type SendVideoOption func(params *SendVideoParams) SendVideoOption
SendVideoOption configures SendVideoParams.
func WithSendVideoAllowPaidBroadcast ¶
func WithSendVideoAllowPaidBroadcast(value bool) SendVideoOption
WithSendVideoAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendVideoBusinessConnectionID ¶
func WithSendVideoBusinessConnectionID(value string) SendVideoOption
WithSendVideoBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendVideoCaption ¶
func WithSendVideoCaption(value string) SendVideoOption
WithSendVideoCaption sets the Caption field.
Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
func WithSendVideoCaptionEntities ¶
func WithSendVideoCaptionEntities(value []MessageEntity) SendVideoOption
WithSendVideoCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendVideoChatID ¶
func WithSendVideoChatID(value string) SendVideoOption
WithSendVideoChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendVideoCover ¶
func WithSendVideoCover(value *InputFile) SendVideoOption
WithSendVideoCover sets the Cover field.
Cover for the video in the message. 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 »
func WithSendVideoDirectMessagesTopicID ¶
func WithSendVideoDirectMessagesTopicID(value int64) SendVideoOption
WithSendVideoDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendVideoDisableNotification ¶
func WithSendVideoDisableNotification(value bool) SendVideoOption
WithSendVideoDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendVideoDuration ¶
func WithSendVideoDuration(value int64) SendVideoOption
WithSendVideoDuration sets the Duration field.
Duration of sent video in seconds
func WithSendVideoHasSpoiler ¶
func WithSendVideoHasSpoiler(value bool) SendVideoOption
WithSendVideoHasSpoiler sets the HasSpoiler field.
Pass True if the video needs to be covered with a spoiler animation
func WithSendVideoHeight ¶
func WithSendVideoHeight(value int64) SendVideoOption
WithSendVideoHeight sets the Height field.
Video height
func WithSendVideoMessageEffectID ¶
func WithSendVideoMessageEffectID(value string) SendVideoOption
WithSendVideoMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendVideoMessageThreadID ¶
func WithSendVideoMessageThreadID(value int64) SendVideoOption
WithSendVideoMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendVideoParseMode ¶
func WithSendVideoParseMode(value string) SendVideoOption
WithSendVideoParseMode sets the ParseMode field.
Mode for parsing entities in the video caption. See formatting options for more details.
func WithSendVideoProtectContent ¶
func WithSendVideoProtectContent(value bool) SendVideoOption
WithSendVideoProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendVideoReplyMarkup ¶
func WithSendVideoReplyMarkup(value *ReplyMarkup) SendVideoOption
WithSendVideoReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendVideoReplyParameters ¶
func WithSendVideoReplyParameters(value *ReplyParameters) SendVideoOption
WithSendVideoReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendVideoShowCaptionAboveMedia ¶
func WithSendVideoShowCaptionAboveMedia(value bool) SendVideoOption
WithSendVideoShowCaptionAboveMedia sets the ShowCaptionAboveMedia field.
Pass True, if the caption must be shown above the message media
func WithSendVideoStartTimestamp ¶
func WithSendVideoStartTimestamp(value int64) SendVideoOption
WithSendVideoStartTimestamp sets the StartTimestamp field.
Start timestamp for the video in the message
func WithSendVideoSuggestedPostParameters ¶
func WithSendVideoSuggestedPostParameters(value *SuggestedPostParameters) SendVideoOption
WithSendVideoSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendVideoSupportsStreaming ¶
func WithSendVideoSupportsStreaming(value bool) SendVideoOption
WithSendVideoSupportsStreaming sets the SupportsStreaming field.
Pass True if the uploaded video is suitable for streaming
func WithSendVideoThumbnail ¶
func WithSendVideoThumbnail(value *InputFile) SendVideoOption
WithSendVideoThumbnail sets the Thumbnail field.
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 WithSendVideoVideo ¶
func WithSendVideoVideo(value InputFile) SendVideoOption
WithSendVideoVideo sets the Video field.
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 WithSendVideoWidth ¶
func WithSendVideoWidth(value int64) SendVideoOption
WithSendVideoWidth sets the Width field.
Video width
type SendVideoParams ¶
type SendVideoParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Video InputFile `json:"video"`
// Duration of sent video in seconds
Duration int64 `json:"duration,omitempty"`
// Video width
Width int64 `json:"width,omitempty"`
// Video height
Height int64 `json:"height,omitempty"`
// Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side.
// The thumbnail should be in JPEG format and less than 200 kB in size.
// A thumbnail's width and height should not exceed 320.
// Ignored if the file is not uploaded using multipart/form-data.
// Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
// [More information on Sending Files »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Cover for the video in the message.
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Cover *InputFile `json:"cover,omitempty"`
// Start timestamp for the video in the message
StartTimestamp int64 `json:"start_timestamp,omitempty"`
// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the video caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
// Pass True if the video needs to be covered with a spoiler animation
HasSpoiler bool `json:"has_spoiler,omitempty"`
// Pass True if the uploaded video is suitable for streaming
SupportsStreaming bool `json:"supports_streaming,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendVideoParams contains parameters for Client.SendVideo.
func (*SendVideoParams) Option ¶
func (r *SendVideoParams) Option(opts ...SendVideoOption) (previous SendVideoOption)
Option applies one or more SendVideoOption values and returns the last rollback option.
type SendVoiceOption ¶
type SendVoiceOption func(params *SendVoiceParams) SendVoiceOption
SendVoiceOption configures SendVoiceParams.
func WithSendVoiceAllowPaidBroadcast ¶
func WithSendVoiceAllowPaidBroadcast(value bool) SendVoiceOption
WithSendVoiceAllowPaidBroadcast sets the AllowPaidBroadcast field.
Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
func WithSendVoiceBusinessConnectionID ¶
func WithSendVoiceBusinessConnectionID(value string) SendVoiceOption
WithSendVoiceBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be sent
func WithSendVoiceCaption ¶
func WithSendVoiceCaption(value string) SendVoiceOption
WithSendVoiceCaption sets the Caption field.
Voice message caption, 0-1024 characters after entities parsing
func WithSendVoiceCaptionEntities ¶
func WithSendVoiceCaptionEntities(value []MessageEntity) SendVoiceOption
WithSendVoiceCaptionEntities sets the CaptionEntities field.
A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
func WithSendVoiceChatID ¶
func WithSendVoiceChatID(value string) SendVoiceOption
WithSendVoiceChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSendVoiceDirectMessagesTopicID ¶
func WithSendVoiceDirectMessagesTopicID(value int64) SendVoiceOption
WithSendVoiceDirectMessagesTopicID sets the DirectMessagesTopicID field.
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
func WithSendVoiceDisableNotification ¶
func WithSendVoiceDisableNotification(value bool) SendVoiceOption
WithSendVoiceDisableNotification sets the DisableNotification field.
Sends the message silently. Users will receive a notification with no sound.
func WithSendVoiceDuration ¶
func WithSendVoiceDuration(value int64) SendVoiceOption
WithSendVoiceDuration sets the Duration field.
Duration of the voice message in seconds
func WithSendVoiceMessageEffectID ¶
func WithSendVoiceMessageEffectID(value string) SendVoiceOption
WithSendVoiceMessageEffectID sets the MessageEffectID field.
Unique identifier of the message effect to be added to the message; for private chats only
func WithSendVoiceMessageThreadID ¶
func WithSendVoiceMessageThreadID(value int64) SendVoiceOption
WithSendVoiceMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
func WithSendVoiceParseMode ¶
func WithSendVoiceParseMode(value string) SendVoiceOption
WithSendVoiceParseMode sets the ParseMode field.
Mode for parsing entities in the voice message caption. See formatting options for more details.
func WithSendVoiceProtectContent ¶
func WithSendVoiceProtectContent(value bool) SendVoiceOption
WithSendVoiceProtectContent sets the ProtectContent field.
Protects the contents of the sent message from forwarding and saving
func WithSendVoiceReplyMarkup ¶
func WithSendVoiceReplyMarkup(value *ReplyMarkup) SendVoiceOption
WithSendVoiceReplyMarkup sets the ReplyMarkup field.
Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
func WithSendVoiceReplyParameters ¶
func WithSendVoiceReplyParameters(value *ReplyParameters) SendVoiceOption
WithSendVoiceReplyParameters sets the ReplyParameters field.
Description of the message to reply to
func WithSendVoiceSuggestedPostParameters ¶
func WithSendVoiceSuggestedPostParameters(value *SuggestedPostParameters) SendVoiceOption
WithSendVoiceSuggestedPostParameters sets the SuggestedPostParameters field.
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
func WithSendVoiceVoice ¶
func WithSendVoiceVoice(value InputFile) SendVoiceOption
WithSendVoiceVoice sets the Voice field.
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 SendVoiceParams ¶
type SendVoiceParams struct {
// Unique identifier of the business connection on behalf of which the message will be sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
MessageThreadID int64 `json:"message_thread_id,omitempty"`
// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
// 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 »]
//
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Voice InputFile `json:"voice"`
// Voice message caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the voice message caption.
// See [formatting options] for more details.
//
// [formatting options]: https://core.telegram.org/bots/api#formatting-options
ParseMode string `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Duration of the voice message in seconds
Duration int64 `json:"duration,omitempty"`
// Sends the message [silently].
// Users will receive a notification with no sound.
//
// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
DisableNotification bool `json:"disable_notification,omitempty"`
// Protects the contents of the sent message from forwarding and saving
ProtectContent bool `json:"protect_content,omitempty"`
// Pass True to allow up to 1000 messages per second, ignoring [broadcasting limits] for a fee of 0.1 Telegram Stars per message.
// The relevant Stars will be withdrawn from the bot's balance
//
// [broadcasting limits]: https://core.telegram.org/bots/faq#how-can-i-message-all-of-my-bot-39s-subscribers-at-once
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
// Unique identifier of the message effect to be added to the message; for private chats only
MessageEffectID string `json:"message_effect_id,omitempty"`
// A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only.
// If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
// Description of the message to reply to
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
// Additional interface options.
// A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
// [custom reply keyboard]: https://core.telegram.org/bots/features#keyboards
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
}
SendVoiceParams contains parameters for Client.SendVoice.
func (*SendVoiceParams) Option ¶
func (r *SendVoiceParams) Option(opts ...SendVoiceOption) (previous SendVoiceOption)
Option applies one or more SendVoiceOption values and returns the last rollback option.
type SentWebAppMessage ¶
type SentWebAppMessage struct {
// Optional.
// Identifier of the sent inline message.
// Available only if there is an [inline keyboard] attached to the message.
//
// [inline keyboard]: https://core.telegram.org/bots/api#inlinekeyboardmarkup
InlineMessageID string `json:"inline_message_id,omitempty"`
}
SentWebAppMessage
Describes an inline message sent by a Web App on behalf of a user.
type SetBusinessAccountBioOption ¶
type SetBusinessAccountBioOption func(params *SetBusinessAccountBioParams) SetBusinessAccountBioOption
SetBusinessAccountBioOption configures SetBusinessAccountBioParams.
func WithSetBusinessAccountBioBio ¶
func WithSetBusinessAccountBioBio(value string) SetBusinessAccountBioOption
WithSetBusinessAccountBioBio sets the Bio field.
The new value of the bio for the business account; 0-140 characters
func WithSetBusinessAccountBioBusinessConnectionID ¶
func WithSetBusinessAccountBioBusinessConnectionID(value string) SetBusinessAccountBioOption
WithSetBusinessAccountBioBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
type SetBusinessAccountBioParams ¶
type SetBusinessAccountBioParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// The new value of the bio for the business account; 0-140 characters
Bio string `json:"bio,omitempty"`
}
SetBusinessAccountBioParams contains parameters for Client.SetBusinessAccountBio.
func (*SetBusinessAccountBioParams) Option ¶
func (r *SetBusinessAccountBioParams) Option(opts ...SetBusinessAccountBioOption) (previous SetBusinessAccountBioOption)
Option applies one or more SetBusinessAccountBioOption values and returns the last rollback option.
type SetBusinessAccountGiftSettingsOption ¶
type SetBusinessAccountGiftSettingsOption func(params *SetBusinessAccountGiftSettingsParams) SetBusinessAccountGiftSettingsOption
SetBusinessAccountGiftSettingsOption configures SetBusinessAccountGiftSettingsParams.
func WithSetBusinessAccountGiftSettingsAcceptedGiftTypes ¶
func WithSetBusinessAccountGiftSettingsAcceptedGiftTypes(value AcceptedGiftTypes) SetBusinessAccountGiftSettingsOption
WithSetBusinessAccountGiftSettingsAcceptedGiftTypes sets the AcceptedGiftTypes field.
Types of gifts accepted by the business account
func WithSetBusinessAccountGiftSettingsBusinessConnectionID ¶
func WithSetBusinessAccountGiftSettingsBusinessConnectionID(value string) SetBusinessAccountGiftSettingsOption
WithSetBusinessAccountGiftSettingsBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithSetBusinessAccountGiftSettingsShowGiftButton ¶
func WithSetBusinessAccountGiftSettingsShowGiftButton(value bool) SetBusinessAccountGiftSettingsOption
WithSetBusinessAccountGiftSettingsShowGiftButton sets the ShowGiftButton field.
Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
type SetBusinessAccountGiftSettingsParams ¶
type SetBusinessAccountGiftSettingsParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
ShowGiftButton bool `json:"show_gift_button"`
// Types of gifts accepted by the business account
AcceptedGiftTypes AcceptedGiftTypes `json:"accepted_gift_types"`
}
SetBusinessAccountGiftSettingsParams contains parameters for Client.SetBusinessAccountGiftSettings.
func (*SetBusinessAccountGiftSettingsParams) Option ¶
func (r *SetBusinessAccountGiftSettingsParams) Option(opts ...SetBusinessAccountGiftSettingsOption) (previous SetBusinessAccountGiftSettingsOption)
Option applies one or more SetBusinessAccountGiftSettingsOption values and returns the last rollback option.
type SetBusinessAccountNameOption ¶
type SetBusinessAccountNameOption func(params *SetBusinessAccountNameParams) SetBusinessAccountNameOption
SetBusinessAccountNameOption configures SetBusinessAccountNameParams.
func WithSetBusinessAccountNameBusinessConnectionID ¶
func WithSetBusinessAccountNameBusinessConnectionID(value string) SetBusinessAccountNameOption
WithSetBusinessAccountNameBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithSetBusinessAccountNameFirstName ¶
func WithSetBusinessAccountNameFirstName(value string) SetBusinessAccountNameOption
WithSetBusinessAccountNameFirstName sets the FirstName field.
The new value of the first name for the business account; 1-64 characters
func WithSetBusinessAccountNameLastName ¶
func WithSetBusinessAccountNameLastName(value string) SetBusinessAccountNameOption
WithSetBusinessAccountNameLastName sets the LastName field.
The new value of the last name for the business account; 0-64 characters
type SetBusinessAccountNameParams ¶
type SetBusinessAccountNameParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// The new value of the first name for the business account; 1-64 characters
FirstName string `json:"first_name"`
// The new value of the last name for the business account; 0-64 characters
LastName string `json:"last_name,omitempty"`
}
SetBusinessAccountNameParams contains parameters for Client.SetBusinessAccountName.
func (*SetBusinessAccountNameParams) Option ¶
func (r *SetBusinessAccountNameParams) Option(opts ...SetBusinessAccountNameOption) (previous SetBusinessAccountNameOption)
Option applies one or more SetBusinessAccountNameOption values and returns the last rollback option.
type SetBusinessAccountProfilePhotoOption ¶
type SetBusinessAccountProfilePhotoOption func(params *SetBusinessAccountProfilePhotoParams) SetBusinessAccountProfilePhotoOption
SetBusinessAccountProfilePhotoOption configures SetBusinessAccountProfilePhotoParams.
func WithSetBusinessAccountProfilePhotoBusinessConnectionID ¶
func WithSetBusinessAccountProfilePhotoBusinessConnectionID(value string) SetBusinessAccountProfilePhotoOption
WithSetBusinessAccountProfilePhotoBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithSetBusinessAccountProfilePhotoIsPublic ¶
func WithSetBusinessAccountProfilePhotoIsPublic(value bool) SetBusinessAccountProfilePhotoOption
WithSetBusinessAccountProfilePhotoIsPublic sets the IsPublic field.
Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings. An account can have only one public photo.
func WithSetBusinessAccountProfilePhotoPhoto ¶
func WithSetBusinessAccountProfilePhotoPhoto(value InputProfilePhoto) SetBusinessAccountProfilePhotoOption
WithSetBusinessAccountProfilePhotoPhoto sets the Photo field.
The new profile photo to set
type SetBusinessAccountProfilePhotoParams ¶
type SetBusinessAccountProfilePhotoParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// The new profile photo to set
Photo InputProfilePhoto `json:"photo"`
// Pass True to set the public photo, which will be visible even if the main photo is hidden by the business account's privacy settings.
// An account can have only one public photo.
IsPublic bool `json:"is_public,omitempty"`
}
SetBusinessAccountProfilePhotoParams contains parameters for Client.SetBusinessAccountProfilePhoto.
func (*SetBusinessAccountProfilePhotoParams) Option ¶
func (r *SetBusinessAccountProfilePhotoParams) Option(opts ...SetBusinessAccountProfilePhotoOption) (previous SetBusinessAccountProfilePhotoOption)
Option applies one or more SetBusinessAccountProfilePhotoOption values and returns the last rollback option.
type SetBusinessAccountUsernameOption ¶
type SetBusinessAccountUsernameOption func(params *SetBusinessAccountUsernameParams) SetBusinessAccountUsernameOption
SetBusinessAccountUsernameOption configures SetBusinessAccountUsernameParams.
func WithSetBusinessAccountUsernameBusinessConnectionID ¶
func WithSetBusinessAccountUsernameBusinessConnectionID(value string) SetBusinessAccountUsernameOption
WithSetBusinessAccountUsernameBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithSetBusinessAccountUsernameUsername ¶
func WithSetBusinessAccountUsernameUsername(value string) SetBusinessAccountUsernameOption
WithSetBusinessAccountUsernameUsername sets the Username field.
The new value of the username for the business account; 0-32 characters
type SetBusinessAccountUsernameParams ¶
type SetBusinessAccountUsernameParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// The new value of the username for the business account; 0-32 characters
Username string `json:"username,omitempty"`
}
SetBusinessAccountUsernameParams contains parameters for Client.SetBusinessAccountUsername.
func (*SetBusinessAccountUsernameParams) Option ¶
func (r *SetBusinessAccountUsernameParams) Option(opts ...SetBusinessAccountUsernameOption) (previous SetBusinessAccountUsernameOption)
Option applies one or more SetBusinessAccountUsernameOption values and returns the last rollback option.
type SetChatAdministratorCustomTitleOption ¶
type SetChatAdministratorCustomTitleOption func(params *SetChatAdministratorCustomTitleParams) SetChatAdministratorCustomTitleOption
SetChatAdministratorCustomTitleOption configures SetChatAdministratorCustomTitleParams.
func WithSetChatAdministratorCustomTitleChatID ¶
func WithSetChatAdministratorCustomTitleChatID(value string) SetChatAdministratorCustomTitleOption
WithSetChatAdministratorCustomTitleChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithSetChatAdministratorCustomTitleCustomTitle ¶
func WithSetChatAdministratorCustomTitleCustomTitle(value string) SetChatAdministratorCustomTitleOption
WithSetChatAdministratorCustomTitleCustomTitle sets the CustomTitle field.
New custom title for the administrator; 0-16 characters, emoji are not allowed
func WithSetChatAdministratorCustomTitleUserID ¶
func WithSetChatAdministratorCustomTitleUserID(value int64) SetChatAdministratorCustomTitleOption
WithSetChatAdministratorCustomTitleUserID sets the UserID field.
Unique identifier of the target user
type SetChatAdministratorCustomTitleParams ¶
type SetChatAdministratorCustomTitleParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// New custom title for the administrator; 0-16 characters, emoji are not allowed
CustomTitle string `json:"custom_title"`
}
SetChatAdministratorCustomTitleParams contains parameters for Client.SetChatAdministratorCustomTitle.
func (*SetChatAdministratorCustomTitleParams) Option ¶
func (r *SetChatAdministratorCustomTitleParams) Option(opts ...SetChatAdministratorCustomTitleOption) (previous SetChatAdministratorCustomTitleOption)
Option applies one or more SetChatAdministratorCustomTitleOption values and returns the last rollback option.
type SetChatDescriptionOption ¶
type SetChatDescriptionOption func(params *SetChatDescriptionParams) SetChatDescriptionOption
SetChatDescriptionOption configures SetChatDescriptionParams.
func WithSetChatDescriptionChatID ¶
func WithSetChatDescriptionChatID(value string) SetChatDescriptionOption
WithSetChatDescriptionChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSetChatDescriptionDescription ¶
func WithSetChatDescriptionDescription(value string) SetChatDescriptionOption
WithSetChatDescriptionDescription sets the Description field.
New chat description, 0-255 characters
type SetChatDescriptionParams ¶
type SetChatDescriptionParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// New chat description, 0-255 characters
Description string `json:"description,omitempty"`
}
SetChatDescriptionParams contains parameters for Client.SetChatDescription.
func (*SetChatDescriptionParams) Option ¶
func (r *SetChatDescriptionParams) Option(opts ...SetChatDescriptionOption) (previous SetChatDescriptionOption)
Option applies one or more SetChatDescriptionOption values and returns the last rollback option.
type SetChatMemberTagOption ¶
type SetChatMemberTagOption func(params *SetChatMemberTagParams) SetChatMemberTagOption
SetChatMemberTagOption configures SetChatMemberTagParams.
func WithSetChatMemberTagChatID ¶
func WithSetChatMemberTagChatID(value string) SetChatMemberTagOption
WithSetChatMemberTagChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithSetChatMemberTagTag ¶
func WithSetChatMemberTagTag(value string) SetChatMemberTagOption
WithSetChatMemberTagTag sets the Tag field.
New tag for the member; 0-16 characters, emoji are not allowed
func WithSetChatMemberTagUserID ¶
func WithSetChatMemberTagUserID(value int64) SetChatMemberTagOption
WithSetChatMemberTagUserID sets the UserID field.
Unique identifier of the target user
type SetChatMemberTagParams ¶
type SetChatMemberTagParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// New tag for the member; 0-16 characters, emoji are not allowed
Tag string `json:"tag,omitempty"`
}
SetChatMemberTagParams contains parameters for Client.SetChatMemberTag.
func (*SetChatMemberTagParams) Option ¶
func (r *SetChatMemberTagParams) Option(opts ...SetChatMemberTagOption) (previous SetChatMemberTagOption)
Option applies one or more SetChatMemberTagOption values and returns the last rollback option.
type SetChatMenuButtonOption ¶
type SetChatMenuButtonOption func(params *SetChatMenuButtonParams) SetChatMenuButtonOption
SetChatMenuButtonOption configures SetChatMenuButtonParams.
func WithSetChatMenuButtonChatID ¶
func WithSetChatMenuButtonChatID(value int64) SetChatMenuButtonOption
WithSetChatMenuButtonChatID sets the ChatID field.
Unique identifier for the target private chat. If not specified, default bot's menu button will be changed
func WithSetChatMenuButtonMenuButton ¶
func WithSetChatMenuButtonMenuButton(value *MenuButton) SetChatMenuButtonOption
WithSetChatMenuButtonMenuButton sets the MenuButton field.
A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault
type SetChatMenuButtonParams ¶
type SetChatMenuButtonParams struct {
// Unique identifier for the target private chat.
// If not specified, default bot's menu button will be changed
ChatID int64 `json:"chat_id,omitempty"`
// A JSON-serialized object for the bot's new menu button.
// Defaults to [MenuButtonDefault]
//
// [MenuButtonDefault]: https://core.telegram.org/bots/api#menubuttondefault
MenuButton *MenuButton `json:"menu_button,omitempty"`
}
SetChatMenuButtonParams contains parameters for Client.SetChatMenuButton.
func (*SetChatMenuButtonParams) Option ¶
func (r *SetChatMenuButtonParams) Option(opts ...SetChatMenuButtonOption) (previous SetChatMenuButtonOption)
Option applies one or more SetChatMenuButtonOption values and returns the last rollback option.
type SetChatPermissionsOption ¶
type SetChatPermissionsOption func(params *SetChatPermissionsParams) SetChatPermissionsOption
SetChatPermissionsOption configures SetChatPermissionsParams.
func WithSetChatPermissionsChatID ¶
func WithSetChatPermissionsChatID(value string) SetChatPermissionsOption
WithSetChatPermissionsChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithSetChatPermissionsPermissions ¶
func WithSetChatPermissionsPermissions(value ChatPermissions) SetChatPermissionsOption
WithSetChatPermissionsPermissions sets the Permissions field.
A JSON-serialized object for new default chat permissions
func WithSetChatPermissionsUseIndependentChatPermissions ¶
func WithSetChatPermissionsUseIndependentChatPermissions(value bool) SetChatPermissionsOption
WithSetChatPermissionsUseIndependentChatPermissions sets the UseIndependentChatPermissions field.
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 SetChatPermissionsParams ¶
type SetChatPermissionsParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// A JSON-serialized object for new default chat permissions
Permissions ChatPermissions `json:"permissions"`
// 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.
UseIndependentChatPermissions bool `json:"use_independent_chat_permissions,omitempty"`
}
SetChatPermissionsParams contains parameters for Client.SetChatPermissions.
func (*SetChatPermissionsParams) Option ¶
func (r *SetChatPermissionsParams) Option(opts ...SetChatPermissionsOption) (previous SetChatPermissionsOption)
Option applies one or more SetChatPermissionsOption values and returns the last rollback option.
type SetChatPhotoOption ¶
type SetChatPhotoOption func(params *SetChatPhotoParams) SetChatPhotoOption
SetChatPhotoOption configures SetChatPhotoParams.
func WithSetChatPhotoChatID ¶
func WithSetChatPhotoChatID(value string) SetChatPhotoOption
WithSetChatPhotoChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSetChatPhotoPhoto ¶
func WithSetChatPhotoPhoto(value InputFile) SetChatPhotoOption
WithSetChatPhotoPhoto sets the Photo field.
New chat photo, uploaded using multipart/form-data
type SetChatPhotoParams ¶
type SetChatPhotoParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// New chat photo, uploaded using multipart/form-data
Photo InputFile `json:"photo"`
}
SetChatPhotoParams contains parameters for Client.SetChatPhoto.
func (*SetChatPhotoParams) Option ¶
func (r *SetChatPhotoParams) Option(opts ...SetChatPhotoOption) (previous SetChatPhotoOption)
Option applies one or more SetChatPhotoOption values and returns the last rollback option.
type SetChatStickerSetOption ¶
type SetChatStickerSetOption func(params *SetChatStickerSetParams) SetChatStickerSetOption
SetChatStickerSetOption configures SetChatStickerSetParams.
func WithSetChatStickerSetChatID ¶
func WithSetChatStickerSetChatID(value string) SetChatStickerSetOption
WithSetChatStickerSetChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithSetChatStickerSetStickerSetName ¶
func WithSetChatStickerSetStickerSetName(value string) SetChatStickerSetOption
WithSetChatStickerSetStickerSetName sets the StickerSetName field.
Name of the sticker set to be set as the group sticker set
type SetChatStickerSetParams ¶
type SetChatStickerSetParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Name of the sticker set to be set as the group sticker set
StickerSetName string `json:"sticker_set_name"`
}
SetChatStickerSetParams contains parameters for Client.SetChatStickerSet.
func (*SetChatStickerSetParams) Option ¶
func (r *SetChatStickerSetParams) Option(opts ...SetChatStickerSetOption) (previous SetChatStickerSetOption)
Option applies one or more SetChatStickerSetOption values and returns the last rollback option.
type SetChatTitleOption ¶
type SetChatTitleOption func(params *SetChatTitleParams) SetChatTitleOption
SetChatTitleOption configures SetChatTitleParams.
func WithSetChatTitleChatID ¶
func WithSetChatTitleChatID(value string) SetChatTitleOption
WithSetChatTitleChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSetChatTitleTitle ¶
func WithSetChatTitleTitle(value string) SetChatTitleOption
WithSetChatTitleTitle sets the Title field.
New chat title, 1-128 characters
type SetChatTitleParams ¶
type SetChatTitleParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// New chat title, 1-128 characters
Title string `json:"title"`
}
SetChatTitleParams contains parameters for Client.SetChatTitle.
func (*SetChatTitleParams) Option ¶
func (r *SetChatTitleParams) Option(opts ...SetChatTitleOption) (previous SetChatTitleOption)
Option applies one or more SetChatTitleOption values and returns the last rollback option.
type SetCustomEmojiStickerSetThumbnailOption ¶
type SetCustomEmojiStickerSetThumbnailOption func(params *SetCustomEmojiStickerSetThumbnailParams) SetCustomEmojiStickerSetThumbnailOption
SetCustomEmojiStickerSetThumbnailOption configures SetCustomEmojiStickerSetThumbnailParams.
func WithSetCustomEmojiStickerSetThumbnailCustomEmojiID ¶
func WithSetCustomEmojiStickerSetThumbnailCustomEmojiID(value string) SetCustomEmojiStickerSetThumbnailOption
WithSetCustomEmojiStickerSetThumbnailCustomEmojiID sets the CustomEmojiID field.
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 WithSetCustomEmojiStickerSetThumbnailName ¶
func WithSetCustomEmojiStickerSetThumbnailName(value string) SetCustomEmojiStickerSetThumbnailOption
WithSetCustomEmojiStickerSetThumbnailName sets the Name field.
Sticker set name
type SetCustomEmojiStickerSetThumbnailParams ¶
type SetCustomEmojiStickerSetThumbnailParams struct {
// Sticker set name
Name string `json:"name"`
// 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.
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
}
SetCustomEmojiStickerSetThumbnailParams contains parameters for Client.SetCustomEmojiStickerSetThumbnail.
func (*SetCustomEmojiStickerSetThumbnailParams) Option ¶
func (r *SetCustomEmojiStickerSetThumbnailParams) Option(opts ...SetCustomEmojiStickerSetThumbnailOption) (previous SetCustomEmojiStickerSetThumbnailOption)
Option applies one or more SetCustomEmojiStickerSetThumbnailOption values and returns the last rollback option.
type SetGameScoreOption ¶
type SetGameScoreOption func(params *SetGameScoreParams) SetGameScoreOption
SetGameScoreOption configures SetGameScoreParams.
func WithSetGameScoreChatID ¶
func WithSetGameScoreChatID(value int64) SetGameScoreOption
WithSetGameScoreChatID sets the ChatID field.
Required if inline_message_id is not specified. Unique identifier for the target chat
func WithSetGameScoreDisableEditMessage ¶
func WithSetGameScoreDisableEditMessage(value bool) SetGameScoreOption
WithSetGameScoreDisableEditMessage sets the DisableEditMessage field.
Pass True if the game message should not be automatically edited to include the current scoreboard
func WithSetGameScoreForce ¶
func WithSetGameScoreForce(value bool) SetGameScoreOption
WithSetGameScoreForce sets the Force field.
Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
func WithSetGameScoreInlineMessageID ¶
func WithSetGameScoreInlineMessageID(value string) SetGameScoreOption
WithSetGameScoreInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithSetGameScoreMessageID ¶
func WithSetGameScoreMessageID(value int64) SetGameScoreOption
WithSetGameScoreMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the sent message
func WithSetGameScoreScore ¶
func WithSetGameScoreScore(value int64) SetGameScoreOption
WithSetGameScoreScore sets the Score field.
New score, must be non-negative
func WithSetGameScoreUserID ¶
func WithSetGameScoreUserID(value int64) SetGameScoreOption
WithSetGameScoreUserID sets the UserID field.
User identifier
type SetGameScoreParams ¶
type SetGameScoreParams struct {
// User identifier
UserID int64 `json:"user_id"`
// New score, must be non-negative
Score int64 `json:"score"`
// Pass True if the high score is allowed to decrease.
// This can be useful when fixing mistakes or banning cheaters
Force bool `json:"force,omitempty"`
// Pass True if the game message should not be automatically edited to include the current scoreboard
DisableEditMessage bool `json:"disable_edit_message,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat
ChatID int64 `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the sent message
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
}
SetGameScoreParams contains parameters for Client.SetGameScore.
func (*SetGameScoreParams) Option ¶
func (r *SetGameScoreParams) Option(opts ...SetGameScoreOption) (previous SetGameScoreOption)
Option applies one or more SetGameScoreOption values and returns the last rollback option.
type SetMessageReactionOption ¶
type SetMessageReactionOption func(params *SetMessageReactionParams) SetMessageReactionOption
SetMessageReactionOption configures SetMessageReactionParams.
func WithSetMessageReactionChatID ¶
func WithSetMessageReactionChatID(value string) SetMessageReactionOption
WithSetMessageReactionChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithSetMessageReactionIsBig ¶
func WithSetMessageReactionIsBig(value bool) SetMessageReactionOption
WithSetMessageReactionIsBig sets the IsBig field.
Pass True to set the reaction with a big animation
func WithSetMessageReactionMessageID ¶
func WithSetMessageReactionMessageID(value int64) SetMessageReactionOption
WithSetMessageReactionMessageID sets the MessageID field.
Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
func WithSetMessageReactionReaction ¶
func WithSetMessageReactionReaction(value []ReactionType) SetMessageReactionOption
WithSetMessageReactionReaction sets the Reaction field.
A JSON-serialized list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. Paid reactions can't be used by bots.
type SetMessageReactionParams ¶
type SetMessageReactionParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Identifier of the target message.
// If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
MessageID int64 `json:"message_id"`
// A JSON-serialized list of reaction types to set on the message.
// Currently, as non-premium users, bots can set up to one reaction per message.
// A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators.
// Paid reactions can't be used by bots.
Reaction []ReactionType `json:"reaction,omitempty"`
// Pass True to set the reaction with a big animation
IsBig bool `json:"is_big,omitempty"`
}
SetMessageReactionParams contains parameters for Client.SetMessageReaction.
func (*SetMessageReactionParams) Option ¶
func (r *SetMessageReactionParams) Option(opts ...SetMessageReactionOption) (previous SetMessageReactionOption)
Option applies one or more SetMessageReactionOption values and returns the last rollback option.
type SetMyCommandsOption ¶
type SetMyCommandsOption func(params *SetMyCommandsParams) SetMyCommandsOption
SetMyCommandsOption configures SetMyCommandsParams.
func WithSetMyCommandsCommands ¶
func WithSetMyCommandsCommands(value []BotCommand) SetMyCommandsOption
WithSetMyCommandsCommands sets the Commands field.
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 WithSetMyCommandsLanguageCode ¶
func WithSetMyCommandsLanguageCode(value string) SetMyCommandsOption
WithSetMyCommandsLanguageCode sets the LanguageCode field.
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 WithSetMyCommandsScope ¶
func WithSetMyCommandsScope(value *BotCommandScope) SetMyCommandsOption
WithSetMyCommandsScope sets the Scope field.
A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
type SetMyCommandsParams ¶
type SetMyCommandsParams struct {
// 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.
Commands []BotCommand `json:"commands"`
// A JSON-serialized object, describing scope of users for which the commands are relevant.
// Defaults to [BotCommandScopeDefault].
//
// [BotCommandScopeDefault]: https://core.telegram.org/bots/api#botcommandscopedefault
Scope *BotCommandScope `json:"scope,omitempty"`
// 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
LanguageCode string `json:"language_code,omitempty"`
}
SetMyCommandsParams contains parameters for Client.SetMyCommands.
func (*SetMyCommandsParams) Option ¶
func (r *SetMyCommandsParams) Option(opts ...SetMyCommandsOption) (previous SetMyCommandsOption)
Option applies one or more SetMyCommandsOption values and returns the last rollback option.
type SetMyDefaultAdministratorRightsOption ¶
type SetMyDefaultAdministratorRightsOption func(params *SetMyDefaultAdministratorRightsParams) SetMyDefaultAdministratorRightsOption
SetMyDefaultAdministratorRightsOption configures SetMyDefaultAdministratorRightsParams.
func WithSetMyDefaultAdministratorRightsForChannels ¶
func WithSetMyDefaultAdministratorRightsForChannels(value bool) SetMyDefaultAdministratorRightsOption
WithSetMyDefaultAdministratorRightsForChannels sets the ForChannels field.
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 WithSetMyDefaultAdministratorRightsRights ¶
func WithSetMyDefaultAdministratorRightsRights(value *ChatAdministratorRights) SetMyDefaultAdministratorRightsOption
WithSetMyDefaultAdministratorRightsRights sets the Rights field.
A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
type SetMyDefaultAdministratorRightsParams ¶
type SetMyDefaultAdministratorRightsParams struct {
// A JSON-serialized object describing new default administrator rights.
// If not specified, the default administrator rights will be cleared.
Rights *ChatAdministratorRights `json:"rights,omitempty"`
// 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.
ForChannels bool `json:"for_channels,omitempty"`
}
SetMyDefaultAdministratorRightsParams contains parameters for Client.SetMyDefaultAdministratorRights.
func (*SetMyDefaultAdministratorRightsParams) Option ¶
func (r *SetMyDefaultAdministratorRightsParams) Option(opts ...SetMyDefaultAdministratorRightsOption) (previous SetMyDefaultAdministratorRightsOption)
Option applies one or more SetMyDefaultAdministratorRightsOption values and returns the last rollback option.
type SetMyDescriptionOption ¶
type SetMyDescriptionOption func(params *SetMyDescriptionParams) SetMyDescriptionOption
SetMyDescriptionOption configures SetMyDescriptionParams.
func WithSetMyDescriptionDescription ¶
func WithSetMyDescriptionDescription(value string) SetMyDescriptionOption
WithSetMyDescriptionDescription sets the Description field.
New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
func WithSetMyDescriptionLanguageCode ¶
func WithSetMyDescriptionLanguageCode(value string) SetMyDescriptionOption
WithSetMyDescriptionLanguageCode sets the LanguageCode field.
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 SetMyDescriptionParams ¶
type SetMyDescriptionParams struct {
// New bot description; 0-512 characters.
// Pass an empty string to remove the dedicated description for the given language.
Description string `json:"description,omitempty"`
// 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.
LanguageCode string `json:"language_code,omitempty"`
}
SetMyDescriptionParams contains parameters for Client.SetMyDescription.
func (*SetMyDescriptionParams) Option ¶
func (r *SetMyDescriptionParams) Option(opts ...SetMyDescriptionOption) (previous SetMyDescriptionOption)
Option applies one or more SetMyDescriptionOption values and returns the last rollback option.
type SetMyNameOption ¶
type SetMyNameOption func(params *SetMyNameParams) SetMyNameOption
SetMyNameOption configures SetMyNameParams.
func WithSetMyNameLanguageCode ¶
func WithSetMyNameLanguageCode(value string) SetMyNameOption
WithSetMyNameLanguageCode sets the LanguageCode field.
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 WithSetMyNameName ¶
func WithSetMyNameName(value string) SetMyNameOption
WithSetMyNameName sets the Name field.
New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
type SetMyNameParams ¶
type SetMyNameParams struct {
// New bot name; 0-64 characters.
// Pass an empty string to remove the dedicated name for the given language.
Name string `json:"name,omitempty"`
// 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.
LanguageCode string `json:"language_code,omitempty"`
}
SetMyNameParams contains parameters for Client.SetMyName.
func (*SetMyNameParams) Option ¶
func (r *SetMyNameParams) Option(opts ...SetMyNameOption) (previous SetMyNameOption)
Option applies one or more SetMyNameOption values and returns the last rollback option.
type SetMyProfilePhotoOption ¶
type SetMyProfilePhotoOption func(params *SetMyProfilePhotoParams) SetMyProfilePhotoOption
SetMyProfilePhotoOption configures SetMyProfilePhotoParams.
func WithSetMyProfilePhotoPhoto ¶
func WithSetMyProfilePhotoPhoto(value InputProfilePhoto) SetMyProfilePhotoOption
WithSetMyProfilePhotoPhoto sets the Photo field.
The new profile photo to set
type SetMyProfilePhotoParams ¶
type SetMyProfilePhotoParams struct {
// The new profile photo to set
Photo InputProfilePhoto `json:"photo"`
}
SetMyProfilePhotoParams contains parameters for Client.SetMyProfilePhoto.
func (*SetMyProfilePhotoParams) Option ¶
func (r *SetMyProfilePhotoParams) Option(opts ...SetMyProfilePhotoOption) (previous SetMyProfilePhotoOption)
Option applies one or more SetMyProfilePhotoOption values and returns the last rollback option.
type SetMyShortDescriptionOption ¶
type SetMyShortDescriptionOption func(params *SetMyShortDescriptionParams) SetMyShortDescriptionOption
SetMyShortDescriptionOption configures SetMyShortDescriptionParams.
func WithSetMyShortDescriptionLanguageCode ¶
func WithSetMyShortDescriptionLanguageCode(value string) SetMyShortDescriptionOption
WithSetMyShortDescriptionLanguageCode sets the LanguageCode field.
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 WithSetMyShortDescriptionShortDescription ¶
func WithSetMyShortDescriptionShortDescription(value string) SetMyShortDescriptionOption
WithSetMyShortDescriptionShortDescription sets the ShortDescription field.
New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
type SetMyShortDescriptionParams ¶
type SetMyShortDescriptionParams struct {
// New short description for the bot; 0-120 characters.
// Pass an empty string to remove the dedicated short description for the given language.
ShortDescription string `json:"short_description,omitempty"`
// 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.
LanguageCode string `json:"language_code,omitempty"`
}
SetMyShortDescriptionParams contains parameters for Client.SetMyShortDescription.
func (*SetMyShortDescriptionParams) Option ¶
func (r *SetMyShortDescriptionParams) Option(opts ...SetMyShortDescriptionOption) (previous SetMyShortDescriptionOption)
Option applies one or more SetMyShortDescriptionOption values and returns the last rollback option.
type SetPassportDataErrorsOption ¶
type SetPassportDataErrorsOption func(params *SetPassportDataErrorsParams) SetPassportDataErrorsOption
SetPassportDataErrorsOption configures SetPassportDataErrorsParams.
func WithSetPassportDataErrorsErrors ¶
func WithSetPassportDataErrorsErrors(value []PassportElementError) SetPassportDataErrorsOption
WithSetPassportDataErrorsErrors sets the Errors field.
A JSON-serialized array describing the errors
func WithSetPassportDataErrorsUserID ¶
func WithSetPassportDataErrorsUserID(value int64) SetPassportDataErrorsOption
WithSetPassportDataErrorsUserID sets the UserID field.
User identifier
type SetPassportDataErrorsParams ¶
type SetPassportDataErrorsParams struct {
// User identifier
UserID int64 `json:"user_id"`
// A JSON-serialized array describing the errors
Errors []PassportElementError `json:"errors"`
}
SetPassportDataErrorsParams contains parameters for Client.SetPassportDataErrors.
func (*SetPassportDataErrorsParams) Option ¶
func (r *SetPassportDataErrorsParams) Option(opts ...SetPassportDataErrorsOption) (previous SetPassportDataErrorsOption)
Option applies one or more SetPassportDataErrorsOption values and returns the last rollback option.
type SetStickerEmojiListOption ¶
type SetStickerEmojiListOption func(params *SetStickerEmojiListParams) SetStickerEmojiListOption
SetStickerEmojiListOption configures SetStickerEmojiListParams.
func WithSetStickerEmojiListEmojiList ¶
func WithSetStickerEmojiListEmojiList(value []string) SetStickerEmojiListOption
WithSetStickerEmojiListEmojiList sets the EmojiList field.
A JSON-serialized list of 1-20 emoji associated with the sticker
func WithSetStickerEmojiListSticker ¶
func WithSetStickerEmojiListSticker(value string) SetStickerEmojiListOption
WithSetStickerEmojiListSticker sets the Sticker field.
File identifier of the sticker
type SetStickerEmojiListParams ¶
type SetStickerEmojiListParams struct {
// File identifier of the sticker
Sticker string `json:"sticker"`
// A JSON-serialized list of 1-20 emoji associated with the sticker
EmojiList []string `json:"emoji_list"`
}
SetStickerEmojiListParams contains parameters for Client.SetStickerEmojiList.
func (*SetStickerEmojiListParams) Option ¶
func (r *SetStickerEmojiListParams) Option(opts ...SetStickerEmojiListOption) (previous SetStickerEmojiListOption)
Option applies one or more SetStickerEmojiListOption values and returns the last rollback option.
type SetStickerKeywordsOption ¶
type SetStickerKeywordsOption func(params *SetStickerKeywordsParams) SetStickerKeywordsOption
SetStickerKeywordsOption configures SetStickerKeywordsParams.
func WithSetStickerKeywordsKeywords ¶
func WithSetStickerKeywordsKeywords(value []string) SetStickerKeywordsOption
WithSetStickerKeywordsKeywords sets the Keywords field.
A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters
func WithSetStickerKeywordsSticker ¶
func WithSetStickerKeywordsSticker(value string) SetStickerKeywordsOption
WithSetStickerKeywordsSticker sets the Sticker field.
File identifier of the sticker
type SetStickerKeywordsParams ¶
type SetStickerKeywordsParams struct {
// File identifier of the sticker
Sticker string `json:"sticker"`
// A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters
Keywords []string `json:"keywords,omitempty"`
}
SetStickerKeywordsParams contains parameters for Client.SetStickerKeywords.
func (*SetStickerKeywordsParams) Option ¶
func (r *SetStickerKeywordsParams) Option(opts ...SetStickerKeywordsOption) (previous SetStickerKeywordsOption)
Option applies one or more SetStickerKeywordsOption values and returns the last rollback option.
type SetStickerMaskPositionOption ¶
type SetStickerMaskPositionOption func(params *SetStickerMaskPositionParams) SetStickerMaskPositionOption
SetStickerMaskPositionOption configures SetStickerMaskPositionParams.
func WithSetStickerMaskPositionMaskPosition ¶
func WithSetStickerMaskPositionMaskPosition(value *MaskPosition) SetStickerMaskPositionOption
WithSetStickerMaskPositionMaskPosition sets the MaskPosition field.
A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position.
func WithSetStickerMaskPositionSticker ¶
func WithSetStickerMaskPositionSticker(value string) SetStickerMaskPositionOption
WithSetStickerMaskPositionSticker sets the Sticker field.
File identifier of the sticker
type SetStickerMaskPositionParams ¶
type SetStickerMaskPositionParams struct {
// File identifier of the sticker
Sticker string `json:"sticker"`
// A JSON-serialized object with the position where the mask should be placed on faces.
// Omit the parameter to remove the mask position.
MaskPosition *MaskPosition `json:"mask_position,omitempty"`
}
SetStickerMaskPositionParams contains parameters for Client.SetStickerMaskPosition.
func (*SetStickerMaskPositionParams) Option ¶
func (r *SetStickerMaskPositionParams) Option(opts ...SetStickerMaskPositionOption) (previous SetStickerMaskPositionOption)
Option applies one or more SetStickerMaskPositionOption values and returns the last rollback option.
type SetStickerPositionInSetOption ¶
type SetStickerPositionInSetOption func(params *SetStickerPositionInSetParams) SetStickerPositionInSetOption
SetStickerPositionInSetOption configures SetStickerPositionInSetParams.
func WithSetStickerPositionInSetPosition ¶
func WithSetStickerPositionInSetPosition(value int64) SetStickerPositionInSetOption
WithSetStickerPositionInSetPosition sets the Position field.
New sticker position in the set, zero-based
func WithSetStickerPositionInSetSticker ¶
func WithSetStickerPositionInSetSticker(value string) SetStickerPositionInSetOption
WithSetStickerPositionInSetSticker sets the Sticker field.
File identifier of the sticker
type SetStickerPositionInSetParams ¶
type SetStickerPositionInSetParams struct {
// File identifier of the sticker
Sticker string `json:"sticker"`
// New sticker position in the set, zero-based
Position int64 `json:"position"`
}
SetStickerPositionInSetParams contains parameters for Client.SetStickerPositionInSet.
func (*SetStickerPositionInSetParams) Option ¶
func (r *SetStickerPositionInSetParams) Option(opts ...SetStickerPositionInSetOption) (previous SetStickerPositionInSetOption)
Option applies one or more SetStickerPositionInSetOption values and returns the last rollback option.
type SetStickerSetThumbnailOption ¶
type SetStickerSetThumbnailOption func(params *SetStickerSetThumbnailParams) SetStickerSetThumbnailOption
SetStickerSetThumbnailOption configures SetStickerSetThumbnailParams.
func WithSetStickerSetThumbnailFormat ¶
func WithSetStickerSetThumbnailFormat(value string) SetStickerSetThumbnailOption
WithSetStickerSetThumbnailFormat sets the Format field.
Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video
func WithSetStickerSetThumbnailName ¶
func WithSetStickerSetThumbnailName(value string) SetStickerSetThumbnailOption
WithSetStickerSetThumbnailName sets the Name field.
Sticker set name
func WithSetStickerSetThumbnailThumbnail ¶
func WithSetStickerSetThumbnailThumbnail(value *InputFile) SetStickerSetThumbnailOption
WithSetStickerSetThumbnailThumbnail sets the Thumbnail field.
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#animation-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-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 WithSetStickerSetThumbnailUserID ¶
func WithSetStickerSetThumbnailUserID(value int64) SetStickerSetThumbnailOption
WithSetStickerSetThumbnailUserID sets the UserID field.
User identifier of the sticker set owner
type SetStickerSetThumbnailParams ¶
type SetStickerSetThumbnailParams struct {
// Sticker set name
Name string `json:"name"`
// User identifier of the sticker set owner
UserID int64 `json:"user_id"`
// 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#animation-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-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.
//
// [https://core.telegram.org/stickers#animation-requirements]: https://core.telegram.org/stickers#animation-requirements
// [https://core.telegram.org/stickers#video-requirements]: https://core.telegram.org/stickers#video-requirements
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video
Format string `json:"format"`
}
SetStickerSetThumbnailParams contains parameters for Client.SetStickerSetThumbnail.
func (*SetStickerSetThumbnailParams) Option ¶
func (r *SetStickerSetThumbnailParams) Option(opts ...SetStickerSetThumbnailOption) (previous SetStickerSetThumbnailOption)
Option applies one or more SetStickerSetThumbnailOption values and returns the last rollback option.
type SetStickerSetTitleOption ¶
type SetStickerSetTitleOption func(params *SetStickerSetTitleParams) SetStickerSetTitleOption
SetStickerSetTitleOption configures SetStickerSetTitleParams.
func WithSetStickerSetTitleName ¶
func WithSetStickerSetTitleName(value string) SetStickerSetTitleOption
WithSetStickerSetTitleName sets the Name field.
Sticker set name
func WithSetStickerSetTitleTitle ¶
func WithSetStickerSetTitleTitle(value string) SetStickerSetTitleOption
WithSetStickerSetTitleTitle sets the Title field.
Sticker set title, 1-64 characters
type SetStickerSetTitleParams ¶
type SetStickerSetTitleParams struct {
// Sticker set name
Name string `json:"name"`
// Sticker set title, 1-64 characters
Title string `json:"title"`
}
SetStickerSetTitleParams contains parameters for Client.SetStickerSetTitle.
func (*SetStickerSetTitleParams) Option ¶
func (r *SetStickerSetTitleParams) Option(opts ...SetStickerSetTitleOption) (previous SetStickerSetTitleOption)
Option applies one or more SetStickerSetTitleOption values and returns the last rollback option.
type SetUserEmojiStatusOption ¶
type SetUserEmojiStatusOption func(params *SetUserEmojiStatusParams) SetUserEmojiStatusOption
SetUserEmojiStatusOption configures SetUserEmojiStatusParams.
func WithSetUserEmojiStatusEmojiStatusCustomEmojiID ¶
func WithSetUserEmojiStatusEmojiStatusCustomEmojiID(value string) SetUserEmojiStatusOption
WithSetUserEmojiStatusEmojiStatusCustomEmojiID sets the EmojiStatusCustomEmojiID field.
Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status.
func WithSetUserEmojiStatusEmojiStatusExpirationDate ¶
func WithSetUserEmojiStatusEmojiStatusExpirationDate(value int64) SetUserEmojiStatusOption
WithSetUserEmojiStatusEmojiStatusExpirationDate sets the EmojiStatusExpirationDate field.
Expiration date of the emoji status, if any
func WithSetUserEmojiStatusUserID ¶
func WithSetUserEmojiStatusUserID(value int64) SetUserEmojiStatusOption
WithSetUserEmojiStatusUserID sets the UserID field.
Unique identifier of the target user
type SetUserEmojiStatusParams ¶
type SetUserEmojiStatusParams struct {
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// Custom emoji identifier of the emoji status to set.
// Pass an empty string to remove the status.
EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"`
// Expiration date of the emoji status, if any
EmojiStatusExpirationDate int64 `json:"emoji_status_expiration_date,omitempty"`
}
SetUserEmojiStatusParams contains parameters for Client.SetUserEmojiStatus.
func (*SetUserEmojiStatusParams) Option ¶
func (r *SetUserEmojiStatusParams) Option(opts ...SetUserEmojiStatusOption) (previous SetUserEmojiStatusOption)
Option applies one or more SetUserEmojiStatusOption values and returns the last rollback option.
type SetWebhookOption ¶
type SetWebhookOption func(params *SetWebhookParams) SetWebhookOption
SetWebhookOption configures SetWebhookParams.
func WithSetWebhookAllowedUpdates ¶
func WithSetWebhookAllowedUpdates(value []string) SetWebhookOption
WithSetWebhookAllowedUpdates sets the AllowedUpdates field.
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, message_reaction, and message_reaction_count (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 WithSetWebhookCertificate ¶
func WithSetWebhookCertificate(value *InputFile) SetWebhookOption
WithSetWebhookCertificate sets the Certificate field.
Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
func WithSetWebhookDropPendingUpdates ¶
func WithSetWebhookDropPendingUpdates(value bool) SetWebhookOption
WithSetWebhookDropPendingUpdates sets the DropPendingUpdates field.
Pass True to drop all pending updates
func WithSetWebhookIpAddress ¶
func WithSetWebhookIpAddress(value string) SetWebhookOption
WithSetWebhookIpAddress sets the IpAddress field.
The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
func WithSetWebhookMaxConnections ¶
func WithSetWebhookMaxConnections(value int64) SetWebhookOption
WithSetWebhookMaxConnections sets the MaxConnections field.
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 WithSetWebhookSecretToken ¶
func WithSetWebhookSecretToken(value string) SetWebhookOption
WithSetWebhookSecretToken sets the SecretToken field.
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 WithSetWebhookURL ¶
func WithSetWebhookURL(value string) SetWebhookOption
WithSetWebhookURL sets the URL field.
HTTPS URL to send updates to. Use an empty string to remove webhook integration
type SetWebhookParams ¶
type SetWebhookParams struct {
// HTTPS URL to send updates to.
// Use an empty string to remove webhook integration
URL string `json:"url"`
// Upload your public key certificate so that the root certificate in use can be checked.
// See our [self-signed guide] for details.
//
// [self-signed guide]: https://core.telegram.org/bots/self-signed
Certificate *InputFile `json:"certificate,omitempty"`
// The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
IpAddress string `json:"ip_address,omitempty"`
// 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.
MaxConnections int64 `json:"max_connections,omitempty"`
// 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, message_reaction, and message_reaction_count (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.
//
// [Update]: https://core.telegram.org/bots/api#update
AllowedUpdates []string `json:"allowed_updates,omitempty"`
// Pass True to drop all pending updates
DropPendingUpdates bool `json:"drop_pending_updates,omitempty"`
// 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.
SecretToken string `json:"secret_token,omitempty"`
}
SetWebhookParams contains parameters for Client.SetWebhook.
func (*SetWebhookParams) Option ¶
func (r *SetWebhookParams) Option(opts ...SetWebhookOption) (previous SetWebhookOption)
Option applies one or more SetWebhookOption values and returns the last rollback option.
type SharedUser ¶
type SharedUser struct {
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers.
// 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"`
// First name of the user, if the name was requested by the bot
FirstName string `json:"first_name,omitempty"`
// Last name of the user, if the name was requested by the bot
LastName string `json:"last_name,omitempty"`
// Username of the user, if the username was requested by the bot
Username string `json:"username,omitempty"`
// Available sizes of the chat photo, if the photo was requested by the bot
Photo []PhotoSize `json:"photo,omitempty"`
}
SharedUser
This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
type ShippingAddress ¶
type ShippingAddress struct {
// Two-letter [ISO 3166-1 alpha-2] country code
//
// [ISO 3166-1 alpha-2]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
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 StarAmount ¶
type StarAmount struct {
// Integer amount of Telegram Stars, rounded to 0; can be negative
Amount int64 `json:"amount"`
// Optional.
// The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive
NanostarAmount int64 `json:"nanostar_amount,omitempty"`
}
StarAmount
Describes an amount of Telegram Stars.
type StarTransaction ¶
type StarTransaction struct {
// Unique identifier of the transaction.
// Coincides with the identifier of the original transaction for refund transactions.
// Coincides with SuccessfulPayment.telegram_payment_charge_id for successful incoming payments from users.
ID string `json:"id"`
// Integer amount of Telegram Stars transferred by the transaction
Amount int64 `json:"amount"`
// Optional.
// The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999
NanostarAmount int64 `json:"nanostar_amount,omitempty"`
// Date the transaction was created in Unix time
Date int64 `json:"date"`
// Optional.
// Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal).
// Only for incoming transactions
Source *TransactionPartner `json:"source,omitempty"`
// Optional.
// Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal).
// Only for outgoing transactions
Receiver *TransactionPartner `json:"receiver,omitempty"`
}
StarTransaction
Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
type StarTransactions ¶
type StarTransactions struct {
// The list of transactions
Transactions []StarTransaction `json:"transactions"`
}
StarTransactions
Contains a list of Telegram Star transactions.
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 string `json:"type"`
// Sticker width
Width int64 `json:"width"`
// Sticker height
Height int64 `json:"height"`
// True, if the sticker is [animated]
//
// [animated]: https://telegram.org/blog/animated-stickers
IsAnimated bool `json:"is_animated"`
// True, if the sticker is a [video sticker]
//
// [video sticker]: https://telegram.org/blog/video-stickers-better-reactions
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 int64 `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 string `json:"sticker_type"`
// 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 StopMessageLiveLocationOption ¶
type StopMessageLiveLocationOption func(params *StopMessageLiveLocationParams) StopMessageLiveLocationOption
StopMessageLiveLocationOption configures StopMessageLiveLocationParams.
func WithStopMessageLiveLocationBusinessConnectionID ¶
func WithStopMessageLiveLocationBusinessConnectionID(value string) StopMessageLiveLocationOption
WithStopMessageLiveLocationBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithStopMessageLiveLocationChatID ¶
func WithStopMessageLiveLocationChatID(value string) StopMessageLiveLocationOption
WithStopMessageLiveLocationChatID sets the ChatID field.
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 WithStopMessageLiveLocationInlineMessageID ¶
func WithStopMessageLiveLocationInlineMessageID(value string) StopMessageLiveLocationOption
WithStopMessageLiveLocationInlineMessageID sets the InlineMessageID field.
Required if chat_id and message_id are not specified. Identifier of the inline message
func WithStopMessageLiveLocationMessageID ¶
func WithStopMessageLiveLocationMessageID(value int64) StopMessageLiveLocationOption
WithStopMessageLiveLocationMessageID sets the MessageID field.
Required if inline_message_id is not specified. Identifier of the message with live location to stop
func WithStopMessageLiveLocationReplyMarkup ¶
func WithStopMessageLiveLocationReplyMarkup(value *InlineKeyboardMarkup) StopMessageLiveLocationOption
WithStopMessageLiveLocationReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for a new inline keyboard.
type StopMessageLiveLocationParams ¶
type StopMessageLiveLocationParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Required if inline_message_id is not specified.
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id,omitempty"`
// Required if inline_message_id is not specified.
// Identifier of the message with live location to stop
MessageID int64 `json:"message_id,omitempty"`
// Required if chat_id and message_id are not specified.
// Identifier of the inline message
InlineMessageID string `json:"inline_message_id,omitempty"`
// A JSON-serialized object for a new [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
StopMessageLiveLocationParams contains parameters for Client.StopMessageLiveLocation.
func (*StopMessageLiveLocationParams) Option ¶
func (r *StopMessageLiveLocationParams) Option(opts ...StopMessageLiveLocationOption) (previous StopMessageLiveLocationOption)
Option applies one or more StopMessageLiveLocationOption values and returns the last rollback option.
type StopPollOption ¶
type StopPollOption func(params *StopPollParams) StopPollOption
StopPollOption configures StopPollParams.
func WithStopPollBusinessConnectionID ¶
func WithStopPollBusinessConnectionID(value string) StopPollOption
WithStopPollBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message to be edited was sent
func WithStopPollChatID ¶
func WithStopPollChatID(value string) StopPollOption
WithStopPollChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithStopPollMessageID ¶
func WithStopPollMessageID(value int64) StopPollOption
WithStopPollMessageID sets the MessageID field.
Identifier of the original message with the poll
func WithStopPollReplyMarkup ¶
func WithStopPollReplyMarkup(value *InlineKeyboardMarkup) StopPollOption
WithStopPollReplyMarkup sets the ReplyMarkup field.
A JSON-serialized object for a new message inline keyboard.
type StopPollParams ¶
type StopPollParams struct {
// Unique identifier of the business connection on behalf of which the message to be edited was sent
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Identifier of the original message with the poll
MessageID int64 `json:"message_id"`
// A JSON-serialized object for a new message [inline keyboard].
//
// [inline keyboard]: https://core.telegram.org/bots/features#inline-keyboards
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
StopPollParams contains parameters for Client.StopPoll.
func (*StopPollParams) Option ¶
func (r *StopPollParams) Option(opts ...StopPollOption) (previous StopPollOption)
Option applies one or more StopPollOption values and returns the last rollback option.
type Story ¶
type Story struct {
// Chat that posted the story
Chat Chat `json:"chat"`
// Unique identifier for the story in the chat
ID int64 `json:"id"`
}
Story
This object represents a story.
type StoryArea ¶
type StoryArea struct {
// Position of the area
Position StoryAreaPosition `json:"position"`
// Type of the area
Type StoryAreaType `json:"type"`
}
StoryArea
Describes a clickable area on a story media.
type StoryAreaPosition ¶
type StoryAreaPosition struct {
// The abscissa of the area's center, as a percentage of the media width
XPercentage float64 `json:"x_percentage"`
// The ordinate of the area's center, as a percentage of the media height
YPercentage float64 `json:"y_percentage"`
// The width of the area's rectangle, as a percentage of the media width
WidthPercentage float64 `json:"width_percentage"`
// The height of the area's rectangle, as a percentage of the media height
HeightPercentage float64 `json:"height_percentage"`
// The clockwise rotation angle of the rectangle, in degrees; 0-360
RotationAngle float64 `json:"rotation_angle"`
// The radius of the rectangle corner rounding, as a percentage of the media width
CornerRadiusPercentage float64 `json:"corner_radius_percentage"`
}
StoryAreaPosition
Describes the position of a clickable area within a story.
type StoryAreaType ¶
type StoryAreaType struct {
*StoryAreaTypeLocation
*StoryAreaTypeSuggestedReaction
*StoryAreaTypeLink
*StoryAreaTypeWeather
*StoryAreaTypeUniqueGift
}
StoryAreaType
Describes the type of a clickable area on a story. Currently, it can be one of
StoryAreaTypeSuggestedReaction
func (*StoryAreaType) MarshalJSON ¶
func (r *StoryAreaType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of StoryAreaType.
func (*StoryAreaType) UnmarshalJSON ¶
func (r *StoryAreaType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching StoryAreaType subtype.
type StoryAreaTypeLink ¶
type StoryAreaTypeLink struct {
// Type of the area, always “link”
Type string `json:"type"`
// HTTP or tg:// URL to be opened when the area is clicked
URL string `json:"url"`
}
StoryAreaTypeLink
Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.
type StoryAreaTypeLocation ¶
type StoryAreaTypeLocation struct {
// Type of the area, always “location”
Type string `json:"type"`
// Location latitude in degrees
Latitude float64 `json:"latitude"`
// Location longitude in degrees
Longitude float64 `json:"longitude"`
// Optional.
// Address of the location
Address *LocationAddress `json:"address,omitempty"`
}
StoryAreaTypeLocation
Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.
type StoryAreaTypeSuggestedReaction ¶
type StoryAreaTypeSuggestedReaction struct {
// Type of the area, always “suggested_reaction”
Type string `json:"type"`
// Type of the reaction
ReactionType ReactionType `json:"reaction_type"`
// Optional.
// Pass True if the reaction area has a dark background
IsDark bool `json:"is_dark,omitempty"`
// Optional.
// Pass True if reaction area corner is flipped
IsFlipped bool `json:"is_flipped,omitempty"`
}
StoryAreaTypeSuggestedReaction
Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.
type StoryAreaTypeUniqueGift ¶
type StoryAreaTypeUniqueGift struct {
// Type of the area, always “unique_gift”
Type string `json:"type"`
// Unique name of the gift
Name string `json:"name"`
}
StoryAreaTypeUniqueGift
Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.
type StoryAreaTypeWeather ¶
type StoryAreaTypeWeather struct {
// Type of the area, always “weather”
Type string `json:"type"`
// Temperature, in degree Celsius
Temperature float64 `json:"temperature"`
// Emoji representing the weather
Emoji string `json:"emoji"`
// A color of the area background in the ARGB format
BackgroundColor int64 `json:"background_color"`
}
StoryAreaTypeWeather
Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.
type SuccessfulPayment ¶
type SuccessfulPayment struct {
// Three-letter ISO 4217 [currency] code, or “XTR” for payments in [Telegram Stars]
//
// [currency]: https://core.telegram.org/bots/payments#supported-currencies
// [Telegram Stars]: https://t.me/BotNews/90
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).
//
// [currencies.json]: https://core.telegram.org/bots/payments/currencies.json
TotalAmount int64 `json:"total_amount"`
// Bot-specified invoice payload
InvoicePayload string `json:"invoice_payload"`
// Optional.
// Expiration date of the subscription, in Unix time; for recurring payments only
SubscriptionExpirationDate int64 `json:"subscription_expiration_date,omitempty"`
// Optional.
// True, if the payment is a recurring payment for a subscription
IsRecurring bool `json:"is_recurring,omitempty"`
// Optional.
// True, if the payment is the first payment for a subscription
IsFirstRecurring bool `json:"is_first_recurring,omitempty"`
// 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. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.
type SuggestedPostApprovalFailed ¶
type SuggestedPostApprovalFailed struct {
// Optional.
// Message containing the suggested post whose approval has failed.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Expected price of the post
Price SuggestedPostPrice `json:"price"`
}
SuggestedPostApprovalFailed
Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.
type SuggestedPostApproved ¶
type SuggestedPostApproved struct {
// Optional.
// Message containing the suggested post.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Optional.
// Amount paid for the post
Price *SuggestedPostPrice `json:"price,omitempty"`
// Date when the post will be published
SendDate int64 `json:"send_date"`
}
SuggestedPostApproved
Describes a service message about the approval of a suggested post.
type SuggestedPostDeclined ¶
type SuggestedPostDeclined struct {
// Optional.
// Message containing the suggested post.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Optional.
// Comment with which the post was declined
Comment string `json:"comment,omitempty"`
}
SuggestedPostDeclined
Describes a service message about the rejection of a suggested post.
type SuggestedPostInfo ¶
type SuggestedPostInfo struct {
// State of the suggested post.
// Currently, it can be one of “pending”, “approved”, “declined”.
State string `json:"state"`
// Optional.
// Proposed price of the post.
// If the field is omitted, then the post is unpaid.
Price *SuggestedPostPrice `json:"price,omitempty"`
// Optional.
// Proposed send date of the post.
// If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.
SendDate int64 `json:"send_date,omitempty"`
}
SuggestedPostInfo
Contains information about a suggested post.
type SuggestedPostPaid ¶
type SuggestedPostPaid struct {
// Optional.
// Message containing the suggested post.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Currency in which the payment was made.
// Currently, one of “XTR” for Telegram Stars or “TON” for toncoins
Currency string `json:"currency"`
// Optional.
// The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only
Amount int64 `json:"amount,omitempty"`
// Optional.
// The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only
StarAmount *StarAmount `json:"star_amount,omitempty"`
}
SuggestedPostPaid
Describes a service message about a successful payment for a suggested post.
type SuggestedPostParameters ¶
type SuggestedPostParameters struct {
// Optional.
// Proposed price for the post.
// If the field is omitted, then the post is unpaid.
Price *SuggestedPostPrice `json:"price,omitempty"`
// Optional.
// Proposed send date of the post.
// If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future.
// If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it.
SendDate int64 `json:"send_date,omitempty"`
}
SuggestedPostParameters
Contains parameters of a post that is being suggested by the bot.
type SuggestedPostPrice ¶
type SuggestedPostPrice struct {
// Currency in which the post will be paid.
// Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins
Currency string `json:"currency"`
// The amount of the currency that will be paid for the post in the smallest units of the currency, i.e.
// Telegram Stars or nanotoncoins.
// Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000.
Amount int64 `json:"amount"`
}
SuggestedPostPrice
Describes the price of a suggested post.
type SuggestedPostRefunded ¶
type SuggestedPostRefunded struct {
// Optional.
// Message containing the suggested post.
// Note that the [Message] object in this field will not contain the reply_to_message field even if it itself is a reply.
//
// [Message]: https://core.telegram.org/bots/api#message
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Reason for the refund.
// Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment.
Reason string `json:"reason"`
}
SuggestedPostRefunded
Describes a service message about a payment refund for a suggested post.
type SwitchInlineQueryChosenChat ¶
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 TextQuote ¶
type TextQuote struct {
// Text of the quoted part of a message that is replied to by the given message
Text string `json:"text"`
// Optional.
// Special entities that appear in the quote.
// Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes.
Entities []MessageEntity `json:"entities,omitempty"`
// Approximate quote position in the original message in UTF-16 code units as specified by the sender
Position int64 `json:"position"`
// Optional.
// True, if the quote was chosen manually by the message sender.
// Otherwise, the quote was added automatically by the server.
IsManual bool `json:"is_manual,omitempty"`
}
TextQuote
This object contains information about the quoted part of a message that is replied to by the given message.
type TransactionPartner ¶
type TransactionPartner struct {
*TransactionPartnerUser
*TransactionPartnerChat
*TransactionPartnerAffiliateProgram
*TransactionPartnerFragment
*TransactionPartnerTelegramAds
*TransactionPartnerTelegramApi
*TransactionPartnerOther
}
TransactionPartner
This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
TransactionPartnerAffiliateProgram
func (*TransactionPartner) MarshalJSON ¶
func (r *TransactionPartner) MarshalJSON() ([]byte, error)
MarshalJSON marshals the currently set subtype of TransactionPartner.
func (*TransactionPartner) UnmarshalJSON ¶
func (r *TransactionPartner) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals JSON into the matching TransactionPartner subtype.
type TransactionPartnerAffiliateProgram ¶
type TransactionPartnerAffiliateProgram struct {
// Type of the transaction partner, always “affiliate_program”
Type string `json:"type"`
// Optional.
// Information about the bot that sponsored the affiliate program
SponsorUser *User `json:"sponsor_user,omitempty"`
// The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users
CommissionPerMille int64 `json:"commission_per_mille"`
}
TransactionPartnerAffiliateProgram
Describes the affiliate program that issued the affiliate commission received via this transaction.
type TransactionPartnerChat ¶
type TransactionPartnerChat struct {
// Type of the transaction partner, always “chat”
Type string `json:"type"`
// Information about the chat
Chat Chat `json:"chat"`
// Optional.
// The gift sent to the chat by the bot
Gift *Gift `json:"gift,omitempty"`
}
TransactionPartnerChat
Describes a transaction with a chat.
type TransactionPartnerFragment ¶
type TransactionPartnerFragment struct {
// Type of the transaction partner, always “fragment”
Type string `json:"type"`
// Optional.
// State of the transaction if the transaction is outgoing
WithdrawalState *RevenueWithdrawalState `json:"withdrawal_state,omitempty"`
}
TransactionPartnerFragment
Describes a withdrawal transaction with Fragment.
type TransactionPartnerOther ¶
type TransactionPartnerOther struct {
// Type of the transaction partner, always “other”
Type string `json:"type"`
}
TransactionPartnerOther
Describes a transaction with an unknown source or recipient.
type TransactionPartnerTelegramAds ¶
type TransactionPartnerTelegramAds struct {
// Type of the transaction partner, always “telegram_ads”
Type string `json:"type"`
}
TransactionPartnerTelegramAds
Describes a withdrawal transaction to the Telegram Ads platform.
type TransactionPartnerTelegramApi ¶
type TransactionPartnerTelegramApi struct {
// Type of the transaction partner, always “telegram_api”
Type string `json:"type"`
// The number of successful requests that exceeded regular limits and were therefore billed
RequestCount int64 `json:"request_count"`
}
TransactionPartnerTelegramApi
Describes a transaction with payment for paid broadcasting.
type TransactionPartnerUser ¶
type TransactionPartnerUser struct {
// Type of the transaction partner, always “user”
Type string `json:"type"`
// Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts
TransactionType string `json:"transaction_type"`
// Information about the user
User User `json:"user"`
// Optional.
// Information about the affiliate that received a commission via this transaction.
// Can be available only for “invoice_payment” and “paid_media_payment” transactions.
Affiliate *AffiliateInfo `json:"affiliate,omitempty"`
// Optional.
// Bot-specified invoice payload.
// Can be available only for “invoice_payment” transactions.
InvoicePayload string `json:"invoice_payload,omitempty"`
// Optional.
// The duration of the paid subscription.
// Can be available only for “invoice_payment” transactions.
SubscriptionPeriod int64 `json:"subscription_period,omitempty"`
// Optional.
// Information about the paid media bought by the user; for “paid_media_payment” transactions only
PaidMedia []PaidMedia `json:"paid_media,omitempty"`
// Optional.
// Bot-specified paid media payload.
// Can be available only for “paid_media_payment” transactions.
PaidMediaPayload string `json:"paid_media_payload,omitempty"`
// Optional.
// The gift sent to the user by the bot; for “gift_purchase” transactions only
Gift *Gift `json:"gift,omitempty"`
// Optional.
// Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only
PremiumSubscriptionDuration int64 `json:"premium_subscription_duration,omitempty"`
}
TransactionPartnerUser
Describes a transaction with a user.
type TransferBusinessAccountStarsOption ¶
type TransferBusinessAccountStarsOption func(params *TransferBusinessAccountStarsParams) TransferBusinessAccountStarsOption
TransferBusinessAccountStarsOption configures TransferBusinessAccountStarsParams.
func WithTransferBusinessAccountStarsBusinessConnectionID ¶
func WithTransferBusinessAccountStarsBusinessConnectionID(value string) TransferBusinessAccountStarsOption
WithTransferBusinessAccountStarsBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithTransferBusinessAccountStarsStarCount ¶
func WithTransferBusinessAccountStarsStarCount(value int64) TransferBusinessAccountStarsOption
WithTransferBusinessAccountStarsStarCount sets the StarCount field.
Number of Telegram Stars to transfer; 1-10000
type TransferBusinessAccountStarsParams ¶
type TransferBusinessAccountStarsParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Number of Telegram Stars to transfer; 1-10000
StarCount int64 `json:"star_count"`
}
TransferBusinessAccountStarsParams contains parameters for Client.TransferBusinessAccountStars.
func (*TransferBusinessAccountStarsParams) Option ¶
func (r *TransferBusinessAccountStarsParams) Option(opts ...TransferBusinessAccountStarsOption) (previous TransferBusinessAccountStarsOption)
Option applies one or more TransferBusinessAccountStarsOption values and returns the last rollback option.
type TransferGiftOption ¶
type TransferGiftOption func(params *TransferGiftParams) TransferGiftOption
TransferGiftOption configures TransferGiftParams.
func WithTransferGiftBusinessConnectionID ¶
func WithTransferGiftBusinessConnectionID(value string) TransferGiftOption
WithTransferGiftBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithTransferGiftNewOwnerChatID ¶
func WithTransferGiftNewOwnerChatID(value int64) TransferGiftOption
WithTransferGiftNewOwnerChatID sets the NewOwnerChatID field.
Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
func WithTransferGiftOwnedGiftID ¶
func WithTransferGiftOwnedGiftID(value string) TransferGiftOption
WithTransferGiftOwnedGiftID sets the OwnedGiftID field.
Unique identifier of the regular gift that should be transferred
func WithTransferGiftStarCount ¶
func WithTransferGiftStarCount(value int64) TransferGiftOption
WithTransferGiftStarCount sets the StarCount field.
The amount of Telegram Stars that will be paid for the transfer from the business account balance. If positive, then the can_transfer_stars business bot right is required.
type TransferGiftParams ¶
type TransferGiftParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the regular gift that should be transferred
OwnedGiftID string `json:"owned_gift_id"`
// Unique identifier of the chat which will own the gift.
// The chat must be active in the last 24 hours.
NewOwnerChatID int64 `json:"new_owner_chat_id"`
// The amount of Telegram Stars that will be paid for the transfer from the business account balance.
// If positive, then the can_transfer_stars business bot right is required.
StarCount int64 `json:"star_count,omitempty"`
}
TransferGiftParams contains parameters for Client.TransferGift.
func (*TransferGiftParams) Option ¶
func (r *TransferGiftParams) Option(opts ...TransferGiftOption) (previous TransferGiftOption)
Option applies one or more TransferGiftOption values and returns the last rollback option.
type UnbanChatMemberOption ¶
type UnbanChatMemberOption func(params *UnbanChatMemberParams) UnbanChatMemberOption
UnbanChatMemberOption configures UnbanChatMemberParams.
func WithUnbanChatMemberChatID ¶
func WithUnbanChatMemberChatID(value string) UnbanChatMemberOption
WithUnbanChatMemberChatID sets the ChatID field.
Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
func WithUnbanChatMemberOnlyIfBanned ¶
func WithUnbanChatMemberOnlyIfBanned(value bool) UnbanChatMemberOption
WithUnbanChatMemberOnlyIfBanned sets the OnlyIfBanned field.
Do nothing if the user is not banned
func WithUnbanChatMemberUserID ¶
func WithUnbanChatMemberUserID(value int64) UnbanChatMemberOption
WithUnbanChatMemberUserID sets the UserID field.
Unique identifier of the target user
type UnbanChatMemberParams ¶
type UnbanChatMemberParams struct {
// Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// Do nothing if the user is not banned
OnlyIfBanned bool `json:"only_if_banned,omitempty"`
}
UnbanChatMemberParams contains parameters for Client.UnbanChatMember.
func (*UnbanChatMemberParams) Option ¶
func (r *UnbanChatMemberParams) Option(opts ...UnbanChatMemberOption) (previous UnbanChatMemberOption)
Option applies one or more UnbanChatMemberOption values and returns the last rollback option.
type UnbanChatSenderChatOption ¶
type UnbanChatSenderChatOption func(params *UnbanChatSenderChatParams) UnbanChatSenderChatOption
UnbanChatSenderChatOption configures UnbanChatSenderChatParams.
func WithUnbanChatSenderChatChatID ¶
func WithUnbanChatSenderChatChatID(value string) UnbanChatSenderChatOption
WithUnbanChatSenderChatChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithUnbanChatSenderChatSenderChatID ¶
func WithUnbanChatSenderChatSenderChatID(value int64) UnbanChatSenderChatOption
WithUnbanChatSenderChatSenderChatID sets the SenderChatID field.
Unique identifier of the target sender chat
type UnbanChatSenderChatParams ¶
type UnbanChatSenderChatParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Unique identifier of the target sender chat
SenderChatID int64 `json:"sender_chat_id"`
}
UnbanChatSenderChatParams contains parameters for Client.UnbanChatSenderChat.
func (*UnbanChatSenderChatParams) Option ¶
func (r *UnbanChatSenderChatParams) Option(opts ...UnbanChatSenderChatOption) (previous UnbanChatSenderChatOption)
Option applies one or more UnbanChatSenderChatOption values and returns the last rollback option.
type UnhideGeneralForumTopicOption ¶
type UnhideGeneralForumTopicOption func(params *UnhideGeneralForumTopicParams) UnhideGeneralForumTopicOption
UnhideGeneralForumTopicOption configures UnhideGeneralForumTopicParams.
func WithUnhideGeneralForumTopicChatID ¶
func WithUnhideGeneralForumTopicChatID(value string) UnhideGeneralForumTopicOption
WithUnhideGeneralForumTopicChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type UnhideGeneralForumTopicParams ¶
type UnhideGeneralForumTopicParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
}
UnhideGeneralForumTopicParams contains parameters for Client.UnhideGeneralForumTopic.
func (*UnhideGeneralForumTopicParams) Option ¶
func (r *UnhideGeneralForumTopicParams) Option(opts ...UnhideGeneralForumTopicOption) (previous UnhideGeneralForumTopicOption)
Option applies one or more UnhideGeneralForumTopicOption values and returns the last rollback option.
type UniqueGift ¶
type UniqueGift struct {
// Identifier of the regular gift from which the gift was upgraded
GiftID string `json:"gift_id"`
// Human-readable name of the regular gift from which this unique gift was upgraded
BaseName string `json:"base_name"`
// Unique name of the gift.
// This name can be used in https://t.me/nft/... links and story areas
Name string `json:"name"`
// Unique number of the upgraded gift among gifts upgraded from the same regular gift
Number int64 `json:"number"`
// Model of the gift
Model UniqueGiftModel `json:"model"`
// Symbol of the gift
Symbol UniqueGiftSymbol `json:"symbol"`
// Backdrop of the gift
Backdrop UniqueGiftBackdrop `json:"backdrop"`
// Optional.
// True, if the original regular gift was exclusively purchaseable by Telegram Premium subscribers
IsPremium bool `json:"is_premium,omitempty"`
// Optional.
// True, if the gift was used to craft another gift and isn't available anymore
IsBurned bool `json:"is_burned,omitempty"`
// Optional.
// True, if the gift is assigned from the TON blockchain and can't be resold or transferred in Telegram
IsFromBlockchain bool `json:"is_from_blockchain,omitempty"`
// Optional.
// The color scheme that can be used by the gift's owner for the chat's name, replies to messages and link previews; for business account gifts and gifts that are currently on sale only
Colors *UniqueGiftColors `json:"colors,omitempty"`
// Optional.
// Information about the chat that published the gift
PublisherChat *Chat `json:"publisher_chat,omitempty"`
}
UniqueGift
This object describes a unique gift that was upgraded from a regular gift.
type UniqueGiftBackdrop ¶
type UniqueGiftBackdrop struct {
// Name of the backdrop
Name string `json:"name"`
// Colors of the backdrop
Colors UniqueGiftBackdropColors `json:"colors"`
// The number of unique gifts that receive this backdrop for every 1000 gifts upgraded
RarityPerMille int64 `json:"rarity_per_mille"`
}
UniqueGiftBackdrop
This object describes the backdrop of a unique gift.
type UniqueGiftBackdropColors ¶
type UniqueGiftBackdropColors struct {
// The color in the center of the backdrop in RGB format
CenterColor int64 `json:"center_color"`
// The color on the edges of the backdrop in RGB format
EdgeColor int64 `json:"edge_color"`
// The color to be applied to the symbol in RGB format
SymbolColor int64 `json:"symbol_color"`
// The color for the text on the backdrop in RGB format
TextColor int64 `json:"text_color"`
}
UniqueGiftBackdropColors
This object describes the colors of the backdrop of a unique gift.
type UniqueGiftColors ¶
type UniqueGiftColors struct {
// Custom emoji identifier of the unique gift's model
ModelCustomEmojiID string `json:"model_custom_emoji_id"`
// Custom emoji identifier of the unique gift's symbol
SymbolCustomEmojiID string `json:"symbol_custom_emoji_id"`
// Main color used in light themes; RGB format
LightThemeMainColor int64 `json:"light_theme_main_color"`
// List of 1-3 additional colors used in light themes; RGB format
LightThemeOtherColors []int64 `json:"light_theme_other_colors"`
// Main color used in dark themes; RGB format
DarkThemeMainColor int64 `json:"dark_theme_main_color"`
// List of 1-3 additional colors used in dark themes; RGB format
DarkThemeOtherColors []int64 `json:"dark_theme_other_colors"`
}
UniqueGiftColors
This object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.
type UniqueGiftInfo ¶
type UniqueGiftInfo struct {
// Information about the gift
Gift UniqueGift `json:"gift"`
// Origin of the gift.
// Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers
Origin string `json:"origin"`
// Optional.
// For gifts bought from other users, the currency in which the payment for the gift was done.
// Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
LastResaleCurrency string `json:"last_resale_currency,omitempty"`
// Optional.
// For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins
LastResaleAmount int64 `json:"last_resale_amount,omitempty"`
// Optional.
// Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
OwnedGiftID string `json:"owned_gift_id,omitempty"`
// Optional.
// Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift
TransferStarCount int64 `json:"transfer_star_count,omitempty"`
// Optional.
// Point in time (Unix timestamp) when the gift can be transferred.
// If it is in the past, then the gift can be transferred now
NextTransferDate int64 `json:"next_transfer_date,omitempty"`
}
UniqueGiftInfo
Describes a service message about a unique gift that was sent or received.
type UniqueGiftModel ¶
type UniqueGiftModel struct {
// Name of the model
Name string `json:"name"`
// The sticker that represents the unique gift
Sticker Sticker `json:"sticker"`
// The number of unique gifts that receive this model for every 1000 gift upgrades.
// Always 0 for crafted gifts.
RarityPerMille int64 `json:"rarity_per_mille"`
// Optional.
// Rarity of the model if it is a crafted model.
// Currently, can be “uncommon”, “rare”, “epic”, or “legendary”.
Rarity string `json:"rarity,omitempty"`
}
UniqueGiftModel
This object describes the model of a unique gift.
type UniqueGiftSymbol ¶
type UniqueGiftSymbol struct {
// Name of the symbol
Name string `json:"name"`
// The sticker that represents the unique gift
Sticker Sticker `json:"sticker"`
// The number of unique gifts that receive this model for every 1000 gifts upgraded
RarityPerMille int64 `json:"rarity_per_mille"`
}
UniqueGiftSymbol
This object describes the symbol shown on the pattern of a unique gift.
type UnpinAllChatMessagesOption ¶
type UnpinAllChatMessagesOption func(params *UnpinAllChatMessagesParams) UnpinAllChatMessagesOption
UnpinAllChatMessagesOption configures UnpinAllChatMessagesParams.
func WithUnpinAllChatMessagesChatID ¶
func WithUnpinAllChatMessagesChatID(value string) UnpinAllChatMessagesOption
WithUnpinAllChatMessagesChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
type UnpinAllChatMessagesParams ¶
type UnpinAllChatMessagesParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
}
UnpinAllChatMessagesParams contains parameters for Client.UnpinAllChatMessages.
func (*UnpinAllChatMessagesParams) Option ¶
func (r *UnpinAllChatMessagesParams) Option(opts ...UnpinAllChatMessagesOption) (previous UnpinAllChatMessagesOption)
Option applies one or more UnpinAllChatMessagesOption values and returns the last rollback option.
type UnpinAllForumTopicMessagesOption ¶
type UnpinAllForumTopicMessagesOption func(params *UnpinAllForumTopicMessagesParams) UnpinAllForumTopicMessagesOption
UnpinAllForumTopicMessagesOption configures UnpinAllForumTopicMessagesParams.
func WithUnpinAllForumTopicMessagesChatID ¶
func WithUnpinAllForumTopicMessagesChatID(value string) UnpinAllForumTopicMessagesOption
WithUnpinAllForumTopicMessagesChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
func WithUnpinAllForumTopicMessagesMessageThreadID ¶
func WithUnpinAllForumTopicMessagesMessageThreadID(value int64) UnpinAllForumTopicMessagesOption
WithUnpinAllForumTopicMessagesMessageThreadID sets the MessageThreadID field.
Unique identifier for the target message thread of the forum topic
type UnpinAllForumTopicMessagesParams ¶
type UnpinAllForumTopicMessagesParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
// Unique identifier for the target message thread of the forum topic
MessageThreadID int64 `json:"message_thread_id"`
}
UnpinAllForumTopicMessagesParams contains parameters for Client.UnpinAllForumTopicMessages.
func (*UnpinAllForumTopicMessagesParams) Option ¶
func (r *UnpinAllForumTopicMessagesParams) Option(opts ...UnpinAllForumTopicMessagesOption) (previous UnpinAllForumTopicMessagesOption)
Option applies one or more UnpinAllForumTopicMessagesOption values and returns the last rollback option.
type UnpinAllGeneralForumTopicMessagesOption ¶
type UnpinAllGeneralForumTopicMessagesOption func(params *UnpinAllGeneralForumTopicMessagesParams) UnpinAllGeneralForumTopicMessagesOption
UnpinAllGeneralForumTopicMessagesOption configures UnpinAllGeneralForumTopicMessagesParams.
func WithUnpinAllGeneralForumTopicMessagesChatID ¶
func WithUnpinAllGeneralForumTopicMessagesChatID(value string) UnpinAllGeneralForumTopicMessagesOption
WithUnpinAllGeneralForumTopicMessagesChatID sets the ChatID field.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
type UnpinAllGeneralForumTopicMessagesParams ¶
type UnpinAllGeneralForumTopicMessagesParams struct {
// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
ChatID string `json:"chat_id"`
}
UnpinAllGeneralForumTopicMessagesParams contains parameters for Client.UnpinAllGeneralForumTopicMessages.
func (*UnpinAllGeneralForumTopicMessagesParams) Option ¶
func (r *UnpinAllGeneralForumTopicMessagesParams) Option(opts ...UnpinAllGeneralForumTopicMessagesOption) (previous UnpinAllGeneralForumTopicMessagesOption)
Option applies one or more UnpinAllGeneralForumTopicMessagesOption values and returns the last rollback option.
type UnpinChatMessageOption ¶
type UnpinChatMessageOption func(params *UnpinChatMessageParams) UnpinChatMessageOption
UnpinChatMessageOption configures UnpinChatMessageParams.
func WithUnpinChatMessageBusinessConnectionID ¶
func WithUnpinChatMessageBusinessConnectionID(value string) UnpinChatMessageOption
WithUnpinChatMessageBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection on behalf of which the message will be unpinned
func WithUnpinChatMessageChatID ¶
func WithUnpinChatMessageChatID(value string) UnpinChatMessageOption
WithUnpinChatMessageChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
func WithUnpinChatMessageMessageID ¶
func WithUnpinChatMessageMessageID(value int64) UnpinChatMessageOption
WithUnpinChatMessageMessageID sets the MessageID field.
Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned.
type UnpinChatMessageParams ¶
type UnpinChatMessageParams struct {
// Unique identifier of the business connection on behalf of which the message will be unpinned
BusinessConnectionID string `json:"business_connection_id,omitempty"`
// Unique identifier for the target chat or username of the target channel (in the format @channelusername)
ChatID string `json:"chat_id"`
// Identifier of the message to unpin.
// Required if business_connection_id is specified.
// If not specified, the most recent pinned message (by sending date) will be unpinned.
MessageID int64 `json:"message_id,omitempty"`
}
UnpinChatMessageParams contains parameters for Client.UnpinChatMessage.
func (*UnpinChatMessageParams) Option ¶
func (r *UnpinChatMessageParams) Option(opts ...UnpinChatMessageOption) (previous UnpinChatMessageOption)
Option applies one or more UnpinChatMessageOption values and returns the last rollback option.
type Update ¶
type Update struct {
// The update's unique identifier.
// Update identifiers start from a certain positive number and increase sequentially.
// This identifier 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.
//
// [webhooks]: https://core.telegram.org/bots/api#setwebhook
UpdateID int64 `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.
// This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
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.
// This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
EditedChannelPost *Message `json:"edited_channel_post,omitempty"`
// Optional.
// The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
BusinessConnection *BusinessConnection `json:"business_connection,omitempty"`
// Optional.
// New message from a connected business account
BusinessMessage *Message `json:"business_message,omitempty"`
// Optional.
// New version of a message from a connected business account
EditedBusinessMessage *Message `json:"edited_business_message,omitempty"`
// Optional.
// Messages were deleted from a connected business account
DeletedBusinessMessages *BusinessMessagesDeleted `json:"deleted_business_messages,omitempty"`
// Optional.
// A reaction to a message was changed by a user.
// The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates.
// The update isn't received for reactions set by bots.
MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"`
// Optional.
// Reactions to a message with anonymous reactions were changed.
// The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates.
// The updates are grouped and can be sent with delay up to a few minutes.
MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"`
// Optional.
// New incoming [inline] query
//
// [inline]: https://core.telegram.org/bots/api#inline-mode
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.
//
// [inline]: https://core.telegram.org/bots/api#inline-mode
// [feedback collecting]: https://core.telegram.org/bots/inline#collecting-feedback
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.
// A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat
PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"`
// Optional.
// New poll state.
// Bots receive only updates about manually 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"`
// Optional.
// A chat boost was added or changed.
// The bot must be an administrator in the chat to receive these updates.
ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"`
// Optional.
// A boost was removed from a chat.
// The bot must be an administrator in the chat to receive these updates.
RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"`
}
Update
This object represents an incoming update. At most one of the optional parameters can be present in any given update.
type UpgradeGiftOption ¶
type UpgradeGiftOption func(params *UpgradeGiftParams) UpgradeGiftOption
UpgradeGiftOption configures UpgradeGiftParams.
func WithUpgradeGiftBusinessConnectionID ¶
func WithUpgradeGiftBusinessConnectionID(value string) UpgradeGiftOption
WithUpgradeGiftBusinessConnectionID sets the BusinessConnectionID field.
Unique identifier of the business connection
func WithUpgradeGiftKeepOriginalDetails ¶
func WithUpgradeGiftKeepOriginalDetails(value bool) UpgradeGiftOption
WithUpgradeGiftKeepOriginalDetails sets the KeepOriginalDetails field.
Pass True to keep the original gift text, sender and receiver in the upgraded gift
func WithUpgradeGiftOwnedGiftID ¶
func WithUpgradeGiftOwnedGiftID(value string) UpgradeGiftOption
WithUpgradeGiftOwnedGiftID sets the OwnedGiftID field.
Unique identifier of the regular gift that should be upgraded to a unique one
func WithUpgradeGiftStarCount ¶
func WithUpgradeGiftStarCount(value int64) UpgradeGiftOption
WithUpgradeGiftStarCount sets the StarCount field.
The amount of Telegram Stars that will be paid for the upgrade from the business account balance. If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.
type UpgradeGiftParams ¶
type UpgradeGiftParams struct {
// Unique identifier of the business connection
BusinessConnectionID string `json:"business_connection_id"`
// Unique identifier of the regular gift that should be upgraded to a unique one
OwnedGiftID string `json:"owned_gift_id"`
// Pass True to keep the original gift text, sender and receiver in the upgraded gift
KeepOriginalDetails bool `json:"keep_original_details,omitempty"`
// The amount of Telegram Stars that will be paid for the upgrade from the business account balance.
// If gift.prepaid_upgrade_star_count > 0, then pass 0, otherwise, the can_transfer_stars business bot right is required and gift.upgrade_star_count must be passed.
StarCount int64 `json:"star_count,omitempty"`
}
UpgradeGiftParams contains parameters for Client.UpgradeGift.
func (*UpgradeGiftParams) Option ¶
func (r *UpgradeGiftParams) Option(opts ...UpgradeGiftOption) (previous UpgradeGiftOption)
Option applies one or more UpgradeGiftOption values and returns the last rollback option.
type UploadStickerFileOption ¶
type UploadStickerFileOption func(params *UploadStickerFileParams) UploadStickerFileOption
UploadStickerFileOption configures UploadStickerFileParams.
func WithUploadStickerFileSticker ¶
func WithUploadStickerFileSticker(value InputFile) UploadStickerFileOption
WithUploadStickerFileSticker sets the Sticker field.
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 WithUploadStickerFileStickerFormat ¶
func WithUploadStickerFileStickerFormat(value string) UploadStickerFileOption
WithUploadStickerFileStickerFormat sets the StickerFormat field.
Format of the sticker, must be one of “static”, “animated”, “video”
func WithUploadStickerFileUserID ¶
func WithUploadStickerFileUserID(value int64) UploadStickerFileOption
WithUploadStickerFileUserID sets the UserID field.
User identifier of sticker file owner
type UploadStickerFileParams ¶
type UploadStickerFileParams struct {
// User identifier of sticker file owner
UserID int64 `json:"user_id"`
// 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 »]
//
// [https://core.telegram.org/stickers]: https://core.telegram.org/stickers
// [More information on Sending Files »]: https://core.telegram.org/bots/api#sending-files
Sticker InputFile `json:"sticker"`
// Format of the sticker, must be one of “static”, “animated”, “video”
StickerFormat string `json:"sticker_format"`
}
UploadStickerFileParams contains parameters for Client.UploadStickerFile.
func (*UploadStickerFileParams) Option ¶
func (r *UploadStickerFileParams) Option(opts ...UploadStickerFileOption) (previous UploadStickerFileOption)
Option applies one or more UploadStickerFileOption values and returns the last rollback option.
type User ¶
type User struct {
// Unique identifier for this user or bot.
// This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
ID int64 `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 string `json:"username,omitempty"`
// Optional.
// [IETF language tag] of the user's language
//
// [IETF language tag]: https://en.wikipedia.org/wiki/IETF_language_tag
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].
//
// [getMe]: https://core.telegram.org/bots/api#getme
CanJoinGroups bool `json:"can_join_groups,omitempty"`
// Optional.
// True, if [privacy mode] is disabled for the bot.
// Returned only in [getMe].
//
// [privacy mode]: https://core.telegram.org/bots/features#privacy-mode
// [getMe]: https://core.telegram.org/bots/api#getme
CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"`
// Optional.
// True, if the bot supports inline queries.
// Returned only in [getMe].
//
// [getMe]: https://core.telegram.org/bots/api#getme
SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"`
// Optional.
// True, if the bot can be connected to a Telegram Business account to receive its messages.
// Returned only in [getMe].
//
// [getMe]: https://core.telegram.org/bots/api#getme
CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"`
// Optional.
// True, if the bot has a main Web App.
// Returned only in [getMe].
//
// [getMe]: https://core.telegram.org/bots/api#getme
HasMainWebApp bool `json:"has_main_web_app,omitempty"`
// Optional.
// True, if the bot has forum topic mode enabled in private chats.
// Returned only in [getMe].
//
// [getMe]: https://core.telegram.org/bots/api#getme
HasTopicsEnabled bool `json:"has_topics_enabled,omitempty"`
// Optional.
// True, if the bot allows users to create and delete topics in private chats.
// Returned only in [getMe].
//
// [getMe]: https://core.telegram.org/bots/api#getme
AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics,omitempty"`
}
User
This object represents a Telegram user or bot.
func (*User) Identifier ¶
Identifier returns the user identifier. It returns the user ID as a string if available, otherwise it returns the username with an '@' prefix.
type UserChatBoosts ¶
type UserChatBoosts struct {
// The list of boosts added to the chat by the user
Boosts []ChatBoost `json:"boosts"`
}
UserChatBoosts
This object represents a list of boosts added to a chat by a user.
type UserProfileAudios ¶
type UserProfileAudios struct {
// Total number of profile audios for the target user
TotalCount int64 `json:"total_count"`
// Requested profile audios
Audios []Audio `json:"audios"`
}
UserProfileAudios
This object represents the audios displayed on a user's profile.
type UserProfilePhotos ¶
type UserProfilePhotos struct {
// Total number of profile pictures the target user has
TotalCount int64 `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 UserRating ¶
type UserRating struct {
// Current level of the user, indicating their reliability when purchasing digital goods and services.
// A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.
Level int64 `json:"level"`
// Numerical value of the user's rating; the higher the rating, the better
Rating int64 `json:"rating"`
// The rating value required to get the current level
CurrentLevelRating int64 `json:"current_level_rating"`
// Optional.
// The rating value required to get to the next level; omitted if the maximum level was reached
NextLevelRating int64 `json:"next_level_rating,omitempty"`
}
UserRating
This object describes the rating of a user based on their Telegram Star spendings.
type UsersShared ¶
type UsersShared struct {
RequestID int64 `json:"request_id"`
Users []SharedUser `json:"users"`
}
UsersShared
This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
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].)
//
// [supported types]: https://developers.google.com/places/web-service/supported_types
GooglePlaceType string `json:"google_place_type,omitempty"`
}
Venue
This object represents a venue.
type VerifyChatOption ¶
type VerifyChatOption func(params *VerifyChatParams) VerifyChatOption
VerifyChatOption configures VerifyChatParams.
func WithVerifyChatChatID ¶
func WithVerifyChatChatID(value string) VerifyChatOption
WithVerifyChatChatID sets the ChatID field.
Unique identifier for the target chat or username of the target channel (in the format @channelusername). Channel direct messages chats can't be verified.
func WithVerifyChatCustomDescription ¶
func WithVerifyChatCustomDescription(value string) VerifyChatOption
WithVerifyChatCustomDescription sets the CustomDescription field.
Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
type VerifyChatParams ¶
type VerifyChatParams struct {
// Unique identifier for the target chat or username of the target channel (in the format @channelusername).
// Channel direct messages chats can't be verified.
ChatID string `json:"chat_id"`
// Custom description for the verification; 0-70 characters.
// Must be empty if the organization isn't allowed to provide a custom verification description.
CustomDescription string `json:"custom_description,omitempty"`
}
VerifyChatParams contains parameters for Client.VerifyChat.
func (*VerifyChatParams) Option ¶
func (r *VerifyChatParams) Option(opts ...VerifyChatOption) (previous VerifyChatOption)
Option applies one or more VerifyChatOption values and returns the last rollback option.
type VerifyUserOption ¶
type VerifyUserOption func(params *VerifyUserParams) VerifyUserOption
VerifyUserOption configures VerifyUserParams.
func WithVerifyUserCustomDescription ¶
func WithVerifyUserCustomDescription(value string) VerifyUserOption
WithVerifyUserCustomDescription sets the CustomDescription field.
Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
func WithVerifyUserUserID ¶
func WithVerifyUserUserID(value int64) VerifyUserOption
WithVerifyUserUserID sets the UserID field.
Unique identifier of the target user
type VerifyUserParams ¶
type VerifyUserParams struct {
// Unique identifier of the target user
UserID int64 `json:"user_id"`
// Custom description for the verification; 0-70 characters.
// Must be empty if the organization isn't allowed to provide a custom verification description.
CustomDescription string `json:"custom_description,omitempty"`
}
VerifyUserParams contains parameters for Client.VerifyUser.
func (*VerifyUserParams) Option ¶
func (r *VerifyUserParams) Option(opts ...VerifyUserOption) (previous VerifyUserOption)
Option applies one or more VerifyUserOption values and returns the last rollback option.
type Video ¶
type Video 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"`
// Video width as defined by the sender
Width int64 `json:"width"`
// Video height as defined by the sender
Height int64 `json:"height"`
// Duration of the video in seconds as defined by the sender
Duration int64 `json:"duration"`
// Optional.
// Video thumbnail
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
// Optional.
// Available sizes of the cover of the video in the message
Cover []PhotoSize `json:"cover,omitempty"`
// Optional.
// Timestamp in seconds from which the video will play in the message
StartTimestamp int64 `json:"start_timestamp,omitempty"`
// Optional.
// List of available qualities of the video
Qualities []VideoQuality `json:"qualities,omitempty"`
// Optional.
// Original filename as defined by the sender
FileName string `json:"file_name,omitempty"`
// Optional.
// MIME type of the file as defined by the sender
MimeType string `json:"mime_type,omitempty"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
FileSize int64 `json:"file_size,omitempty"`
}
Video
This object represents a video file.
type VideoChatEnded ¶
type VideoChatEnded struct {
// Video chat duration in seconds
Duration int64 `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 int64 `json:"start_date"`
}
VideoChatScheduled
This object represents a service message about a video chat scheduled in the chat.
type VideoChatStarted ¶
type VideoChatStarted struct {
}
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 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"`
// Video width and height (diameter of the video message) as defined by the sender
Length int64 `json:"length"`
// Duration of the video in seconds as defined by the sender
Duration int64 `json:"duration"`
// Optional.
// Video thumbnail
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
// Optional.
// File size in bytes
FileSize int64 `json:"file_size,omitempty"`
}
VideoNote
This object represents a video message (available in Telegram apps as of v.4.0).
type VideoQuality ¶
type VideoQuality 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"`
// Video width
Width int64 `json:"width"`
// Video height
Height int64 `json:"height"`
// Codec that was used to encode the video, for example, “h264”, “h265”, or “av01”
Codec string `json:"codec"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
FileSize int64 `json:"file_size,omitempty"`
}
VideoQuality
This object represents a video file of a specific quality.
type Voice ¶
type Voice 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"`
// Duration of the audio in seconds as defined by the sender
Duration int64 `json:"duration"`
// Optional.
// MIME type of the file as defined by the sender
MimeType string `json:"mime_type,omitempty"`
// Optional.
// File size in bytes.
// It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
// But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
FileSize int64 `json:"file_size,omitempty"`
}
Voice
This object represents a voice note.
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]
//
// [Initializing Web Apps]: https://core.telegram.org/bots/webapps#initializing-mini-apps
URL string `json:"url"`
}
WebAppInfo
Describes a Web App.
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 int64 `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 int64 `json:"max_connections,omitempty"`
// Optional.
// A list of update types the bot is subscribed to.
// Defaults to all update types except chat_member
AllowedUpdates []string `json:"allowed_updates,omitempty"`
}
WebhookInfo
Describes the current status of a webhook.
type WriteAccessAllowed ¶
type WriteAccessAllowed struct {
// Optional.
// True, if the access was granted after the user accepted an explicit request from a Web App sent by the method [requestWriteAccess]
//
// [requestWriteAccess]: https://core.telegram.org/bots/webapps#initializing-mini-apps
FromRequest bool `json:"from_request,omitempty"`
// Optional.
// Name of the Web App, if the access was granted when the Web App was launched from a link
WebAppName string `json:"web_app_name,omitempty"`
// Optional.
// True, if the access was granted when the bot was added to the attachment or side menu
FromAttachmentMenu bool `json:"from_attachment_menu,omitempty"`
}
WriteAccessAllowed
This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
Source Files
¶
- client.go
- commands.go
- context.gen.go
- context.go
- doc.go
- errors.go
- file.go
- helpers.go
- inline_keyboard_button.go
- keyboard.go
- limits.go
- message_entities.go
- methods.gen.go
- parse_mode.go
- router.gen.go
- router.go
- router_filters.go
- sql.go
- types.gen.go
- types_callback_query.go
- types_chat.go
- types_chat_action.go
- types_chat_full_info.go
- types_edit_message_text_params.go
- types_input_file.go
- types_maybe_inaccessible_message.go
- types_message.go
- types_response.go
- types_send_message_params.go
- types_user.go