Documentation
¶
Index ¶
- func LongPollUpdates(ctx context.Context, bot *Bot, options *LongPollUpdatesOptions) chan []Update
- type APIError
- type AddStickerToSetRequest
- type AffiliateInfo
- type Animation
- type AnswerCallbackQueryRequest
- type AnswerInlineQueryRequest
- type AnswerPreCheckoutQueryRequest
- type AnswerShippingQueryRequest
- type AnswerWebAppQueryRequest
- type ApproveChatJoinRequest
- type Audio
- type BackgroundFill
- type BackgroundType
- type BanChatMemberRequest
- type BanChatSenderChatRequest
- type Birthdate
- type Bot
- func (b *Bot) AddStickerToSet(ctx context.Context, request *AddStickerToSetRequest) (r bool, err error)
- func (b *Bot) AddStickerToSetVoid(ctx context.Context, request *AddStickerToSetRequest) error
- func (b *Bot) AnswerCallbackQuery(ctx context.Context, request *AnswerCallbackQueryRequest) (r bool, err error)
- func (b *Bot) AnswerCallbackQueryVoid(ctx context.Context, request *AnswerCallbackQueryRequest) error
- func (b *Bot) AnswerInlineQuery(ctx context.Context, request *AnswerInlineQueryRequest) (r bool, err error)
- func (b *Bot) AnswerInlineQueryVoid(ctx context.Context, request *AnswerInlineQueryRequest) error
- func (b *Bot) AnswerPreCheckoutQuery(ctx context.Context, request *AnswerPreCheckoutQueryRequest) (r bool, err error)
- func (b *Bot) AnswerPreCheckoutQueryVoid(ctx context.Context, request *AnswerPreCheckoutQueryRequest) error
- func (b *Bot) AnswerShippingQuery(ctx context.Context, request *AnswerShippingQueryRequest) (r bool, err error)
- func (b *Bot) AnswerShippingQueryVoid(ctx context.Context, request *AnswerShippingQueryRequest) error
- func (b *Bot) AnswerWebAppQuery(ctx context.Context, request *AnswerWebAppQueryRequest) (r *SentWebAppMessage, err error)
- func (b *Bot) AnswerWebAppQueryVoid(ctx context.Context, request *AnswerWebAppQueryRequest) error
- func (b *Bot) ApproveChatJoinRequest(ctx context.Context, request *ApproveChatJoinRequest) (r bool, err error)
- func (b *Bot) ApproveChatJoinRequestVoid(ctx context.Context, request *ApproveChatJoinRequest) error
- func (b *Bot) BanChatMember(ctx context.Context, request *BanChatMemberRequest) (r bool, err error)
- func (b *Bot) BanChatMemberVoid(ctx context.Context, request *BanChatMemberRequest) error
- func (b *Bot) BanChatSenderChat(ctx context.Context, request *BanChatSenderChatRequest) (r bool, err error)
- func (b *Bot) BanChatSenderChatVoid(ctx context.Context, request *BanChatSenderChatRequest) error
- func (b *Bot) Close(ctx context.Context) (r bool, err error)
- func (b *Bot) CloseForumTopic(ctx context.Context, request *CloseForumTopicRequest) (r bool, err error)
- func (b *Bot) CloseForumTopicVoid(ctx context.Context, request *CloseForumTopicRequest) error
- func (b *Bot) CloseGeneralForumTopic(ctx context.Context, request *CloseGeneralForumTopicRequest) (r bool, err error)
- func (b *Bot) CloseGeneralForumTopicVoid(ctx context.Context, request *CloseGeneralForumTopicRequest) error
- func (b *Bot) CopyMessage(ctx context.Context, request *CopyMessageRequest) (r *MessageId, err error)
- func (b *Bot) CopyMessageVoid(ctx context.Context, request *CopyMessageRequest) error
- func (b *Bot) CopyMessages(ctx context.Context, request *CopyMessagesRequest) (r []MessageId, err error)
- func (b *Bot) CopyMessagesVoid(ctx context.Context, request *CopyMessagesRequest) error
- func (b *Bot) CreateChatInviteLink(ctx context.Context, request *CreateChatInviteLinkRequest) (r *ChatInviteLink, err error)
- func (b *Bot) CreateChatInviteLinkVoid(ctx context.Context, request *CreateChatInviteLinkRequest) error
- func (b *Bot) CreateChatSubscriptionInviteLink(ctx context.Context, request *CreateChatSubscriptionInviteLinkRequest) (r *ChatInviteLink, err error)
- func (b *Bot) CreateChatSubscriptionInviteLinkVoid(ctx context.Context, request *CreateChatSubscriptionInviteLinkRequest) error
- func (b *Bot) CreateForumTopic(ctx context.Context, request *CreateForumTopicRequest) (r *ForumTopic, err error)
- func (b *Bot) CreateForumTopicVoid(ctx context.Context, request *CreateForumTopicRequest) error
- func (b *Bot) CreateInvoiceLink(ctx context.Context, request *CreateInvoiceLinkRequest) (r string, err error)
- func (b *Bot) CreateInvoiceLinkVoid(ctx context.Context, request *CreateInvoiceLinkRequest) error
- func (b *Bot) CreateNewStickerSet(ctx context.Context, request *CreateNewStickerSetRequest) (r bool, err error)
- func (b *Bot) CreateNewStickerSetVoid(ctx context.Context, request *CreateNewStickerSetRequest) error
- func (b *Bot) DeclineChatJoinRequest(ctx context.Context, request *DeclineChatJoinRequest) (r bool, err error)
- func (b *Bot) DeclineChatJoinRequestVoid(ctx context.Context, request *DeclineChatJoinRequest) error
- func (b *Bot) DeleteChatPhoto(ctx context.Context, request *DeleteChatPhotoRequest) (r bool, err error)
- func (b *Bot) DeleteChatPhotoVoid(ctx context.Context, request *DeleteChatPhotoRequest) error
- func (b *Bot) DeleteChatStickerSet(ctx context.Context, request *DeleteChatStickerSetRequest) (r bool, err error)
- func (b *Bot) DeleteChatStickerSetVoid(ctx context.Context, request *DeleteChatStickerSetRequest) error
- func (b *Bot) DeleteForumTopic(ctx context.Context, request *DeleteForumTopicRequest) (r bool, err error)
- func (b *Bot) DeleteForumTopicVoid(ctx context.Context, request *DeleteForumTopicRequest) error
- func (b *Bot) DeleteMessage(ctx context.Context, request *DeleteMessageRequest) (r bool, err error)
- func (b *Bot) DeleteMessageVoid(ctx context.Context, request *DeleteMessageRequest) error
- func (b *Bot) DeleteMessages(ctx context.Context, request *DeleteMessagesRequest) (r bool, err error)
- func (b *Bot) DeleteMessagesVoid(ctx context.Context, request *DeleteMessagesRequest) error
- func (b *Bot) DeleteMyCommands(ctx context.Context, request *DeleteMyCommandsRequest) (r bool, err error)
- func (b *Bot) DeleteMyCommandsVoid(ctx context.Context, request *DeleteMyCommandsRequest) error
- func (b *Bot) DeleteStickerFromSet(ctx context.Context, request *DeleteStickerFromSetRequest) (r bool, err error)
- func (b *Bot) DeleteStickerFromSetVoid(ctx context.Context, request *DeleteStickerFromSetRequest) error
- func (b *Bot) DeleteStickerSet(ctx context.Context, request *DeleteStickerSetRequest) (r bool, err error)
- func (b *Bot) DeleteStickerSetVoid(ctx context.Context, request *DeleteStickerSetRequest) error
- func (b *Bot) DeleteWebhook(ctx context.Context, request *DeleteWebhookRequest) (r bool, err error)
- func (b *Bot) DeleteWebhookVoid(ctx context.Context, request *DeleteWebhookRequest) error
- func (b *Bot) DownloadFile(ctx context.Context, fileID string, dst io.Writer) (int64, error)
- func (b *Bot) EditChatInviteLink(ctx context.Context, request *EditChatInviteLinkRequest) (r *ChatInviteLink, err error)
- func (b *Bot) EditChatInviteLinkVoid(ctx context.Context, request *EditChatInviteLinkRequest) error
- func (b *Bot) EditChatSubscriptionInviteLink(ctx context.Context, request *EditChatSubscriptionInviteLinkRequest) (r *ChatInviteLink, err error)
- func (b *Bot) EditChatSubscriptionInviteLinkVoid(ctx context.Context, request *EditChatSubscriptionInviteLinkRequest) error
- func (b *Bot) EditForumTopic(ctx context.Context, request *EditForumTopicRequest) (r bool, err error)
- func (b *Bot) EditForumTopicVoid(ctx context.Context, request *EditForumTopicRequest) error
- func (b *Bot) EditGeneralForumTopic(ctx context.Context, request *EditGeneralForumTopicRequest) (r bool, err error)
- func (b *Bot) EditGeneralForumTopicVoid(ctx context.Context, request *EditGeneralForumTopicRequest) error
- func (b *Bot) EditMessageCaption(ctx context.Context, request *EditMessageCaptionRequest) (r *Message, err error)
- func (b *Bot) EditMessageCaptionVoid(ctx context.Context, request *EditMessageCaptionRequest) error
- func (b *Bot) EditMessageLiveLocation(ctx context.Context, request *EditMessageLiveLocationRequest) (r *Message, err error)
- func (b *Bot) EditMessageLiveLocationVoid(ctx context.Context, request *EditMessageLiveLocationRequest) error
- func (b *Bot) EditMessageMedia(ctx context.Context, request *EditMessageMediaRequest) (r *Message, err error)
- func (b *Bot) EditMessageMediaVoid(ctx context.Context, request *EditMessageMediaRequest) error
- func (b *Bot) EditMessageReplyMarkup(ctx context.Context, request *EditMessageReplyMarkupRequest) (r *Message, err error)
- func (b *Bot) EditMessageReplyMarkupVoid(ctx context.Context, request *EditMessageReplyMarkupRequest) error
- func (b *Bot) EditMessageText(ctx context.Context, request *EditMessageTextRequest) (r *Message, err error)
- func (b *Bot) EditMessageTextVoid(ctx context.Context, request *EditMessageTextRequest) error
- func (b *Bot) EditUserStarSubscription(ctx context.Context, request *EditUserStarSubscriptionRequest) (r bool, err error)
- func (b *Bot) EditUserStarSubscriptionVoid(ctx context.Context, request *EditUserStarSubscriptionRequest) error
- func (b *Bot) ExportChatInviteLink(ctx context.Context, request *ExportChatInviteLinkRequest) (r string, err error)
- func (b *Bot) ExportChatInviteLinkVoid(ctx context.Context, request *ExportChatInviteLinkRequest) error
- func (b *Bot) ForwardMessage(ctx context.Context, request *ForwardMessageRequest) (r *Message, err error)
- func (b *Bot) ForwardMessageVoid(ctx context.Context, request *ForwardMessageRequest) error
- func (b *Bot) ForwardMessages(ctx context.Context, request *ForwardMessagesRequest) (r []MessageId, err error)
- func (b *Bot) ForwardMessagesVoid(ctx context.Context, request *ForwardMessagesRequest) error
- func (b *Bot) GetAvailableGifts(ctx context.Context) (r *Gifts, err error)
- func (b *Bot) GetBusinessConnection(ctx context.Context, request *GetBusinessConnectionRequest) (r *BusinessConnection, err error)
- func (b *Bot) GetChat(ctx context.Context, request *GetChatRequest) (r *ChatFullInfo, err error)
- func (b *Bot) GetChatAdministrators(ctx context.Context, request *GetChatAdministratorsRequest) (r []ChatMember, err error)
- func (b *Bot) GetChatMember(ctx context.Context, request *GetChatMemberRequest) (r *ChatMember, err error)
- func (b *Bot) GetChatMemberCount(ctx context.Context, request *GetChatMemberCountRequest) (r int, err error)
- func (b *Bot) GetChatMenuButton(ctx context.Context, request *GetChatMenuButtonRequest) (r *MenuButton, err error)
- func (b *Bot) GetCustomEmojiStickers(ctx context.Context, request *GetCustomEmojiStickersRequest) (r []Sticker, err error)
- func (b *Bot) GetFile(ctx context.Context, request *GetFileRequest) (r *File, err error)
- func (b *Bot) GetForumTopicIconStickers(ctx context.Context) (r []Sticker, err error)
- func (b *Bot) GetGameHighScores(ctx context.Context, request *GetGameHighScoresRequest) (r []GameHighScore, err error)
- func (b *Bot) GetMe(ctx context.Context) (r *User, err error)
- func (b *Bot) GetMyCommands(ctx context.Context, request *GetMyCommandsRequest) (r []BotCommand, err error)
- func (b *Bot) GetMyDefaultAdministratorRights(ctx context.Context, request *GetMyDefaultAdministratorRightsRequest) (r *ChatAdministratorRights, err error)
- func (b *Bot) GetMyDescription(ctx context.Context, request *GetMyDescriptionRequest) (r *BotDescription, err error)
- func (b *Bot) GetMyName(ctx context.Context, request *GetMyNameRequest) (r *BotName, err error)
- func (b *Bot) GetMyShortDescription(ctx context.Context, request *GetMyShortDescriptionRequest) (r *BotShortDescription, err error)
- func (b *Bot) GetStarTransactions(ctx context.Context, request *GetStarTransactionsRequest) (r *StarTransactions, err error)
- func (b *Bot) GetStickerSet(ctx context.Context, request *GetStickerSetRequest) (r *StickerSet, err error)
- func (b *Bot) GetUpdates(ctx context.Context, request *GetUpdatesRequest) (r []Update, err error)
- func (b *Bot) GetUserChatBoosts(ctx context.Context, request *GetUserChatBoostsRequest) (r *UserChatBoosts, err error)
- func (b *Bot) GetUserProfilePhotos(ctx context.Context, request *GetUserProfilePhotosRequest) (r *UserProfilePhotos, err error)
- func (b *Bot) GetWebhookInfo(ctx context.Context) (r *WebhookInfo, err error)
- func (b *Bot) HideGeneralForumTopic(ctx context.Context, request *HideGeneralForumTopicRequest) (r bool, err error)
- func (b *Bot) HideGeneralForumTopicVoid(ctx context.Context, request *HideGeneralForumTopicRequest) error
- func (b *Bot) LeaveChat(ctx context.Context, request *LeaveChatRequest) (r bool, err error)
- func (b *Bot) LeaveChatVoid(ctx context.Context, request *LeaveChatRequest) error
- func (b *Bot) LogOut(ctx context.Context) (r bool, err error)
- func (b *Bot) PinChatMessage(ctx context.Context, request *PinChatMessageRequest) (r bool, err error)
- func (b *Bot) PinChatMessageVoid(ctx context.Context, request *PinChatMessageRequest) error
- func (b *Bot) PromoteChatMember(ctx context.Context, request *PromoteChatMemberRequest) (r bool, err error)
- func (b *Bot) PromoteChatMemberVoid(ctx context.Context, request *PromoteChatMemberRequest) error
- func (b *Bot) RefundStarPayment(ctx context.Context, request *RefundStarPaymentRequest) (r bool, err error)
- func (b *Bot) RefundStarPaymentVoid(ctx context.Context, request *RefundStarPaymentRequest) error
- func (b *Bot) RemoveChatVerification(ctx context.Context, request *RemoveChatVerificationRequest) (r bool, err error)
- func (b *Bot) RemoveChatVerificationVoid(ctx context.Context, request *RemoveChatVerificationRequest) error
- func (b *Bot) RemoveUserVerification(ctx context.Context, request *RemoveUserVerificationRequest) (r bool, err error)
- func (b *Bot) RemoveUserVerificationVoid(ctx context.Context, request *RemoveUserVerificationRequest) error
- func (b *Bot) ReopenForumTopic(ctx context.Context, request *ReopenForumTopicRequest) (r bool, err error)
- func (b *Bot) ReopenForumTopicVoid(ctx context.Context, request *ReopenForumTopicRequest) error
- func (b *Bot) ReopenGeneralForumTopic(ctx context.Context, request *ReopenGeneralForumTopicRequest) (r bool, err error)
- func (b *Bot) ReopenGeneralForumTopicVoid(ctx context.Context, request *ReopenGeneralForumTopicRequest) error
- func (b *Bot) ReplaceStickerInSet(ctx context.Context, request *ReplaceStickerInSetRequest) (r bool, err error)
- func (b *Bot) ReplaceStickerInSetVoid(ctx context.Context, request *ReplaceStickerInSetRequest) error
- func (b *Bot) RestrictChatMember(ctx context.Context, request *RestrictChatMemberRequest) (r bool, err error)
- func (b *Bot) RestrictChatMemberVoid(ctx context.Context, request *RestrictChatMemberRequest) error
- func (b *Bot) RevokeChatInviteLink(ctx context.Context, request *RevokeChatInviteLinkRequest) (r *ChatInviteLink, err error)
- func (b *Bot) RevokeChatInviteLinkVoid(ctx context.Context, request *RevokeChatInviteLinkRequest) error
- func (b *Bot) SavePreparedInlineMessage(ctx context.Context, request *SavePreparedInlineMessageRequest) (r *PreparedInlineMessage, err error)
- func (b *Bot) SavePreparedInlineMessageVoid(ctx context.Context, request *SavePreparedInlineMessageRequest) error
- func (b *Bot) SendAnimation(ctx context.Context, request *SendAnimationRequest) (r *Message, err error)
- func (b *Bot) SendAnimationVoid(ctx context.Context, request *SendAnimationRequest) error
- func (b *Bot) SendAudio(ctx context.Context, request *SendAudioRequest) (r *Message, err error)
- func (b *Bot) SendAudioVoid(ctx context.Context, request *SendAudioRequest) error
- func (b *Bot) SendChatAction(ctx context.Context, request *SendChatActionRequest) (r bool, err error)
- func (b *Bot) SendChatActionVoid(ctx context.Context, request *SendChatActionRequest) error
- func (b *Bot) SendContact(ctx context.Context, request *SendContactRequest) (r *Message, err error)
- func (b *Bot) SendContactVoid(ctx context.Context, request *SendContactRequest) error
- func (b *Bot) SendDice(ctx context.Context, request *SendDiceRequest) (r *Message, err error)
- func (b *Bot) SendDiceVoid(ctx context.Context, request *SendDiceRequest) error
- func (b *Bot) SendDocument(ctx context.Context, request *SendDocumentRequest) (r *Message, err error)
- func (b *Bot) SendDocumentVoid(ctx context.Context, request *SendDocumentRequest) error
- func (b *Bot) SendGame(ctx context.Context, request *SendGameRequest) (r *Message, err error)
- func (b *Bot) SendGameVoid(ctx context.Context, request *SendGameRequest) error
- func (b *Bot) SendGift(ctx context.Context, request *SendGiftRequest) (r bool, err error)
- func (b *Bot) SendGiftVoid(ctx context.Context, request *SendGiftRequest) error
- func (b *Bot) SendInvoice(ctx context.Context, request *SendInvoiceRequest) (r *Message, err error)
- func (b *Bot) SendInvoiceVoid(ctx context.Context, request *SendInvoiceRequest) error
- func (b *Bot) SendLocation(ctx context.Context, request *SendLocationRequest) (r *Message, err error)
- func (b *Bot) SendLocationVoid(ctx context.Context, request *SendLocationRequest) error
- func (b *Bot) SendMediaGroup(ctx context.Context, request *SendMediaGroupRequest) (r []Message, err error)
- func (b *Bot) SendMediaGroupVoid(ctx context.Context, request *SendMediaGroupRequest) error
- func (b *Bot) SendMessage(ctx context.Context, request *SendMessageRequest) (r *Message, err error)
- func (b *Bot) SendMessageVoid(ctx context.Context, request *SendMessageRequest) error
- func (b *Bot) SendPaidMedia(ctx context.Context, request *SendPaidMediaRequest) (r *Message, err error)
- func (b *Bot) SendPaidMediaVoid(ctx context.Context, request *SendPaidMediaRequest) error
- func (b *Bot) SendPhoto(ctx context.Context, request *SendPhotoRequest) (r *Message, err error)
- func (b *Bot) SendPhotoVoid(ctx context.Context, request *SendPhotoRequest) error
- func (b *Bot) SendPoll(ctx context.Context, request *SendPollRequest) (r *Message, err error)
- func (b *Bot) SendPollVoid(ctx context.Context, request *SendPollRequest) error
- func (b *Bot) SendSticker(ctx context.Context, request *SendStickerRequest) (r *Message, err error)
- func (b *Bot) SendStickerVoid(ctx context.Context, request *SendStickerRequest) error
- func (b *Bot) SendVenue(ctx context.Context, request *SendVenueRequest) (r *Message, err error)
- func (b *Bot) SendVenueVoid(ctx context.Context, request *SendVenueRequest) error
- func (b *Bot) SendVideo(ctx context.Context, request *SendVideoRequest) (r *Message, err error)
- func (b *Bot) SendVideoNote(ctx context.Context, request *SendVideoNoteRequest) (r *Message, err error)
- func (b *Bot) SendVideoNoteVoid(ctx context.Context, request *SendVideoNoteRequest) error
- func (b *Bot) SendVideoVoid(ctx context.Context, request *SendVideoRequest) error
- func (b *Bot) SendVoice(ctx context.Context, request *SendVoiceRequest) (r *Message, err error)
- func (b *Bot) SendVoiceVoid(ctx context.Context, request *SendVoiceRequest) error
- func (b *Bot) SetChatAdministratorCustomTitle(ctx context.Context, request *SetChatAdministratorCustomTitleRequest) (r bool, err error)
- func (b *Bot) SetChatAdministratorCustomTitleVoid(ctx context.Context, request *SetChatAdministratorCustomTitleRequest) error
- func (b *Bot) SetChatDescription(ctx context.Context, request *SetChatDescriptionRequest) (r bool, err error)
- func (b *Bot) SetChatDescriptionVoid(ctx context.Context, request *SetChatDescriptionRequest) error
- func (b *Bot) SetChatMenuButton(ctx context.Context, request *SetChatMenuButtonRequest) (r bool, err error)
- func (b *Bot) SetChatMenuButtonVoid(ctx context.Context, request *SetChatMenuButtonRequest) error
- func (b *Bot) SetChatPermissions(ctx context.Context, request *SetChatPermissionsRequest) (r bool, err error)
- func (b *Bot) SetChatPermissionsVoid(ctx context.Context, request *SetChatPermissionsRequest) error
- func (b *Bot) SetChatPhoto(ctx context.Context, request *SetChatPhotoRequest) (r bool, err error)
- func (b *Bot) SetChatPhotoVoid(ctx context.Context, request *SetChatPhotoRequest) error
- func (b *Bot) SetChatStickerSet(ctx context.Context, request *SetChatStickerSetRequest) (r bool, err error)
- func (b *Bot) SetChatStickerSetVoid(ctx context.Context, request *SetChatStickerSetRequest) error
- func (b *Bot) SetChatTitle(ctx context.Context, request *SetChatTitleRequest) (r bool, err error)
- func (b *Bot) SetChatTitleVoid(ctx context.Context, request *SetChatTitleRequest) error
- func (b *Bot) SetCustomEmojiStickerSetThumbnail(ctx context.Context, request *SetCustomEmojiStickerSetThumbnailRequest) (r bool, err error)
- func (b *Bot) SetCustomEmojiStickerSetThumbnailVoid(ctx context.Context, request *SetCustomEmojiStickerSetThumbnailRequest) error
- func (b *Bot) SetGameScore(ctx context.Context, request *SetGameScoreRequest) (r *Message, err error)
- func (b *Bot) SetGameScoreVoid(ctx context.Context, request *SetGameScoreRequest) error
- func (b *Bot) SetMessageReaction(ctx context.Context, request *SetMessageReactionRequest) (r bool, err error)
- func (b *Bot) SetMessageReactionVoid(ctx context.Context, request *SetMessageReactionRequest) error
- func (b *Bot) SetMyCommands(ctx context.Context, request *SetMyCommandsRequest) (r bool, err error)
- func (b *Bot) SetMyCommandsVoid(ctx context.Context, request *SetMyCommandsRequest) error
- func (b *Bot) SetMyDefaultAdministratorRights(ctx context.Context, request *SetMyDefaultAdministratorRightsRequest) (r bool, err error)
- func (b *Bot) SetMyDefaultAdministratorRightsVoid(ctx context.Context, request *SetMyDefaultAdministratorRightsRequest) error
- func (b *Bot) SetMyDescription(ctx context.Context, request *SetMyDescriptionRequest) (r bool, err error)
- func (b *Bot) SetMyDescriptionVoid(ctx context.Context, request *SetMyDescriptionRequest) error
- func (b *Bot) SetMyName(ctx context.Context, request *SetMyNameRequest) (r bool, err error)
- func (b *Bot) SetMyNameVoid(ctx context.Context, request *SetMyNameRequest) error
- func (b *Bot) SetMyShortDescription(ctx context.Context, request *SetMyShortDescriptionRequest) (r bool, err error)
- func (b *Bot) SetMyShortDescriptionVoid(ctx context.Context, request *SetMyShortDescriptionRequest) error
- func (b *Bot) SetPassportDataErrors(ctx context.Context, request *SetPassportDataErrorsRequest) (r bool, err error)
- func (b *Bot) SetPassportDataErrorsVoid(ctx context.Context, request *SetPassportDataErrorsRequest) error
- func (b *Bot) SetStickerEmojiList(ctx context.Context, request *SetStickerEmojiListRequest) (r bool, err error)
- func (b *Bot) SetStickerEmojiListVoid(ctx context.Context, request *SetStickerEmojiListRequest) error
- func (b *Bot) SetStickerKeywords(ctx context.Context, request *SetStickerKeywordsRequest) (r bool, err error)
- func (b *Bot) SetStickerKeywordsVoid(ctx context.Context, request *SetStickerKeywordsRequest) error
- func (b *Bot) SetStickerMaskPosition(ctx context.Context, request *SetStickerMaskPositionRequest) (r bool, err error)
- func (b *Bot) SetStickerMaskPositionVoid(ctx context.Context, request *SetStickerMaskPositionRequest) error
- func (b *Bot) SetStickerPositionInSet(ctx context.Context, request *SetStickerPositionInSetRequest) (r bool, err error)
- func (b *Bot) SetStickerPositionInSetVoid(ctx context.Context, request *SetStickerPositionInSetRequest) error
- func (b *Bot) SetStickerSetThumbnail(ctx context.Context, request *SetStickerSetThumbnailRequest) (r bool, err error)
- func (b *Bot) SetStickerSetThumbnailVoid(ctx context.Context, request *SetStickerSetThumbnailRequest) error
- func (b *Bot) SetStickerSetTitle(ctx context.Context, request *SetStickerSetTitleRequest) (r bool, err error)
- func (b *Bot) SetStickerSetTitleVoid(ctx context.Context, request *SetStickerSetTitleRequest) error
- func (b *Bot) SetUserEmojiStatus(ctx context.Context, request *SetUserEmojiStatusRequest) (r bool, err error)
- func (b *Bot) SetUserEmojiStatusVoid(ctx context.Context, request *SetUserEmojiStatusRequest) error
- func (b *Bot) SetWebhook(ctx context.Context, request *SetWebhookRequest) (r bool, err error)
- func (b *Bot) SetWebhookVoid(ctx context.Context, request *SetWebhookRequest) error
- func (b *Bot) StopMessageLiveLocation(ctx context.Context, request *StopMessageLiveLocationRequest) (r *Message, err error)
- func (b *Bot) StopMessageLiveLocationVoid(ctx context.Context, request *StopMessageLiveLocationRequest) error
- func (b *Bot) StopPoll(ctx context.Context, request *StopPollRequest) (r *Poll, err error)
- func (b *Bot) StopPollVoid(ctx context.Context, request *StopPollRequest) error
- func (b *Bot) UnbanChatMember(ctx context.Context, request *UnbanChatMemberRequest) (r bool, err error)
- func (b *Bot) UnbanChatMemberVoid(ctx context.Context, request *UnbanChatMemberRequest) error
- func (b *Bot) UnbanChatSenderChat(ctx context.Context, request *UnbanChatSenderChatRequest) (r bool, err error)
- func (b *Bot) UnbanChatSenderChatVoid(ctx context.Context, request *UnbanChatSenderChatRequest) error
- func (b *Bot) UnhideGeneralForumTopic(ctx context.Context, request *UnhideGeneralForumTopicRequest) (r bool, err error)
- func (b *Bot) UnhideGeneralForumTopicVoid(ctx context.Context, request *UnhideGeneralForumTopicRequest) error
- func (b *Bot) UnpinAllChatMessages(ctx context.Context, request *UnpinAllChatMessagesRequest) (r bool, err error)
- func (b *Bot) UnpinAllChatMessagesVoid(ctx context.Context, request *UnpinAllChatMessagesRequest) error
- func (b *Bot) UnpinAllForumTopicMessages(ctx context.Context, request *UnpinAllForumTopicMessagesRequest) (r bool, err error)
- func (b *Bot) UnpinAllForumTopicMessagesVoid(ctx context.Context, request *UnpinAllForumTopicMessagesRequest) error
- func (b *Bot) UnpinAllGeneralForumTopicMessages(ctx context.Context, request *UnpinAllGeneralForumTopicMessagesRequest) (r bool, err error)
- func (b *Bot) UnpinAllGeneralForumTopicMessagesVoid(ctx context.Context, request *UnpinAllGeneralForumTopicMessagesRequest) error
- func (b *Bot) UnpinChatMessage(ctx context.Context, request *UnpinChatMessageRequest) (r bool, err error)
- func (b *Bot) UnpinChatMessageVoid(ctx context.Context, request *UnpinChatMessageRequest) error
- func (b *Bot) UploadStickerFile(ctx context.Context, request *UploadStickerFileRequest) (r *File, err error)
- func (b *Bot) UploadStickerFileVoid(ctx context.Context, request *UploadStickerFileRequest) error
- func (b *Bot) VerifyChat(ctx context.Context, request *VerifyChatRequest) (r bool, err error)
- func (b *Bot) VerifyChatVoid(ctx context.Context, request *VerifyChatRequest) error
- func (b *Bot) VerifyUser(ctx context.Context, request *VerifyUserRequest) (r bool, err error)
- func (b *Bot) VerifyUserVoid(ctx context.Context, request *VerifyUserRequest) error
- type BotCommand
- type BotCommandScope
- type BotDescription
- type BotName
- type BotOptions
- type BotShortDescription
- type BusinessConnection
- type BusinessIntro
- type BusinessLocation
- type BusinessMessagesDeleted
- type BusinessOpeningHours
- type BusinessOpeningHoursInterval
- type CallbackGame
- type CallbackQuery
- type Chat
- type ChatAction
- type ChatAdministratorRights
- type ChatBackground
- type ChatBoost
- type ChatBoostAdded
- type ChatBoostRemoved
- type ChatBoostSource
- type ChatBoostUpdated
- type ChatFullInfo
- type ChatID
- type ChatInviteLink
- type ChatJoinRequest
- type ChatLocation
- type ChatMember
- type ChatMemberUpdated
- type ChatPermissions
- type ChatPhoto
- type ChatShared
- type ChatType
- type ChosenInlineResult
- type CloseForumTopicRequest
- type CloseGeneralForumTopicRequest
- type Contact
- type CopyMessageRequest
- type CopyMessagesRequest
- type CopyTextButton
- type CreateChatInviteLinkRequest
- type CreateChatSubscriptionInviteLinkRequest
- type CreateForumTopicRequest
- type CreateInvoiceLinkRequest
- type CreateNewStickerSetRequest
- type DeclineChatJoinRequest
- type DeleteChatPhotoRequest
- type DeleteChatStickerSetRequest
- type DeleteForumTopicRequest
- type DeleteMessageRequest
- type DeleteMessagesRequest
- type DeleteMyCommandsRequest
- type DeleteStickerFromSetRequest
- type DeleteStickerSetRequest
- type DeleteWebhookRequest
- type Dice
- type Document
- type EditChatInviteLinkRequest
- type EditChatSubscriptionInviteLinkRequest
- type EditForumTopicRequest
- type EditGeneralForumTopicRequest
- type EditMessageCaptionRequest
- type EditMessageLiveLocationRequest
- type EditMessageMediaRequest
- type EditMessageReplyMarkupRequest
- type EditMessageTextRequest
- type EditUserStarSubscriptionRequest
- type EncryptedCredentials
- type EncryptedPassportElement
- type ErrDownloadFile
- type ExportChatInviteLinkRequest
- type ExternalReplyInfo
- type File
- type ForceReply
- type ForumTopic
- type ForumTopicClosed
- type ForumTopicCreated
- type ForumTopicEdited
- type ForumTopicReopened
- type ForwardMessageRequest
- type ForwardMessagesRequest
- type Game
- type GameHighScore
- type GeneralForumTopicHidden
- type GeneralForumTopicUnhidden
- type GetBusinessConnectionRequest
- type GetChatAdministratorsRequest
- type GetChatMemberCountRequest
- type GetChatMemberRequest
- type GetChatMenuButtonRequest
- type GetChatRequest
- type GetCustomEmojiStickersRequest
- type GetFileRequest
- type GetGameHighScoresRequest
- type GetMyCommandsRequest
- type GetMyDefaultAdministratorRightsRequest
- type GetMyDescriptionRequest
- type GetMyNameRequest
- type GetMyShortDescriptionRequest
- type GetStarTransactionsRequest
- type GetStickerSetRequest
- type GetUpdatesRequest
- type GetUserChatBoostsRequest
- type GetUserProfilePhotosRequest
- type Gift
- type Gifts
- type Giveaway
- type GiveawayCompleted
- type GiveawayCreated
- type GiveawayWinners
- type HideGeneralForumTopicRequest
- type InlineKeyboardButton
- type InlineKeyboardMarkup
- type InlineQuery
- type InlineQueryChatType
- 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 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 InputSticker
- type InputTextMessageContent
- type InputVenueMessageContent
- type Invoice
- type KeyboardButton
- type KeyboardButtonPollType
- type KeyboardButtonRequestChat
- type KeyboardButtonRequestUsers
- type LabeledPrice
- type LeaveChatRequest
- type LinkPreviewOptions
- type Location
- type LoginUrl
- type LongPollUpdatesOptions
- type Markup
- type MaskPosition
- type MenuButton
- type Message
- type MessageAutoDeleteTimerChanged
- type MessageEntity
- type MessageEntityType
- type MessageId
- type MessageOrigin
- type MessageReactionCountUpdated
- type MessageReactionUpdated
- type NameReader
- type NamedReader
- type OrderInfo
- type PaidMedia
- type PaidMediaInfo
- type PaidMediaPurchased
- type ParseMode
- type PassportData
- type PassportElementError
- type PassportFile
- type PhotoSize
- type PinChatMessageRequest
- type Poll
- type PollAnswer
- type PollOption
- type PreCheckoutQuery
- type PreparedInlineMessage
- type PromoteChatMemberRequest
- type ProximityAlertTriggered
- type ReactionCount
- type ReactionType
- type RefundStarPaymentRequest
- type RefundedPayment
- type RemoveChatVerificationRequest
- type RemoveUserVerificationRequest
- type ReopenForumTopicRequest
- type ReopenGeneralForumTopicRequest
- type ReplaceStickerInSetRequest
- type ReplyKeyboardMarkup
- type ReplyKeyboardRemove
- type ReplyParameters
- type ResponseParameters
- type RestrictChatMemberRequest
- type RevenueWithdrawalState
- type RevokeChatInviteLinkRequest
- type SavePreparedInlineMessageRequest
- type SendAnimationRequest
- type SendAudioRequest
- type SendChatActionRequest
- type SendContactRequest
- type SendDiceRequest
- type SendDocumentRequest
- type SendGameRequest
- type SendGiftRequest
- type SendInvoiceRequest
- type SendLocationRequest
- type SendMediaGroupRequest
- type SendMessageRequest
- type SendPaidMediaRequest
- type SendPhotoRequest
- type SendPollRequest
- type SendStickerRequest
- type SendVenueRequest
- type SendVideoNoteRequest
- type SendVideoRequest
- type SendVoiceRequest
- type SentWebAppMessage
- type SetChatAdministratorCustomTitleRequest
- type SetChatDescriptionRequest
- type SetChatMenuButtonRequest
- type SetChatPermissionsRequest
- type SetChatPhotoRequest
- type SetChatStickerSetRequest
- type SetChatTitleRequest
- type SetCustomEmojiStickerSetThumbnailRequest
- type SetGameScoreRequest
- type SetMessageReactionRequest
- type SetMyCommandsRequest
- type SetMyDefaultAdministratorRightsRequest
- type SetMyDescriptionRequest
- type SetMyNameRequest
- type SetMyShortDescriptionRequest
- type SetPassportDataErrorsRequest
- type SetStickerEmojiListRequest
- type SetStickerKeywordsRequest
- type SetStickerMaskPositionRequest
- type SetStickerPositionInSetRequest
- type SetStickerSetThumbnailRequest
- type SetStickerSetTitleRequest
- type SetUserEmojiStatusRequest
- type SetWebhookRequest
- type SharedUser
- type ShippingAddress
- type ShippingOption
- type ShippingQuery
- type StarTransaction
- type StarTransactions
- type Sticker
- type StickerSet
- type StopMessageLiveLocationRequest
- type StopPollRequest
- type Story
- type SuccessfulPayment
- type SwitchInlineQueryChosenChat
- type TextQuote
- type TransactionPartner
- type UnbanChatMemberRequest
- type UnbanChatSenderChatRequest
- type UnhideGeneralForumTopicRequest
- type UnpinAllChatMessagesRequest
- type UnpinAllForumTopicMessagesRequest
- type UnpinAllGeneralForumTopicMessagesRequest
- type UnpinChatMessageRequest
- type Update
- type UpdateType
- type UploadStickerFileRequest
- type User
- type UserChatBoosts
- type UserProfilePhotos
- type UsersShared
- type Venue
- type VerifyChatRequest
- type VerifyUserRequest
- type Video
- type VideoChatEnded
- type VideoChatParticipantsInvited
- type VideoChatScheduled
- type VideoChatStarted
- type VideoNote
- type Voice
- type WebAppData
- type WebAppInfo
- type WebhookInfo
- type WriteAccessAllowed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LongPollUpdates ¶
func LongPollUpdates( ctx context.Context, bot *Bot, options *LongPollUpdatesOptions, ) chan []Update
Polls updates via calling Bot.GetUpdates() in a loop. Streams []Update instead of just Update because it enables better media group handling.
This function will panic on conflict (webhook set or another instance calling getUpdates).
Types ¶
type APIError ¶
type APIError struct { Method string // Called API method Description string ErrorCode int Parameters *ResponseParameters }
Represents Telegram API error
type AddStickerToSetRequest ¶
type AddStickerToSetRequest struct { UserID int64 `json:"user_id"` // User identifier of sticker set owner Name string `json:"name"` // Sticker set name Sticker *InputSticker `json:"sticker"` // A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed. }
see Bot.AddStickerToSet(ctx, &AddStickerToSetRequest{})
type AffiliateInfo ¶
type AffiliateInfo struct { AffiliateUser *User `json:"affiliate_user,omitempty"` // Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user AffiliateChat *Chat `json:"affiliate_chat,omitempty"` // Optional. The chat that received an affiliate commission if it was received by a chat CommissionPerMille int `json:"commission_per_mille"` // The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users Amount int `json:"amount"` // Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds NanostarAmount int `json:"nanostar_amount,omitempty"` // Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds }
Contains information about the affiliate that received a commission via this transaction.
type Animation ¶
type Animation struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Width int `json:"width"` // Video width as defined by the sender Height int `json:"height"` // Video height as defined by the sender Duration int `json:"duration"` // Duration of the video in seconds as defined by the sender Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Animation thumbnail as defined by the sender FileName string `json:"file_name,omitempty"` // Optional. Original animation filename as defined by the sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender FileSize int `json:"file_size,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. }
This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
type AnswerCallbackQueryRequest ¶
type AnswerCallbackQueryRequest struct { CallbackQueryID string `json:"callback_query_id"` // Unique identifier for the query to be answered Text string `json:"text,omitempty"` // Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters ShowAlert bool `json:"show_alert,omitempty"` // If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. Url string `json:"url,omitempty"` // URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. CacheTime int `json:"cache_time,omitempty"` // The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. }
see Bot.AnswerCallbackQuery(ctx, &AnswerCallbackQueryRequest{})
type AnswerInlineQueryRequest ¶
type AnswerInlineQueryRequest struct { InlineQueryID string `json:"inline_query_id"` // Unique identifier for the answered query Results []InlineQueryResult `json:"results"` // A JSON-serialized array of results for the inline query CacheTime int `json:"cache_time,omitempty"` // The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. IsPersonal bool `json:"is_personal,omitempty"` // Pass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query. NextOffset string `json:"next_offset,omitempty"` // Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes. Button *InlineQueryResultsButton `json:"button,omitempty"` // A JSON-serialized object describing a button to be shown above inline query results }
see Bot.AnswerInlineQuery(ctx, &AnswerInlineQueryRequest{})
type AnswerPreCheckoutQueryRequest ¶
type AnswerPreCheckoutQueryRequest struct { PreCheckoutQueryID string `json:"pre_checkout_query_id"` // Unique identifier for the query to be answered Ok bool `json:"ok"` // Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. ErrorMessage string `json:"error_message,omitempty"` // Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. }
see Bot.AnswerPreCheckoutQuery(ctx, &AnswerPreCheckoutQueryRequest{})
type AnswerShippingQueryRequest ¶
type AnswerShippingQueryRequest struct { ShippingQueryID string `json:"shipping_query_id"` // Unique identifier for the query to be answered Ok bool `json:"ok"` // Pass True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) ShippingOptions []ShippingOption `json:"shipping_options,omitempty"` // Required if ok is True. A JSON-serialized array of available shipping options. ErrorMessage string `json:"error_message,omitempty"` // Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable"). Telegram will display this message to the user. }
see Bot.AnswerShippingQuery(ctx, &AnswerShippingQueryRequest{})
type AnswerWebAppQueryRequest ¶
type AnswerWebAppQueryRequest struct { WebAppQueryID string `json:"web_app_query_id"` // Unique identifier for the query to be answered Result InlineQueryResult `json:"result"` // A JSON-serialized object describing the message to be sent }
see Bot.AnswerWebAppQuery(ctx, &AnswerWebAppQueryRequest{})
type ApproveChatJoinRequest ¶ added in v0.0.8
type ApproveChatJoinRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user }
see Bot.ApproveChatJoinRequest(ctx, &ApproveChatJoinRequest{})
type Audio ¶
type Audio struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Duration int `json:"duration"` // Duration of the audio in seconds as defined by the sender Performer string `json:"performer,omitempty"` // Optional. Performer of the audio as defined by the sender or by audio tags Title string `json:"title,omitempty"` // Optional. Title of the audio as defined by the sender or by audio tags FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by the sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender FileSize int `json:"file_size,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. Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Thumbnail of the album cover to which the music file belongs }
This object represents an audio file to be treated as music by the Telegram clients.
type BackgroundFill ¶
type BackgroundFill struct { Type string `json:"type"` Color int `json:"color"` // The color of the background fill in the RGB24 format TopColor int `json:"top_color"` // Top color of the gradient in the RGB24 format BottomColor int `json:"bottom_color"` // Bottom color of the gradient in the RGB24 format RotationAngle int `json:"rotation_angle"` // Clockwise rotation angle of the background fill in degrees; 0-359 Colors []int `json:"colors"` // A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format }
This object describes the way a background is filled based on the selected colors. Currently, it can be one of
- BackgroundFillSolid
- BackgroundFillGradient
- BackgroundFillFreeformGradient
type BackgroundType ¶
type BackgroundType struct { Type string `json:"type"` Fill *BackgroundFill `json:"fill"` // The background fill DarkThemeDimming int `json:"dark_theme_dimming"` // Dimming of the background in dark themes, as a percentage; 0-100 Document *Document `json:"document"` // Document with the wallpaper IsBlurred bool `json:"is_blurred,omitempty"` // Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 IsMoving bool `json:"is_moving,omitempty"` // Optional. True, if the background moves slightly when the device is tilted Intensity int `json:"intensity"` // Intensity of the pattern when it is shown above the filled background; 0-100 IsInverted bool `json:"is_inverted,omitempty"` // 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 ThemeName string `json:"theme_name"` // Name of the chat theme, which is usually an emoji }
This object describes the type of a background. Currently, it can be one of
- BackgroundTypeFill
- BackgroundTypeWallpaper
- BackgroundTypePattern
- BackgroundTypeChatTheme
type BanChatMemberRequest ¶
type BanChatMemberRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user UntilDate int `json:"until_date,omitempty"` // Date when the user will be unbanned; Unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. RevokeMessages bool `json:"revoke_messages,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. }
see Bot.BanChatMember(ctx, &BanChatMemberRequest{})
type BanChatSenderChatRequest ¶
type BanChatSenderChatRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) SenderChatID int64 `json:"sender_chat_id"` // Unique identifier of the target sender chat }
see Bot.BanChatSenderChat(ctx, &BanChatSenderChatRequest{})
type Birthdate ¶
type Birthdate struct { Day int `json:"day"` // Day of the user's birth; 1-31 Month int `json:"month"` // Month of the user's birth; 1-12 Year int `json:"year,omitempty"` // Optional. Year of the user's birth }
Describes the birthdate of a user.
type Bot ¶
type Bot struct {
// contains filtered or unexported fields
}
Holds all methods of Telegram Bot API.
For example: Bot.SendMessage()
If a method call fails, it can return *goram.APIError as the second return value. The returned error can be checked whether it's an API error as easy as:
apiError, ok := err.(*goram.APIError)
func NewBot ¶
func NewBot(options BotOptions) *Bot
func (*Bot) AddStickerToSet ¶
func (b *Bot) AddStickerToSet(ctx context.Context, request *AddStickerToSetRequest) (r bool, err error)
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 (*Bot) AddStickerToSetVoid ¶ added in v0.0.22
func (b *Bot) AddStickerToSetVoid(ctx context.Context, request *AddStickerToSetRequest) error
Does the same as Bot.AddStickerToSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) AnswerCallbackQuery ¶
func (b *Bot) AnswerCallbackQuery(ctx context.Context, request *AnswerCallbackQueryRequest) (r bool, err error)
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
func (*Bot) AnswerCallbackQueryVoid ¶ added in v0.0.22
func (b *Bot) AnswerCallbackQueryVoid(ctx context.Context, request *AnswerCallbackQueryRequest) error
Does the same as Bot.AnswerCallbackQuery, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) AnswerInlineQuery ¶
func (b *Bot) AnswerInlineQuery(ctx context.Context, request *AnswerInlineQueryRequest) (r bool, err error)
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.
func (*Bot) AnswerInlineQueryVoid ¶ added in v0.0.22
func (b *Bot) AnswerInlineQueryVoid(ctx context.Context, request *AnswerInlineQueryRequest) error
Does the same as Bot.AnswerInlineQuery, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) AnswerPreCheckoutQuery ¶
func (b *Bot) AnswerPreCheckoutQuery(ctx context.Context, request *AnswerPreCheckoutQueryRequest) (r bool, err error)
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
func (*Bot) AnswerPreCheckoutQueryVoid ¶ added in v0.0.22
func (b *Bot) AnswerPreCheckoutQueryVoid(ctx context.Context, request *AnswerPreCheckoutQueryRequest) error
Does the same as Bot.AnswerPreCheckoutQuery, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) AnswerShippingQuery ¶
func (b *Bot) AnswerShippingQuery(ctx context.Context, request *AnswerShippingQueryRequest) (r bool, err error)
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
func (*Bot) AnswerShippingQueryVoid ¶ added in v0.0.22
func (b *Bot) AnswerShippingQueryVoid(ctx context.Context, request *AnswerShippingQueryRequest) error
Does the same as Bot.AnswerShippingQuery, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) AnswerWebAppQuery ¶
func (b *Bot) AnswerWebAppQuery(ctx context.Context, request *AnswerWebAppQueryRequest) (r *SentWebAppMessage, err error)
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 (*Bot) AnswerWebAppQueryVoid ¶ added in v0.0.22
func (b *Bot) AnswerWebAppQueryVoid(ctx context.Context, request *AnswerWebAppQueryRequest) error
Does the same as Bot.AnswerWebAppQuery, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ApproveChatJoinRequest ¶
func (b *Bot) ApproveChatJoinRequest(ctx context.Context, request *ApproveChatJoinRequest) (r bool, err error)
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 (*Bot) ApproveChatJoinRequestVoid ¶ added in v0.0.22
func (b *Bot) ApproveChatJoinRequestVoid(ctx context.Context, request *ApproveChatJoinRequest) error
Does the same as Bot.ApproveChatJoinRequest, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) BanChatMember ¶
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 (*Bot) BanChatMemberVoid ¶ added in v0.0.22
func (b *Bot) BanChatMemberVoid(ctx context.Context, request *BanChatMemberRequest) error
Does the same as Bot.BanChatMember, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) BanChatSenderChat ¶
func (b *Bot) BanChatSenderChat(ctx context.Context, request *BanChatSenderChatRequest) (r bool, err error)
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 (*Bot) BanChatSenderChatVoid ¶ added in v0.0.22
func (b *Bot) BanChatSenderChatVoid(ctx context.Context, request *BanChatSenderChatRequest) error
Does the same as Bot.BanChatSenderChat, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) Close ¶
Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
func (*Bot) CloseForumTopic ¶
func (b *Bot) CloseForumTopic(ctx context.Context, request *CloseForumTopicRequest) (r bool, err error)
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 (*Bot) CloseForumTopicVoid ¶ added in v0.0.22
func (b *Bot) CloseForumTopicVoid(ctx context.Context, request *CloseForumTopicRequest) error
Does the same as Bot.CloseForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CloseGeneralForumTopic ¶
func (b *Bot) CloseGeneralForumTopic(ctx context.Context, request *CloseGeneralForumTopicRequest) (r bool, err error)
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 (*Bot) CloseGeneralForumTopicVoid ¶ added in v0.0.22
func (b *Bot) CloseGeneralForumTopicVoid(ctx context.Context, request *CloseGeneralForumTopicRequest) error
Does the same as Bot.CloseGeneralForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CopyMessage ¶
func (b *Bot) CopyMessage(ctx context.Context, request *CopyMessageRequest) (r *MessageId, err error)
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 (*Bot) CopyMessageVoid ¶ added in v0.0.22
func (b *Bot) CopyMessageVoid(ctx context.Context, request *CopyMessageRequest) error
Does the same as Bot.CopyMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CopyMessages ¶
func (b *Bot) CopyMessages(ctx context.Context, request *CopyMessagesRequest) (r []MessageId, err error)
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 (*Bot) CopyMessagesVoid ¶ added in v0.0.22
func (b *Bot) CopyMessagesVoid(ctx context.Context, request *CopyMessagesRequest) error
Does the same as Bot.CopyMessages, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CreateChatInviteLink ¶
func (b *Bot) CreateChatInviteLink(ctx context.Context, request *CreateChatInviteLinkRequest) (r *ChatInviteLink, err error)
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 (*Bot) CreateChatInviteLinkVoid ¶ added in v0.0.22
func (b *Bot) CreateChatInviteLinkVoid(ctx context.Context, request *CreateChatInviteLinkRequest) error
Does the same as Bot.CreateChatInviteLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CreateChatSubscriptionInviteLink ¶
func (b *Bot) CreateChatSubscriptionInviteLink(ctx context.Context, request *CreateChatSubscriptionInviteLinkRequest) (r *ChatInviteLink, err error)
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.
https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
func (*Bot) CreateChatSubscriptionInviteLinkVoid ¶ added in v0.0.22
func (b *Bot) CreateChatSubscriptionInviteLinkVoid(ctx context.Context, request *CreateChatSubscriptionInviteLinkRequest) error
Does the same as Bot.CreateChatSubscriptionInviteLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CreateForumTopic ¶
func (b *Bot) CreateForumTopic(ctx context.Context, request *CreateForumTopicRequest) (r *ForumTopic, err error)
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
func (*Bot) CreateForumTopicVoid ¶ added in v0.0.22
func (b *Bot) CreateForumTopicVoid(ctx context.Context, request *CreateForumTopicRequest) error
Does the same as Bot.CreateForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CreateInvoiceLink ¶
func (b *Bot) CreateInvoiceLink(ctx context.Context, request *CreateInvoiceLinkRequest) (r string, err error)
Use this method to create a link for an invoice. Returns the created invoice link as String on success.
func (*Bot) CreateInvoiceLinkVoid ¶ added in v0.0.22
func (b *Bot) CreateInvoiceLinkVoid(ctx context.Context, request *CreateInvoiceLinkRequest) error
Does the same as Bot.CreateInvoiceLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) CreateNewStickerSet ¶
func (b *Bot) CreateNewStickerSet(ctx context.Context, request *CreateNewStickerSetRequest) (r bool, err error)
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.
func (*Bot) CreateNewStickerSetVoid ¶ added in v0.0.22
func (b *Bot) CreateNewStickerSetVoid(ctx context.Context, request *CreateNewStickerSetRequest) error
Does the same as Bot.CreateNewStickerSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeclineChatJoinRequest ¶
func (b *Bot) DeclineChatJoinRequest(ctx context.Context, request *DeclineChatJoinRequest) (r bool, err error)
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 (*Bot) DeclineChatJoinRequestVoid ¶ added in v0.0.22
func (b *Bot) DeclineChatJoinRequestVoid(ctx context.Context, request *DeclineChatJoinRequest) error
Does the same as Bot.DeclineChatJoinRequest, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteChatPhoto ¶
func (b *Bot) DeleteChatPhoto(ctx context.Context, request *DeleteChatPhotoRequest) (r bool, err error)
Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*Bot) DeleteChatPhotoVoid ¶ added in v0.0.22
func (b *Bot) DeleteChatPhotoVoid(ctx context.Context, request *DeleteChatPhotoRequest) error
Does the same as Bot.DeleteChatPhoto, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteChatStickerSet ¶
func (b *Bot) DeleteChatStickerSet(ctx context.Context, request *DeleteChatStickerSetRequest) (r bool, err error)
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate 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 (*Bot) DeleteChatStickerSetVoid ¶ added in v0.0.22
func (b *Bot) DeleteChatStickerSetVoid(ctx context.Context, request *DeleteChatStickerSetRequest) error
Does the same as Bot.DeleteChatStickerSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteForumTopic ¶
func (b *Bot) DeleteForumTopic(ctx context.Context, request *DeleteForumTopicRequest) (r bool, err error)
Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
func (*Bot) DeleteForumTopicVoid ¶ added in v0.0.22
func (b *Bot) DeleteForumTopicVoid(ctx context.Context, request *DeleteForumTopicRequest) error
Does the same as Bot.DeleteForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteMessage ¶
Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- 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 permission in a supergroup or a channel, it can delete any message there.
Returns True on success.
func (*Bot) DeleteMessageVoid ¶ added in v0.0.22
func (b *Bot) DeleteMessageVoid(ctx context.Context, request *DeleteMessageRequest) error
Does the same as Bot.DeleteMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteMessages ¶
func (b *Bot) DeleteMessages(ctx context.Context, request *DeleteMessagesRequest) (r bool, err error)
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 (*Bot) DeleteMessagesVoid ¶ added in v0.0.22
func (b *Bot) DeleteMessagesVoid(ctx context.Context, request *DeleteMessagesRequest) error
Does the same as Bot.DeleteMessages, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteMyCommands ¶
func (b *Bot) DeleteMyCommands(ctx context.Context, request *DeleteMyCommandsRequest) (r bool, err error)
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 (*Bot) DeleteMyCommandsVoid ¶ added in v0.0.22
func (b *Bot) DeleteMyCommandsVoid(ctx context.Context, request *DeleteMyCommandsRequest) error
Does the same as Bot.DeleteMyCommands, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteStickerFromSet ¶
func (b *Bot) DeleteStickerFromSet(ctx context.Context, request *DeleteStickerFromSetRequest) (r bool, err error)
Use this method to delete a sticker from a set created by the bot. Returns True on success.
func (*Bot) DeleteStickerFromSetVoid ¶ added in v0.0.22
func (b *Bot) DeleteStickerFromSetVoid(ctx context.Context, request *DeleteStickerFromSetRequest) error
Does the same as Bot.DeleteStickerFromSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteStickerSet ¶
func (b *Bot) DeleteStickerSet(ctx context.Context, request *DeleteStickerSetRequest) (r bool, err error)
Use this method to delete a sticker set that was created by the bot. Returns True on success.
func (*Bot) DeleteStickerSetVoid ¶ added in v0.0.22
func (b *Bot) DeleteStickerSetVoid(ctx context.Context, request *DeleteStickerSetRequest) error
Does the same as Bot.DeleteStickerSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DeleteWebhook ¶
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
func (*Bot) DeleteWebhookVoid ¶ added in v0.0.22
func (b *Bot) DeleteWebhookVoid(ctx context.Context, request *DeleteWebhookRequest) error
Does the same as Bot.DeleteWebhook, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) DownloadFile ¶
Downloads a file by file id using provided or default http client. Writes response to dst and returns amount of bytes written and an error. This function does not close or seek the provided writer.
If download http response status != 200, returns ErrDownloadFile
func (*Bot) EditChatInviteLink ¶
func (b *Bot) EditChatInviteLink(ctx context.Context, request *EditChatInviteLinkRequest) (r *ChatInviteLink, err error)
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 (*Bot) EditChatInviteLinkVoid ¶ added in v0.0.22
func (b *Bot) EditChatInviteLinkVoid(ctx context.Context, request *EditChatInviteLinkRequest) error
Does the same as Bot.EditChatInviteLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditChatSubscriptionInviteLink ¶
func (b *Bot) EditChatSubscriptionInviteLink(ctx context.Context, request *EditChatSubscriptionInviteLinkRequest) (r *ChatInviteLink, err error)
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.
https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
func (*Bot) EditChatSubscriptionInviteLinkVoid ¶ added in v0.0.22
func (b *Bot) EditChatSubscriptionInviteLinkVoid(ctx context.Context, request *EditChatSubscriptionInviteLinkRequest) error
Does the same as Bot.EditChatSubscriptionInviteLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditForumTopic ¶
func (b *Bot) EditForumTopic(ctx context.Context, request *EditForumTopicRequest) (r bool, err error)
Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
func (*Bot) EditForumTopicVoid ¶ added in v0.0.22
func (b *Bot) EditForumTopicVoid(ctx context.Context, request *EditForumTopicRequest) error
Does the same as Bot.EditForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditGeneralForumTopic ¶
func (b *Bot) EditGeneralForumTopic(ctx context.Context, request *EditGeneralForumTopicRequest) (r bool, err error)
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 (*Bot) EditGeneralForumTopicVoid ¶ added in v0.0.22
func (b *Bot) EditGeneralForumTopicVoid(ctx context.Context, request *EditGeneralForumTopicRequest) error
Does the same as Bot.EditGeneralForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditMessageCaption ¶
func (b *Bot) EditMessageCaption(ctx context.Context, request *EditMessageCaptionRequest) (r *Message, err error)
Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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 (*Bot) EditMessageCaptionVoid ¶ added in v0.0.22
func (b *Bot) EditMessageCaptionVoid(ctx context.Context, request *EditMessageCaptionRequest) error
Does the same as Bot.EditMessageCaption, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditMessageLiveLocation ¶
func (b *Bot) EditMessageLiveLocation(ctx context.Context, request *EditMessageLiveLocationRequest) (r *Message, err error)
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
func (*Bot) EditMessageLiveLocationVoid ¶ added in v0.0.22
func (b *Bot) EditMessageLiveLocationVoid(ctx context.Context, request *EditMessageLiveLocationRequest) error
Does the same as Bot.EditMessageLiveLocation, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditMessageMedia ¶
func (b *Bot) EditMessageMedia(ctx context.Context, request *EditMessageMediaRequest) (r *Message, err error)
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 (*Bot) EditMessageMediaVoid ¶ added in v0.0.22
func (b *Bot) EditMessageMediaVoid(ctx context.Context, request *EditMessageMediaRequest) error
Does the same as Bot.EditMessageMedia, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditMessageReplyMarkup ¶
func (b *Bot) EditMessageReplyMarkup(ctx context.Context, request *EditMessageReplyMarkupRequest) (r *Message, err error)
Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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 (*Bot) EditMessageReplyMarkupVoid ¶ added in v0.0.22
func (b *Bot) EditMessageReplyMarkupVoid(ctx context.Context, request *EditMessageReplyMarkupRequest) error
Does the same as Bot.EditMessageReplyMarkup, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditMessageText ¶
func (b *Bot) EditMessageText(ctx context.Context, request *EditMessageTextRequest) (r *Message, err error)
Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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 (*Bot) EditMessageTextVoid ¶ added in v0.0.22
func (b *Bot) EditMessageTextVoid(ctx context.Context, request *EditMessageTextRequest) error
Does the same as Bot.EditMessageText, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) EditUserStarSubscription ¶
func (b *Bot) EditUserStarSubscription(ctx context.Context, request *EditUserStarSubscriptionRequest) (r bool, err error)
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.
func (*Bot) EditUserStarSubscriptionVoid ¶ added in v0.0.22
func (b *Bot) EditUserStarSubscriptionVoid(ctx context.Context, request *EditUserStarSubscriptionRequest) error
Does the same as Bot.EditUserStarSubscription, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ExportChatInviteLink ¶
func (b *Bot) ExportChatInviteLink(ctx context.Context, request *ExportChatInviteLinkRequest) (r string, err error)
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 (*Bot) ExportChatInviteLinkVoid ¶ added in v0.0.22
func (b *Bot) ExportChatInviteLinkVoid(ctx context.Context, request *ExportChatInviteLinkRequest) error
Does the same as Bot.ExportChatInviteLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ForwardMessage ¶
func (b *Bot) ForwardMessage(ctx context.Context, request *ForwardMessageRequest) (r *Message, err error)
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 (*Bot) ForwardMessageVoid ¶ added in v0.0.22
func (b *Bot) ForwardMessageVoid(ctx context.Context, request *ForwardMessageRequest) error
Does the same as Bot.ForwardMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ForwardMessages ¶
func (b *Bot) ForwardMessages(ctx context.Context, request *ForwardMessagesRequest) (r []MessageId, err error)
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 (*Bot) ForwardMessagesVoid ¶ added in v0.0.22
func (b *Bot) ForwardMessagesVoid(ctx context.Context, request *ForwardMessagesRequest) error
Does the same as Bot.ForwardMessages, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) GetAvailableGifts ¶
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 (*Bot) GetBusinessConnection ¶
func (b *Bot) GetBusinessConnection(ctx context.Context, request *GetBusinessConnectionRequest) (r *BusinessConnection, err error)
Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
func (*Bot) GetChat ¶
func (b *Bot) GetChat(ctx context.Context, request *GetChatRequest) (r *ChatFullInfo, err error)
Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success.
func (*Bot) GetChatAdministrators ¶
func (b *Bot) GetChatAdministrators(ctx context.Context, request *GetChatAdministratorsRequest) (r []ChatMember, err error)
Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.
func (*Bot) GetChatMember ¶
func (b *Bot) GetChatMember(ctx context.Context, request *GetChatMemberRequest) (r *ChatMember, err error)
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 (*Bot) GetChatMemberCount ¶
func (b *Bot) GetChatMemberCount(ctx context.Context, request *GetChatMemberCountRequest) (r int, err error)
Use this method to get the number of members in a chat. Returns Int on success.
func (*Bot) GetChatMenuButton ¶
func (b *Bot) GetChatMenuButton(ctx context.Context, request *GetChatMenuButtonRequest) (r *MenuButton, err error)
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 (*Bot) GetCustomEmojiStickers ¶
func (b *Bot) GetCustomEmojiStickers(ctx context.Context, request *GetCustomEmojiStickersRequest) (r []Sticker, err error)
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
func (*Bot) GetFile ¶
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 (*Bot) GetForumTopicIconStickers ¶
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.
https://core.telegram.org/bots/api#getforumtopiciconstickers
func (*Bot) GetGameHighScores ¶
func (b *Bot) GetGameHighScores(ctx context.Context, request *GetGameHighScoresRequest) (r []GameHighScore, err error)
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
func (*Bot) GetMe ¶
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 (*Bot) GetMyCommands ¶
func (b *Bot) GetMyCommands(ctx context.Context, request *GetMyCommandsRequest) (r []BotCommand, err error)
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 (*Bot) GetMyDefaultAdministratorRights ¶
func (b *Bot) GetMyDefaultAdministratorRights(ctx context.Context, request *GetMyDefaultAdministratorRightsRequest) (r *ChatAdministratorRights, err error)
Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
https://core.telegram.org/bots/api#getmydefaultadministratorrights
func (*Bot) GetMyDescription ¶
func (b *Bot) GetMyDescription(ctx context.Context, request *GetMyDescriptionRequest) (r *BotDescription, err error)
Use this method to get the current bot description for the given user language. Returns BotDescription on success.
func (*Bot) GetMyName ¶
Use this method to get the current bot name for the given user language. Returns BotName on success.
func (*Bot) GetMyShortDescription ¶
func (b *Bot) GetMyShortDescription(ctx context.Context, request *GetMyShortDescriptionRequest) (r *BotShortDescription, err error)
Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
func (*Bot) GetStarTransactions ¶
func (b *Bot) GetStarTransactions(ctx context.Context, request *GetStarTransactionsRequest) (r *StarTransactions, err error)
Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.
func (*Bot) GetStickerSet ¶
func (b *Bot) GetStickerSet(ctx context.Context, request *GetStickerSetRequest) (r *StickerSet, err error)
Use this method to get a sticker set. On success, a StickerSet object is returned.
func (*Bot) GetUpdates ¶
Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
func (*Bot) GetUserChatBoosts ¶
func (b *Bot) GetUserChatBoosts(ctx context.Context, request *GetUserChatBoostsRequest) (r *UserChatBoosts, err error)
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 (*Bot) GetUserProfilePhotos ¶
func (b *Bot) GetUserProfilePhotos(ctx context.Context, request *GetUserProfilePhotosRequest) (r *UserProfilePhotos, err error)
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
func (*Bot) GetWebhookInfo ¶
func (b *Bot) GetWebhookInfo(ctx context.Context) (r *WebhookInfo, err error)
Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
func (*Bot) HideGeneralForumTopic ¶
func (b *Bot) HideGeneralForumTopic(ctx context.Context, request *HideGeneralForumTopicRequest) (r bool, err error)
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 (*Bot) HideGeneralForumTopicVoid ¶ added in v0.0.22
func (b *Bot) HideGeneralForumTopicVoid(ctx context.Context, request *HideGeneralForumTopicRequest) error
Does the same as Bot.HideGeneralForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) LeaveChat ¶
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
func (*Bot) LeaveChatVoid ¶ added in v0.0.22
func (b *Bot) LeaveChatVoid(ctx context.Context, request *LeaveChatRequest) error
Does the same as Bot.LeaveChat, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) LogOut ¶
Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
func (*Bot) PinChatMessage ¶
func (b *Bot) PinChatMessage(ctx context.Context, request *PinChatMessageRequest) (r bool, err error)
Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
func (*Bot) PinChatMessageVoid ¶ added in v0.0.22
func (b *Bot) PinChatMessageVoid(ctx context.Context, request *PinChatMessageRequest) error
Does the same as Bot.PinChatMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) PromoteChatMember ¶
func (b *Bot) PromoteChatMember(ctx context.Context, request *PromoteChatMemberRequest) (r bool, err error)
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
func (*Bot) PromoteChatMemberVoid ¶ added in v0.0.22
func (b *Bot) PromoteChatMemberVoid(ctx context.Context, request *PromoteChatMemberRequest) error
Does the same as Bot.PromoteChatMember, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) RefundStarPayment ¶
func (b *Bot) RefundStarPayment(ctx context.Context, request *RefundStarPaymentRequest) (r bool, err error)
Refunds a successful payment in Telegram Stars. Returns True on success.
func (*Bot) RefundStarPaymentVoid ¶ added in v0.0.22
func (b *Bot) RefundStarPaymentVoid(ctx context.Context, request *RefundStarPaymentRequest) error
Does the same as Bot.RefundStarPayment, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) RemoveChatVerification ¶
func (b *Bot) RemoveChatVerification(ctx context.Context, request *RemoveChatVerificationRequest) (r bool, err error)
Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
func (*Bot) RemoveChatVerificationVoid ¶ added in v0.0.22
func (b *Bot) RemoveChatVerificationVoid(ctx context.Context, request *RemoveChatVerificationRequest) error
Does the same as Bot.RemoveChatVerification, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) RemoveUserVerification ¶
func (b *Bot) RemoveUserVerification(ctx context.Context, request *RemoveUserVerificationRequest) (r bool, err error)
Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
func (*Bot) RemoveUserVerificationVoid ¶ added in v0.0.22
func (b *Bot) RemoveUserVerificationVoid(ctx context.Context, request *RemoveUserVerificationRequest) error
Does the same as Bot.RemoveUserVerification, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ReopenForumTopic ¶
func (b *Bot) ReopenForumTopic(ctx context.Context, request *ReopenForumTopicRequest) (r bool, err error)
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 (*Bot) ReopenForumTopicVoid ¶ added in v0.0.22
func (b *Bot) ReopenForumTopicVoid(ctx context.Context, request *ReopenForumTopicRequest) error
Does the same as Bot.ReopenForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ReopenGeneralForumTopic ¶
func (b *Bot) ReopenGeneralForumTopic(ctx context.Context, request *ReopenGeneralForumTopicRequest) (r bool, err error)
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 (*Bot) ReopenGeneralForumTopicVoid ¶ added in v0.0.22
func (b *Bot) ReopenGeneralForumTopicVoid(ctx context.Context, request *ReopenGeneralForumTopicRequest) error
Does the same as Bot.ReopenGeneralForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) ReplaceStickerInSet ¶
func (b *Bot) ReplaceStickerInSet(ctx context.Context, request *ReplaceStickerInSetRequest) (r bool, err error)
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 (*Bot) ReplaceStickerInSetVoid ¶ added in v0.0.22
func (b *Bot) ReplaceStickerInSetVoid(ctx context.Context, request *ReplaceStickerInSetRequest) error
Does the same as Bot.ReplaceStickerInSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) RestrictChatMember ¶
func (b *Bot) RestrictChatMember(ctx context.Context, request *RestrictChatMemberRequest) (r bool, err error)
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
func (*Bot) RestrictChatMemberVoid ¶ added in v0.0.22
func (b *Bot) RestrictChatMemberVoid(ctx context.Context, request *RestrictChatMemberRequest) error
Does the same as Bot.RestrictChatMember, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) RevokeChatInviteLink ¶
func (b *Bot) RevokeChatInviteLink(ctx context.Context, request *RevokeChatInviteLinkRequest) (r *ChatInviteLink, err error)
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 (*Bot) RevokeChatInviteLinkVoid ¶ added in v0.0.22
func (b *Bot) RevokeChatInviteLinkVoid(ctx context.Context, request *RevokeChatInviteLinkRequest) error
Does the same as Bot.RevokeChatInviteLink, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SavePreparedInlineMessage ¶
func (b *Bot) SavePreparedInlineMessage(ctx context.Context, request *SavePreparedInlineMessageRequest) (r *PreparedInlineMessage, err error)
Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.
https://core.telegram.org/bots/api#savepreparedinlinemessage
func (*Bot) SavePreparedInlineMessageVoid ¶ added in v0.0.22
func (b *Bot) SavePreparedInlineMessageVoid(ctx context.Context, request *SavePreparedInlineMessageRequest) error
Does the same as Bot.SavePreparedInlineMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendAnimation ¶
func (b *Bot) SendAnimation(ctx context.Context, request *SendAnimationRequest) (r *Message, err error)
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendAnimationVoid ¶ added in v0.0.22
func (b *Bot) SendAnimationVoid(ctx context.Context, request *SendAnimationRequest) error
Does the same as Bot.SendAnimation, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendAudio ¶
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
func (*Bot) SendAudioVoid ¶ added in v0.0.22
func (b *Bot) SendAudioVoid(ctx context.Context, request *SendAudioRequest) error
Does the same as Bot.SendAudio, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendChatAction ¶
func (b *Bot) SendChatAction(ctx context.Context, request *SendChatActionRequest) (r bool, err error)
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
func (*Bot) SendChatActionVoid ¶ added in v0.0.22
func (b *Bot) SendChatActionVoid(ctx context.Context, request *SendChatActionRequest) error
Does the same as Bot.SendChatAction, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendContact ¶
Use this method to send phone contacts. On success, the sent Message is returned.
func (*Bot) SendContactVoid ¶ added in v0.0.22
func (b *Bot) SendContactVoid(ctx context.Context, request *SendContactRequest) error
Does the same as Bot.SendContact, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendDice ¶
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
func (*Bot) SendDiceVoid ¶ added in v0.0.22
func (b *Bot) SendDiceVoid(ctx context.Context, request *SendDiceRequest) error
Does the same as Bot.SendDice, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendDocument ¶
func (b *Bot) SendDocument(ctx context.Context, request *SendDocumentRequest) (r *Message, err error)
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
func (*Bot) SendDocumentVoid ¶ added in v0.0.22
func (b *Bot) SendDocumentVoid(ctx context.Context, request *SendDocumentRequest) error
Does the same as Bot.SendDocument, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendGameVoid ¶ added in v0.0.22
func (b *Bot) SendGameVoid(ctx context.Context, request *SendGameRequest) error
Does the same as Bot.SendGame, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendGift ¶
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 (*Bot) SendGiftVoid ¶ added in v0.0.22
func (b *Bot) SendGiftVoid(ctx context.Context, request *SendGiftRequest) error
Does the same as Bot.SendGift, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendInvoice ¶
Use this method to send invoices. On success, the sent Message is returned.
func (*Bot) SendInvoiceVoid ¶ added in v0.0.22
func (b *Bot) SendInvoiceVoid(ctx context.Context, request *SendInvoiceRequest) error
Does the same as Bot.SendInvoice, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendLocation ¶
func (b *Bot) SendLocation(ctx context.Context, request *SendLocationRequest) (r *Message, err error)
Use this method to send point on the map. On success, the sent Message is returned.
func (*Bot) SendLocationVoid ¶ added in v0.0.22
func (b *Bot) SendLocationVoid(ctx context.Context, request *SendLocationRequest) error
Does the same as Bot.SendLocation, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendMediaGroup ¶
func (b *Bot) SendMediaGroup(ctx context.Context, request *SendMediaGroupRequest) (r []Message, err error)
Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
func (*Bot) SendMediaGroupVoid ¶ added in v0.0.22
func (b *Bot) SendMediaGroupVoid(ctx context.Context, request *SendMediaGroupRequest) error
Does the same as Bot.SendMediaGroup, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendMessage ¶
Use this method to send text messages. On success, the sent Message is returned.
func (*Bot) SendMessageVoid ¶ added in v0.0.22
func (b *Bot) SendMessageVoid(ctx context.Context, request *SendMessageRequest) error
Does the same as Bot.SendMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendPaidMedia ¶
func (b *Bot) SendPaidMedia(ctx context.Context, request *SendPaidMediaRequest) (r *Message, err error)
Use this method to send paid media. On success, the sent Message is returned.
func (*Bot) SendPaidMediaVoid ¶ added in v0.0.22
func (b *Bot) SendPaidMediaVoid(ctx context.Context, request *SendPaidMediaRequest) error
Does the same as Bot.SendPaidMedia, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendPhotoVoid ¶ added in v0.0.22
func (b *Bot) SendPhotoVoid(ctx context.Context, request *SendPhotoRequest) error
Does the same as Bot.SendPhoto, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendPoll ¶
Use this method to send a native poll. On success, the sent Message is returned.
func (*Bot) SendPollVoid ¶ added in v0.0.22
func (b *Bot) SendPollVoid(ctx context.Context, request *SendPollRequest) error
Does the same as Bot.SendPoll, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendSticker ¶
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
func (*Bot) SendStickerVoid ¶ added in v0.0.22
func (b *Bot) SendStickerVoid(ctx context.Context, request *SendStickerRequest) error
Does the same as Bot.SendSticker, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendVenue ¶
Use this method to send information about a venue. On success, the sent Message is returned.
func (*Bot) SendVenueVoid ¶ added in v0.0.22
func (b *Bot) SendVenueVoid(ctx context.Context, request *SendVenueRequest) error
Does the same as Bot.SendVenue, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendVideo ¶
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 (*Bot) SendVideoNote ¶
func (b *Bot) SendVideoNote(ctx context.Context, request *SendVideoNoteRequest) (r *Message, err error)
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 (*Bot) SendVideoNoteVoid ¶ added in v0.0.22
func (b *Bot) SendVideoNoteVoid(ctx context.Context, request *SendVideoNoteRequest) error
Does the same as Bot.SendVideoNote, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendVideoVoid ¶ added in v0.0.22
func (b *Bot) SendVideoVoid(ctx context.Context, request *SendVideoRequest) error
Does the same as Bot.SendVideo, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SendVoice ¶
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, 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 (*Bot) SendVoiceVoid ¶ added in v0.0.22
func (b *Bot) SendVoiceVoid(ctx context.Context, request *SendVoiceRequest) error
Does the same as Bot.SendVoice, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatAdministratorCustomTitle ¶
func (b *Bot) SetChatAdministratorCustomTitle(ctx context.Context, request *SetChatAdministratorCustomTitleRequest) (r bool, err error)
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
https://core.telegram.org/bots/api#setchatadministratorcustomtitle
func (*Bot) SetChatAdministratorCustomTitleVoid ¶ added in v0.0.22
func (b *Bot) SetChatAdministratorCustomTitleVoid(ctx context.Context, request *SetChatAdministratorCustomTitleRequest) error
Does the same as Bot.SetChatAdministratorCustomTitle, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatDescription ¶
func (b *Bot) SetChatDescription(ctx context.Context, request *SetChatDescriptionRequest) (r bool, err error)
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*Bot) SetChatDescriptionVoid ¶ added in v0.0.22
func (b *Bot) SetChatDescriptionVoid(ctx context.Context, request *SetChatDescriptionRequest) error
Does the same as Bot.SetChatDescription, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatMenuButton ¶
func (b *Bot) SetChatMenuButton(ctx context.Context, request *SetChatMenuButtonRequest) (r bool, err error)
Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
func (*Bot) SetChatMenuButtonVoid ¶ added in v0.0.22
func (b *Bot) SetChatMenuButtonVoid(ctx context.Context, request *SetChatMenuButtonRequest) error
Does the same as Bot.SetChatMenuButton, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatPermissions ¶
func (b *Bot) SetChatPermissions(ctx context.Context, request *SetChatPermissionsRequest) (r bool, err error)
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
func (*Bot) SetChatPermissionsVoid ¶ added in v0.0.22
func (b *Bot) SetChatPermissionsVoid(ctx context.Context, request *SetChatPermissionsRequest) error
Does the same as Bot.SetChatPermissions, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatPhoto ¶
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*Bot) SetChatPhotoVoid ¶ added in v0.0.22
func (b *Bot) SetChatPhotoVoid(ctx context.Context, request *SetChatPhotoRequest) error
Does the same as Bot.SetChatPhoto, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatStickerSet ¶
func (b *Bot) SetChatStickerSet(ctx context.Context, request *SetChatStickerSetRequest) (r bool, err error)
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate 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 (*Bot) SetChatStickerSetVoid ¶ added in v0.0.22
func (b *Bot) SetChatStickerSetVoid(ctx context.Context, request *SetChatStickerSetRequest) error
Does the same as Bot.SetChatStickerSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetChatTitle ¶
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
func (*Bot) SetChatTitleVoid ¶ added in v0.0.22
func (b *Bot) SetChatTitleVoid(ctx context.Context, request *SetChatTitleRequest) error
Does the same as Bot.SetChatTitle, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetCustomEmojiStickerSetThumbnail ¶
func (b *Bot) SetCustomEmojiStickerSetThumbnail(ctx context.Context, request *SetCustomEmojiStickerSetThumbnailRequest) (r bool, err error)
Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.
https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
func (*Bot) SetCustomEmojiStickerSetThumbnailVoid ¶ added in v0.0.22
func (b *Bot) SetCustomEmojiStickerSetThumbnailVoid(ctx context.Context, request *SetCustomEmojiStickerSetThumbnailRequest) error
Does the same as Bot.SetCustomEmojiStickerSetThumbnail, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetGameScore ¶
func (b *Bot) SetGameScore(ctx context.Context, request *SetGameScoreRequest) (r *Message, err error)
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 (*Bot) SetGameScoreVoid ¶ added in v0.0.22
func (b *Bot) SetGameScoreVoid(ctx context.Context, request *SetGameScoreRequest) error
Does the same as Bot.SetGameScore, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetMessageReaction ¶
func (b *Bot) SetMessageReaction(ctx context.Context, request *SetMessageReactionRequest) (r bool, err error)
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 (*Bot) SetMessageReactionVoid ¶ added in v0.0.22
func (b *Bot) SetMessageReactionVoid(ctx context.Context, request *SetMessageReactionRequest) error
Does the same as Bot.SetMessageReaction, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetMyCommands ¶
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 (*Bot) SetMyCommandsVoid ¶ added in v0.0.22
func (b *Bot) SetMyCommandsVoid(ctx context.Context, request *SetMyCommandsRequest) error
Does the same as Bot.SetMyCommands, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetMyDefaultAdministratorRights ¶
func (b *Bot) SetMyDefaultAdministratorRights(ctx context.Context, request *SetMyDefaultAdministratorRightsRequest) (r bool, err error)
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.
https://core.telegram.org/bots/api#setmydefaultadministratorrights
func (*Bot) SetMyDefaultAdministratorRightsVoid ¶ added in v0.0.22
func (b *Bot) SetMyDefaultAdministratorRightsVoid(ctx context.Context, request *SetMyDefaultAdministratorRightsRequest) error
Does the same as Bot.SetMyDefaultAdministratorRights, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetMyDescription ¶
func (b *Bot) SetMyDescription(ctx context.Context, request *SetMyDescriptionRequest) (r bool, err error)
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 (*Bot) SetMyDescriptionVoid ¶ added in v0.0.22
func (b *Bot) SetMyDescriptionVoid(ctx context.Context, request *SetMyDescriptionRequest) error
Does the same as Bot.SetMyDescription, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetMyNameVoid ¶ added in v0.0.22
func (b *Bot) SetMyNameVoid(ctx context.Context, request *SetMyNameRequest) error
Does the same as Bot.SetMyName, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetMyShortDescription ¶
func (b *Bot) SetMyShortDescription(ctx context.Context, request *SetMyShortDescriptionRequest) (r bool, err error)
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 (*Bot) SetMyShortDescriptionVoid ¶ added in v0.0.22
func (b *Bot) SetMyShortDescriptionVoid(ctx context.Context, request *SetMyShortDescriptionRequest) error
Does the same as Bot.SetMyShortDescription, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetPassportDataErrors ¶
func (b *Bot) SetPassportDataErrors(ctx context.Context, request *SetPassportDataErrorsRequest) (r bool, err error)
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
func (*Bot) SetPassportDataErrorsVoid ¶ added in v0.0.22
func (b *Bot) SetPassportDataErrorsVoid(ctx context.Context, request *SetPassportDataErrorsRequest) error
Does the same as Bot.SetPassportDataErrors, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetStickerEmojiList ¶
func (b *Bot) SetStickerEmojiList(ctx context.Context, request *SetStickerEmojiListRequest) (r bool, err error)
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 (*Bot) SetStickerEmojiListVoid ¶ added in v0.0.22
func (b *Bot) SetStickerEmojiListVoid(ctx context.Context, request *SetStickerEmojiListRequest) error
Does the same as Bot.SetStickerEmojiList, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetStickerKeywords ¶
func (b *Bot) SetStickerKeywords(ctx context.Context, request *SetStickerKeywordsRequest) (r bool, err error)
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 (*Bot) SetStickerKeywordsVoid ¶ added in v0.0.22
func (b *Bot) SetStickerKeywordsVoid(ctx context.Context, request *SetStickerKeywordsRequest) error
Does the same as Bot.SetStickerKeywords, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetStickerMaskPosition ¶
func (b *Bot) SetStickerMaskPosition(ctx context.Context, request *SetStickerMaskPositionRequest) (r bool, err error)
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 (*Bot) SetStickerMaskPositionVoid ¶ added in v0.0.22
func (b *Bot) SetStickerMaskPositionVoid(ctx context.Context, request *SetStickerMaskPositionRequest) error
Does the same as Bot.SetStickerMaskPosition, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetStickerPositionInSet ¶
func (b *Bot) SetStickerPositionInSet(ctx context.Context, request *SetStickerPositionInSetRequest) (r bool, err error)
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
func (*Bot) SetStickerPositionInSetVoid ¶ added in v0.0.22
func (b *Bot) SetStickerPositionInSetVoid(ctx context.Context, request *SetStickerPositionInSetRequest) error
Does the same as Bot.SetStickerPositionInSet, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetStickerSetThumbnail ¶
func (b *Bot) SetStickerSetThumbnail(ctx context.Context, request *SetStickerSetThumbnailRequest) (r bool, err error)
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 (*Bot) SetStickerSetThumbnailVoid ¶ added in v0.0.22
func (b *Bot) SetStickerSetThumbnailVoid(ctx context.Context, request *SetStickerSetThumbnailRequest) error
Does the same as Bot.SetStickerSetThumbnail, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetStickerSetTitle ¶
func (b *Bot) SetStickerSetTitle(ctx context.Context, request *SetStickerSetTitleRequest) (r bool, err error)
Use this method to set the title of a created sticker set. Returns True on success.
func (*Bot) SetStickerSetTitleVoid ¶ added in v0.0.22
func (b *Bot) SetStickerSetTitleVoid(ctx context.Context, request *SetStickerSetTitleRequest) error
Does the same as Bot.SetStickerSetTitle, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetUserEmojiStatus ¶
func (b *Bot) SetUserEmojiStatus(ctx context.Context, request *SetUserEmojiStatusRequest) (r bool, err error)
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 (*Bot) SetUserEmojiStatusVoid ¶ added in v0.0.22
func (b *Bot) SetUserEmojiStatusVoid(ctx context.Context, request *SetUserEmojiStatusRequest) error
Does the same as Bot.SetUserEmojiStatus, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) SetWebhook ¶
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 (*Bot) SetWebhookVoid ¶ added in v0.0.22
func (b *Bot) SetWebhookVoid(ctx context.Context, request *SetWebhookRequest) error
Does the same as Bot.SetWebhook, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) StopMessageLiveLocation ¶
func (b *Bot) StopMessageLiveLocation(ctx context.Context, request *StopMessageLiveLocationRequest) (r *Message, err error)
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 (*Bot) StopMessageLiveLocationVoid ¶ added in v0.0.22
func (b *Bot) StopMessageLiveLocationVoid(ctx context.Context, request *StopMessageLiveLocationRequest) error
Does the same as Bot.StopMessageLiveLocation, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) StopPoll ¶
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
func (*Bot) StopPollVoid ¶ added in v0.0.22
func (b *Bot) StopPollVoid(ctx context.Context, request *StopPollRequest) error
Does the same as Bot.StopPoll, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnbanChatMember ¶
func (b *Bot) UnbanChatMember(ctx context.Context, request *UnbanChatMemberRequest) (r bool, err error)
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 (*Bot) UnbanChatMemberVoid ¶ added in v0.0.22
func (b *Bot) UnbanChatMemberVoid(ctx context.Context, request *UnbanChatMemberRequest) error
Does the same as Bot.UnbanChatMember, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnbanChatSenderChat ¶
func (b *Bot) UnbanChatSenderChat(ctx context.Context, request *UnbanChatSenderChatRequest) (r bool, err error)
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 (*Bot) UnbanChatSenderChatVoid ¶ added in v0.0.22
func (b *Bot) UnbanChatSenderChatVoid(ctx context.Context, request *UnbanChatSenderChatRequest) error
Does the same as Bot.UnbanChatSenderChat, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnhideGeneralForumTopic ¶
func (b *Bot) UnhideGeneralForumTopic(ctx context.Context, request *UnhideGeneralForumTopicRequest) (r bool, err error)
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 (*Bot) UnhideGeneralForumTopicVoid ¶ added in v0.0.22
func (b *Bot) UnhideGeneralForumTopicVoid(ctx context.Context, request *UnhideGeneralForumTopicRequest) error
Does the same as Bot.UnhideGeneralForumTopic, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnpinAllChatMessages ¶
func (b *Bot) UnpinAllChatMessages(ctx context.Context, request *UnpinAllChatMessagesRequest) (r bool, err error)
Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
func (*Bot) UnpinAllChatMessagesVoid ¶ added in v0.0.22
func (b *Bot) UnpinAllChatMessagesVoid(ctx context.Context, request *UnpinAllChatMessagesRequest) error
Does the same as Bot.UnpinAllChatMessages, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnpinAllForumTopicMessages ¶
func (b *Bot) UnpinAllForumTopicMessages(ctx context.Context, request *UnpinAllForumTopicMessagesRequest) (r bool, err error)
Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
https://core.telegram.org/bots/api#unpinallforumtopicmessages
func (*Bot) UnpinAllForumTopicMessagesVoid ¶ added in v0.0.22
func (b *Bot) UnpinAllForumTopicMessagesVoid(ctx context.Context, request *UnpinAllForumTopicMessagesRequest) error
Does the same as Bot.UnpinAllForumTopicMessages, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnpinAllGeneralForumTopicMessages ¶
func (b *Bot) UnpinAllGeneralForumTopicMessages(ctx context.Context, request *UnpinAllGeneralForumTopicMessagesRequest) (r bool, err error)
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.
https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
func (*Bot) UnpinAllGeneralForumTopicMessagesVoid ¶ added in v0.0.22
func (b *Bot) UnpinAllGeneralForumTopicMessagesVoid(ctx context.Context, request *UnpinAllGeneralForumTopicMessagesRequest) error
Does the same as Bot.UnpinAllGeneralForumTopicMessages, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UnpinChatMessage ¶
func (b *Bot) UnpinChatMessage(ctx context.Context, request *UnpinChatMessageRequest) (r bool, err error)
Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
func (*Bot) UnpinChatMessageVoid ¶ added in v0.0.22
func (b *Bot) UnpinChatMessageVoid(ctx context.Context, request *UnpinChatMessageRequest) error
Does the same as Bot.UnpinChatMessage, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) UploadStickerFile ¶
func (b *Bot) UploadStickerFile(ctx context.Context, request *UploadStickerFileRequest) (r *File, err error)
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 (*Bot) UploadStickerFileVoid ¶ added in v0.0.22
func (b *Bot) UploadStickerFileVoid(ctx context.Context, request *UploadStickerFileRequest) error
Does the same as Bot.UploadStickerFile, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) VerifyChat ¶
Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
func (*Bot) VerifyChatVoid ¶ added in v0.0.22
func (b *Bot) VerifyChatVoid(ctx context.Context, request *VerifyChatRequest) error
Does the same as Bot.VerifyChat, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
func (*Bot) VerifyUser ¶
Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
func (*Bot) VerifyUserVoid ¶ added in v0.0.22
func (b *Bot) VerifyUserVoid(ctx context.Context, request *VerifyUserRequest) error
Does the same as Bot.VerifyUser, but parses response body only in case of an error. Therefore works faster if you dont need the response value.
type BotCommand ¶
type BotCommand struct { Command string `json:"command"` // Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. Description string `json:"description"` // Description of the command; 1-256 characters. }
This object represents a bot command.
type BotCommandScope ¶
type BotCommandScope struct { Type string `json:"type"` ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) UserID int64 `json:"user_id"` // Unique identifier of the target user }
This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
- BotCommandScopeDefault
- BotCommandScopeAllPrivateChats
- BotCommandScopeAllGroupChats
- BotCommandScopeAllChatAdministrators
- BotCommandScopeChat
- BotCommandScopeChatAdministrators
- BotCommandScopeChatMember
type BotDescription ¶
type BotDescription struct {
Description string `json:"description"` // The bot's description
}
This object represents the bot's description.
type BotName ¶
type BotName struct {
Name string `json:"name"` // The bot's name
}
This object represents the bot's name.
type BotOptions ¶
type BotOptions struct { Token string // Required Client *http.Client // Optional. If Client is nil, http.DefaultClient will be used FloodHandler flood.Handler // Optional. If FloodHandler is nil, 429 flood error will be propagated to the caller of a flooded method BaseUrl string // Optional. If BaseUrl is empty, https://api.telegram.org/ will be used }
type BotShortDescription ¶
type BotShortDescription struct {
ShortDescription string `json:"short_description"` // The bot's short description
}
This object represents the bot's short description.
type BusinessConnection ¶
type BusinessConnection struct { ID string `json:"id"` // Unique identifier of the business connection User *User `json:"user"` // Business account user that created the business connection UserChatID int64 `json:"user_chat_id"` // 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. Date int `json:"date"` // Date the connection was established in Unix time CanReply bool `json:"can_reply"` // True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours IsEnabled bool `json:"is_enabled"` // True, if the connection is active }
Describes the connection of the bot with a business account.
type BusinessIntro ¶
type BusinessIntro struct { Title string `json:"title,omitempty"` // Optional. Title text of the business intro Message string `json:"message,omitempty"` // Optional. Message text of the business intro Sticker *Sticker `json:"sticker,omitempty"` // Optional. Sticker of the business intro }
Contains information about the start page settings of a Telegram Business account.
type BusinessLocation ¶
type BusinessLocation struct { Address string `json:"address"` // Address of the business Location *Location `json:"location,omitempty"` // Optional. Location of the business }
Contains information about the location of a Telegram Business account.
type BusinessMessagesDeleted ¶
type BusinessMessagesDeleted struct { BusinessConnectionID string `json:"business_connection_id"` // Unique identifier of the business connection Chat *Chat `json:"chat"` // Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. MessageIds []int `json:"message_ids"` // The list of identifiers of deleted messages in the chat of the business account }
This object is received when messages are deleted from a connected business account.
type BusinessOpeningHours ¶
type BusinessOpeningHours struct { TimeZoneName string `json:"time_zone_name"` // Unique name of the time zone for which the opening hours are defined OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"` // List of time intervals describing business opening hours }
Describes the opening hours of a business.
type BusinessOpeningHoursInterval ¶
type BusinessOpeningHoursInterval struct { OpeningMinute int `json:"opening_minute"` // 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 ClosingMinute int `json:"closing_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 }
Describes an interval of time during which a business is open.
https://core.telegram.org/bots/api#businessopeninghoursinterval
type CallbackGame ¶
type CallbackGame interface{}
A placeholder, currently holds no information. Use BotFather to set up your game.
type CallbackQuery ¶
type CallbackQuery struct { ID string `json:"id"` // Unique identifier for this query From *User `json:"from"` // Sender Message *Message `json:"message,omitempty"` // Optional. Message sent by the bot with the callback button that originated the query InlineMessageID string `json:"inline_message_id,omitempty"` // Optional. Identifier of the message sent via the bot in inline mode, that originated the query. ChatInstance string `json:"chat_instance"` // Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. Data string `json:"data,omitempty"` // Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. GameShortName string `json:"game_short_name,omitempty"` // Optional. Short name of a Game to be returned, serves as the unique identifier for the game }
This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
https://core.telegram.org/bots/api#callbackquery
func (*CallbackQuery) ChatID ¶ added in v0.1.0
func (c *CallbackQuery) ChatID() ChatID
type Chat ¶
type Chat struct { ID int64 `json:"id"` // 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. Type ChatType `json:"type"` // Type of the chat, can be either "private", "group", "supergroup" or "channel" Title string `json:"title,omitempty"` // Optional. Title, for supergroups, channels and group chats Username string `json:"username,omitempty"` // Optional. Username, for private chats, supergroups and channels if available FirstName string `json:"first_name,omitempty"` // Optional. First name of the other party in a private chat LastName string `json:"last_name,omitempty"` // Optional. Last name of the other party in a private chat IsForum bool `json:"is_forum,omitempty"` // Optional. True, if the supergroup chat is a forum (has topics enabled) }
This object represents a chat.
type ChatAction ¶
type ChatAction string
const ( ChatActionTyping ChatAction = "typing" ChatActionUploadPhoto ChatAction = "upload_photo" ChatActionRecordVideo ChatAction = "record_video" ChatActionUploadVideo ChatAction = "upload_video" ChatActionRecordVoice ChatAction = "record_voice" ChatActionUploadVoice ChatAction = "upload_voice" ChatActionUploadDocument ChatAction = "upload_document" ChatActionFindLocation ChatAction = "find_location" ChatActionRecordVideoNote ChatAction = "record_video_note" ChatActionUploadVideoNote ChatAction = "upload_video_note" )
type ChatAdministratorRights ¶
type ChatAdministratorRights struct { IsAnonymous bool `json:"is_anonymous"` // True, if the user's presence in the chat is hidden CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can delete messages of other users CanManageVideoChats bool `json:"can_manage_video_chats"` // True, if the administrator can manage video chats CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics CanPromoteMembers bool `json:"can_promote_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) CanChangeInfo bool `json:"can_change_info"` // True, if the user is allowed to change the chat title, photo and other settings CanInviteUsers bool `json:"can_invite_users"` // True, if the user is allowed to invite new users to the chat CanPostStories bool `json:"can_post_stories"` // True, if the administrator can post stories to the chat CanEditStories bool `json:"can_edit_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 CanDeleteStories bool `json:"can_delete_stories"` // True, if the administrator can delete stories posted by other users CanPostMessages bool `json:"can_post_messages,omitempty"` // Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. True, if the user is allowed to pin messages; for groups and supergroups only CanManageTopics bool `json:"can_manage_topics,omitempty"` // Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only }
Represents the rights of an administrator in a chat.
type ChatBackground ¶
type ChatBackground struct {
Type *BackgroundType `json:"type"` // Type of the background
}
This object represents a chat background.
type ChatBoost ¶
type ChatBoost struct { BoostID string `json:"boost_id"` // Unique identifier of the boost AddDate int `json:"add_date"` // Point in time (Unix timestamp) when the chat was boosted ExpirationDate int `json:"expiration_date"` // Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged Source *ChatBoostSource `json:"source"` // Source of the added boost }
This object contains information about a chat boost.
type ChatBoostAdded ¶
type ChatBoostAdded struct {
BoostCount int `json:"boost_count"` // Number of boosts added by the user
}
This object represents a service message about a user boosting a chat.
type ChatBoostRemoved ¶
type ChatBoostRemoved struct { Chat *Chat `json:"chat"` // Chat which was boosted BoostID string `json:"boost_id"` // Unique identifier of the boost RemoveDate int `json:"remove_date"` // Point in time (Unix timestamp) when the boost was removed Source *ChatBoostSource `json:"source"` // Source of the removed boost }
This object represents a boost removed from a chat.
type ChatBoostSource ¶
type ChatBoostSource struct { Source string `json:"source"` User *User `json:"user"` // User that boosted the chat GiveawayMessageID int64 `json:"giveaway_message_id"` // 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. PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only IsUnclaimed bool `json:"is_unclaimed,omitempty"` // Optional. True, if the giveaway was completed, but there was no user to win the prize }
This object describes the source of a chat boost. It can be one of
- ChatBoostSourcePremium
- ChatBoostSourceGiftCode
- ChatBoostSourceGiveaway
type ChatBoostUpdated ¶
type ChatBoostUpdated struct { Chat *Chat `json:"chat"` // Chat which was boosted Boost *ChatBoost `json:"boost"` // Information about the chat boost }
This object represents a boost added to a chat or changed.
type ChatFullInfo ¶
type ChatFullInfo struct { ID int64 `json:"id"` // 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. Type ChatType `json:"type"` // Type of the chat, can be either "private", "group", "supergroup" or "channel" Title string `json:"title,omitempty"` // Optional. Title, for supergroups, channels and group chats Username string `json:"username,omitempty"` // Optional. Username, for private chats, supergroups and channels if available FirstName string `json:"first_name,omitempty"` // Optional. First name of the other party in a private chat LastName string `json:"last_name,omitempty"` // Optional. Last name of the other party in a private chat IsForum bool `json:"is_forum,omitempty"` // Optional. True, if the supergroup chat is a forum (has topics enabled) AccentColorID int64 `json:"accent_color_id"` // 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. MaxReactionCount int `json:"max_reaction_count"` // The maximum number of reactions that can be set on a message in the chat Photo *ChatPhoto `json:"photo,omitempty"` // Optional. Chat photo ActiveUsernames []string `json:"active_usernames,omitempty"` // Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels Birthdate *Birthdate `json:"birthdate,omitempty"` // Optional. For private chats, the date of birth of the user BusinessIntro *BusinessIntro `json:"business_intro,omitempty"` // Optional. For private chats with business accounts, the intro of the business BusinessLocation *BusinessLocation `json:"business_location,omitempty"` // Optional. For private chats with business accounts, the location of the business BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"` // Optional. For private chats with business accounts, the opening hours of the business PersonalChat *Chat `json:"personal_chat,omitempty"` // Optional. For private chats, the personal channel of the user AvailableReactions []ReactionType `json:"available_reactions,omitempty"` // Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"` // Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background ProfileAccentColorID int64 `json:"profile_accent_color_id,omitempty"` // Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"` // Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` // Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat EmojiStatusExpirationDate int `json:"emoji_status_expiration_date,omitempty"` // Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any Bio string `json:"bio,omitempty"` // Optional. Bio of the other party in a private chat HasPrivateForwards bool `json:"has_private_forwards,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 HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"` // Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat JoinToSendMessages bool `json:"join_to_send_messages,omitempty"` // Optional. True, if users need to join the supergroup before they can send messages JoinByRequest bool `json:"join_by_request,omitempty"` // Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators Description string `json:"description,omitempty"` // Optional. Description, for groups, supergroups and channel chats InviteLink string `json:"invite_link,omitempty"` // Optional. Primary invite link, for groups, supergroups and channel chats PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. The most recent pinned message (by sending date) Permissions *ChatPermissions `json:"permissions,omitempty"` // Optional. Default chat member permissions, for groups and supergroups CanSendGift bool `json:"can_send_gift,omitempty"` // Optional. True, if gifts can be sent to the chat CanSendPaidMedia bool `json:"can_send_paid_media,omitempty"` // Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. SlowModeDelay int `json:"slow_mode_delay,omitempty"` // Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds UnrestrictBoostCount int `json:"unrestrict_boost_count,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 MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"` // Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"` // Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. HasHiddenMembers bool `json:"has_hidden_members,omitempty"` // Optional. True, if non-administrators can only get the list of bots and administrators in the chat HasProtectedContent bool `json:"has_protected_content,omitempty"` // Optional. True, if messages from the chat can't be forwarded to other chats HasVisibleHistory bool `json:"has_visible_history,omitempty"` // Optional. True, if new chat members will have access to old messages; available only to chat administrators StickerSetName string `json:"sticker_set_name,omitempty"` // Optional. For supergroups, name of the group sticker set CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` // Optional. True, if the bot can change the group sticker set CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,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. LinkedChatID int64 `json:"linked_chat_id,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. Location *ChatLocation `json:"location,omitempty"` // Optional. For supergroups, the location to which the supergroup is connected }
This object contains full information about a chat.
type ChatID ¶ added in v0.1.0
type ChatID struct { ID int64 // Negative int64 (-100...) for channel and some group ids, positive for user ids Username string // Plain username, without leading @ }
Use this struct to specify a chat id or username
func (ChatID) MarshalJSON ¶ added in v0.1.0
For json encoding ChatId inside structs
type ChatInviteLink ¶
type ChatInviteLink struct { InviteLink string `json:"invite_link"` // The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". Creator *User `json:"creator"` // Creator of the link CreatesJoinRequest bool `json:"creates_join_request"` // True, if users joining the chat via the link need to be approved by chat administrators IsPrimary bool `json:"is_primary"` // True, if the link is primary IsRevoked bool `json:"is_revoked"` // True, if the link is revoked Name string `json:"name,omitempty"` // Optional. Invite link name ExpireDate int `json:"expire_date,omitempty"` // Optional. Point in time (Unix timestamp) when the link will expire or has been expired MemberLimit int `json:"member_limit,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 PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"` // Optional. Number of pending join requests created using this link SubscriptionPeriod int `json:"subscription_period,omitempty"` // Optional. The number of seconds the subscription will be active for before the next payment SubscriptionPrice int `json:"subscription_price,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 }
Represents an invite link for a chat.
type ChatJoinRequest ¶
type ChatJoinRequest struct { Chat *Chat `json:"chat"` // Chat to which the request was sent From *User `json:"from"` // User that sent the join request UserChatID int64 `json:"user_chat_id"` // 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. Date int `json:"date"` // Date the request was sent in Unix time Bio string `json:"bio,omitempty"` // Optional. Bio of the user. InviteLink *ChatInviteLink `json:"invite_link,omitempty"` // Optional. Chat invite link that was used by the user to send the join request }
Represents a join request sent to a chat.
type ChatLocation ¶
type ChatLocation struct { Location *Location `json:"location"` // The location to which the supergroup is connected. Can't be a live location. Address string `json:"address"` // Location address; 1-64 characters, as defined by the chat owner }
Represents a location to which a chat is connected.
type ChatMember ¶
type ChatMember struct { Status string `json:"status"` User *User `json:"user"` // Information about the user IsAnonymous bool `json:"is_anonymous"` // True, if the user's presence in the chat is hidden CustomTitle string `json:"custom_title,omitempty"` // Optional. Custom title for this user CanBeEdited bool `json:"can_be_edited"` // True, if the bot is allowed to edit administrator privileges of that user CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can delete messages of other users CanManageVideoChats bool `json:"can_manage_video_chats"` // True, if the administrator can manage video chats CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics CanPromoteMembers bool `json:"can_promote_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) CanChangeInfo bool `json:"can_change_info"` // True, if the user is allowed to change the chat title, photo and other settings CanInviteUsers bool `json:"can_invite_users"` // True, if the user is allowed to invite new users to the chat CanPostStories bool `json:"can_post_stories"` // True, if the administrator can post stories to the chat CanEditStories bool `json:"can_edit_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 CanDeleteStories bool `json:"can_delete_stories"` // True, if the administrator can delete stories posted by other users CanPostMessages bool `json:"can_post_messages,omitempty"` // Optional. True, if the administrator can post messages in the channel, or access channel statistics; for channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. True, if the user is allowed to pin messages; for groups and supergroups only CanManageTopics bool `json:"can_manage_topics,omitempty"` // Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only UntilDate int `json:"until_date,omitempty"` // Optional. Date when the user's subscription will expire; Unix time IsMember bool `json:"is_member"` // True, if the user is a member of the chat at the moment of the request CanSendMessages bool `json:"can_send_messages"` // True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues CanSendAudios bool `json:"can_send_audios"` // True, if the user is allowed to send audios CanSendDocuments bool `json:"can_send_documents"` // True, if the user is allowed to send documents CanSendPhotos bool `json:"can_send_photos"` // True, if the user is allowed to send photos CanSendVideos bool `json:"can_send_videos"` // True, if the user is allowed to send videos CanSendVideoNotes bool `json:"can_send_video_notes"` // True, if the user is allowed to send video notes CanSendVoiceNotes bool `json:"can_send_voice_notes"` // True, if the user is allowed to send voice notes CanSendPolls bool `json:"can_send_polls"` // True, if the user is allowed to send polls CanSendOtherMessages bool `json:"can_send_other_messages"` // True, if the user is allowed to send animations, games, stickers and use inline bots CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` // True, if the user is allowed to add web page previews to their messages }
This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
- ChatMemberOwner
- ChatMemberAdministrator
- ChatMemberMember
- ChatMemberRestricted
- ChatMemberLeft
- ChatMemberBanned
type ChatMemberUpdated ¶
type ChatMemberUpdated struct { Chat *Chat `json:"chat"` // Chat the user belongs to From *User `json:"from"` // Performer of the action, which resulted in the change Date int `json:"date"` // Date the change was done in Unix time OldChatMember *ChatMember `json:"old_chat_member"` // Previous information about the chat member NewChatMember *ChatMember `json:"new_chat_member"` // New information about the chat member InviteLink *ChatInviteLink `json:"invite_link,omitempty"` // Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. ViaJoinRequest bool `json:"via_join_request,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 ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link,omitempty"` // Optional. True, if the user joined the chat via a chat folder invite link }
This object represents changes in the status of a chat member.
type ChatPermissions ¶
type ChatPermissions struct { CanSendMessages bool `json:"can_send_messages,omitempty"` // Optional. True, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues CanSendAudios bool `json:"can_send_audios,omitempty"` // Optional. True, if the user is allowed to send audios CanSendDocuments bool `json:"can_send_documents,omitempty"` // Optional. True, if the user is allowed to send documents CanSendPhotos bool `json:"can_send_photos,omitempty"` // Optional. True, if the user is allowed to send photos CanSendVideos bool `json:"can_send_videos,omitempty"` // Optional. True, if the user is allowed to send videos CanSendVideoNotes bool `json:"can_send_video_notes,omitempty"` // Optional. True, if the user is allowed to send video notes CanSendVoiceNotes bool `json:"can_send_voice_notes,omitempty"` // Optional. True, if the user is allowed to send voice notes CanSendPolls bool `json:"can_send_polls,omitempty"` // Optional. True, if the user is allowed to send polls CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"` // Optional. True, if the user is allowed to send animations, games, stickers and use inline bots CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"` // Optional. True, if the user is allowed to add web page previews to their messages CanChangeInfo bool `json:"can_change_info,omitempty"` // Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups CanInviteUsers bool `json:"can_invite_users,omitempty"` // Optional. True, if the user is allowed to invite new users to the chat CanPinMessages bool `json:"can_pin_messages,omitempty"` // Optional. True, if the user is allowed to pin messages. Ignored in public supergroups CanManageTopics bool `json:"can_manage_topics,omitempty"` // Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages }
Describes actions that a non-administrator user is allowed to take in a chat.
type ChatPhoto ¶
type ChatPhoto struct { SmallFileID string `json:"small_file_id"` // 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. SmallFileUniqueID string `json:"small_file_unique_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. BigFileID string `json:"big_file_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. BigFileUniqueID string `json:"big_file_unique_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. }
This object represents a chat photo.
type ChatShared ¶
type ChatShared struct {}
This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
type ChosenInlineResult ¶
type ChosenInlineResult struct { ResultID string `json:"result_id"` // The unique identifier for the result that was chosen From *User `json:"from"` // The user that chose the result Location *Location `json:"location,omitempty"` // Optional. Sender location, only for bots that require user location InlineMessageID string `json:"inline_message_id,omitempty"` // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. Query string `json:"query"` // The query that was used to obtain the result }
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 CloseForumTopicRequest ¶
type CloseForumTopicRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) MessageThreadID int64 `json:"message_thread_id"` // Unique identifier for the target message thread of the forum topic }
see Bot.CloseForumTopic(ctx, &CloseForumTopicRequest{})
type CloseGeneralForumTopicRequest ¶
type CloseGeneralForumTopicRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
see Bot.CloseGeneralForumTopic(ctx, &CloseGeneralForumTopicRequest{})
type Contact ¶
type Contact struct { PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Optional. Contact's last name UserID int64 `json:"user_id,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. Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard }
This object represents a phone contact.
type CopyMessageRequest ¶
type CopyMessageRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only FromChatID ChatID `json:"from_chat_id"` // Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) MessageID int `json:"message_id"` // Message identifier in the chat specified in from_chat_id VideoStartTimestamp int `json:"video_start_timestamp,omitempty"` // New start timestamp for the copied video in the message Caption string `json:"caption,omitempty"` // New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the new caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.CopyMessage(ctx, &CopyMessageRequest{})
type CopyMessagesRequest ¶
type CopyMessagesRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only FromChatID ChatID `json:"from_chat_id"` // Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) MessageIds []int `json:"message_ids"` // 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. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the messages silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent messages from forwarding and saving RemoveCaption bool `json:"remove_caption,omitempty"` // Pass True to copy the messages without their captions }
see Bot.CopyMessages(ctx, &CopyMessagesRequest{})
type CopyTextButton ¶
type CopyTextButton struct {
Text string `json:"text"` // The text to be copied to the clipboard; 1-256 characters
}
This object represents an inline keyboard button that copies specified text to the clipboard.
type CreateChatInviteLinkRequest ¶
type CreateChatInviteLinkRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Name string `json:"name,omitempty"` // Invite link name; 0-32 characters ExpireDate int `json:"expire_date,omitempty"` // Point in time (Unix timestamp) when the link will expire MemberLimit int `json:"member_limit,omitempty"` // The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 CreatesJoinRequest bool `json:"creates_join_request,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 }
see Bot.CreateChatInviteLink(ctx, &CreateChatInviteLinkRequest{})
type CreateChatSubscriptionInviteLinkRequest ¶
type CreateChatSubscriptionInviteLinkRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) Name string `json:"name,omitempty"` // Invite link name; 0-32 characters SubscriptionPeriod int `json:"subscription_period"` // The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). SubscriptionPrice int `json:"subscription_price"` // The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 }
see Bot.CreateChatSubscriptionInviteLink(ctx, &CreateChatSubscriptionInviteLinkRequest{})
type CreateForumTopicRequest ¶
type CreateForumTopicRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) Name string `json:"name"` // Topic name, 1-128 characters IconColor int `json:"icon_color,omitempty"` // 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) IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. }
see Bot.CreateForumTopic(ctx, &CreateForumTopicRequest{})
type CreateInvoiceLinkRequest ¶
type CreateInvoiceLinkRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only. Title string `json:"title"` // Product name, 1-32 characters Description string `json:"description"` // Product description, 1-255 characters Payload string `json:"payload"` // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. ProviderToken string `json:"provider_token,omitempty"` // Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. Currency string `json:"currency"` // Three-letter ISO 4217 currency code, see more on currencies. Pass "XTR" for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` // 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. SubscriptionPeriod int `json:"subscription_period,omitempty"` // 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 2500 Telegram Stars. MaxTipAmount int `json:"max_tip_amount,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. SuggestedTipAmounts []int `json:"suggested_tip_amounts,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. ProviderData string `json:"provider_data,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. PhotoUrl string `json:"photo_url,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. PhotoSize int `json:"photo_size,omitempty"` // Photo size in bytes PhotoWidth int `json:"photo_width,omitempty"` // Photo width PhotoHeight int `json:"photo_height,omitempty"` // Photo height NeedName bool `json:"need_name,omitempty"` // Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. NeedPhoneNumber bool `json:"need_phone_number,omitempty"` // Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. NeedEmail bool `json:"need_email,omitempty"` // Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. NeedShippingAddress bool `json:"need_shipping_address,omitempty"` // Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` // Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` // Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. IsFlexible bool `json:"is_flexible,omitempty"` // Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. }
see Bot.CreateInvoiceLink(ctx, &CreateInvoiceLinkRequest{})
type CreateNewStickerSetRequest ¶
type CreateNewStickerSetRequest struct { UserID int64 `json:"user_id"` // User identifier of created sticker set owner Name string `json:"name"` // Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters. Title string `json:"title"` // Sticker set title, 1-64 characters Stickers []InputSticker `json:"stickers"` // A JSON-serialized list of 1-50 initial stickers to be added to the sticker set StickerType string `json:"sticker_type,omitempty"` // Type of stickers in the set, pass "regular", "mask", or "custom_emoji". By default, a regular sticker set is created. NeedsRepainting bool `json:"needs_repainting,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 }
see Bot.CreateNewStickerSet(ctx, &CreateNewStickerSetRequest{})
type DeclineChatJoinRequest ¶ added in v0.0.8
type DeclineChatJoinRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user }
see Bot.DeclineChatJoinRequest(ctx, &DeclineChatJoinRequest{})
type DeleteChatPhotoRequest ¶
type DeleteChatPhotoRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
see Bot.DeleteChatPhoto(ctx, &DeleteChatPhotoRequest{})
type DeleteChatStickerSetRequest ¶
type DeleteChatStickerSetRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
see Bot.DeleteChatStickerSet(ctx, &DeleteChatStickerSetRequest{})
type DeleteForumTopicRequest ¶
type DeleteForumTopicRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) MessageThreadID int64 `json:"message_thread_id"` // Unique identifier for the target message thread of the forum topic }
see Bot.DeleteForumTopic(ctx, &DeleteForumTopicRequest{})
type DeleteMessageRequest ¶
type DeleteMessageRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // Identifier of the message to delete }
see Bot.DeleteMessage(ctx, &DeleteMessageRequest{})
type DeleteMessagesRequest ¶
type DeleteMessagesRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageIds []int `json:"message_ids"` // A JSON-serialized list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted }
see Bot.DeleteMessages(ctx, &DeleteMessagesRequest{})
type DeleteMyCommandsRequest ¶
type DeleteMyCommandsRequest struct { Scope *BotCommandScope `json:"scope,omitempty"` // A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. LanguageCode string `json:"language_code,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 }
see Bot.DeleteMyCommands(ctx, &DeleteMyCommandsRequest{})
type DeleteStickerFromSetRequest ¶
type DeleteStickerFromSetRequest struct {
Sticker string `json:"sticker"` // File identifier of the sticker
}
see Bot.DeleteStickerFromSet(ctx, &DeleteStickerFromSetRequest{})
type DeleteStickerSetRequest ¶
type DeleteStickerSetRequest struct {
Name string `json:"name"` // Sticker set name
}
see Bot.DeleteStickerSet(ctx, &DeleteStickerSetRequest{})
type DeleteWebhookRequest ¶
type DeleteWebhookRequest struct {
DropPendingUpdates bool `json:"drop_pending_updates,omitempty"` // Pass True to drop all pending updates
}
see Bot.DeleteWebhook(ctx, &DeleteWebhookRequest{})
type Dice ¶
type Dice struct { Emoji string `json:"emoji"` // Emoji on which the dice throw animation is based Value int `json:"value"` // Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji }
This object represents an animated emoji that displays a random value.
type Document ¶
type Document struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Document thumbnail as defined by the sender FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by the sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender FileSize int `json:"file_size,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. }
This object represents a general file (as opposed to photos, voice messages and audio files).
type EditChatInviteLinkRequest ¶
type EditChatInviteLinkRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) InviteLink string `json:"invite_link"` // The invite link to edit Name string `json:"name,omitempty"` // Invite link name; 0-32 characters ExpireDate int `json:"expire_date,omitempty"` // Point in time (Unix timestamp) when the link will expire MemberLimit int `json:"member_limit,omitempty"` // The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 CreatesJoinRequest bool `json:"creates_join_request,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 }
see Bot.EditChatInviteLink(ctx, &EditChatInviteLinkRequest{})
type EditChatSubscriptionInviteLinkRequest ¶
type EditChatSubscriptionInviteLinkRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) InviteLink string `json:"invite_link"` // The invite link to edit Name string `json:"name,omitempty"` // Invite link name; 0-32 characters }
see Bot.EditChatSubscriptionInviteLink(ctx, &EditChatSubscriptionInviteLinkRequest{})
type EditForumTopicRequest ¶
type EditForumTopicRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) MessageThreadID int64 `json:"message_thread_id"` // Unique identifier for the target message thread of the forum topic Name string `json:"name,omitempty"` // New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept IconCustomEmojiID string `json:"icon_custom_emoji_id,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 }
see Bot.EditForumTopic(ctx, &EditForumTopicRequest{})
type EditGeneralForumTopicRequest ¶
type EditGeneralForumTopicRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) Name string `json:"name"` // New topic name, 1-128 characters }
see Bot.EditGeneralForumTopic(ctx, &EditGeneralForumTopicRequest{})
type EditMessageCaptionRequest ¶
type EditMessageCaptionRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message Caption string `json:"caption,omitempty"` // New caption of the message, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the message caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. }
see Bot.EditMessageCaption(ctx, &EditMessageCaptionRequest{})
type EditMessageLiveLocationRequest ¶
type EditMessageLiveLocationRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message Latitude float64 `json:"latitude"` // Latitude of new location Longitude float64 `json:"longitude"` // Longitude of new location LivePeriod int `json:"live_period,omitempty"` // 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 HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // The radius of uncertainty for the location, measured in meters; 0-1500 Heading int `json:"heading,omitempty"` // Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` // The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new inline keyboard. }
see Bot.EditMessageLiveLocation(ctx, &EditMessageLiveLocationRequest{})
type EditMessageMediaRequest ¶
type EditMessageMediaRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message Media InputMedia `json:"media"` // A JSON-serialized object for a new media content of the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new inline keyboard. }
see Bot.EditMessageMedia(ctx, &EditMessageMediaRequest{})
type EditMessageReplyMarkupRequest ¶
type EditMessageReplyMarkupRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. }
see Bot.EditMessageReplyMarkup(ctx, &EditMessageReplyMarkupRequest{})
type EditMessageTextRequest ¶
type EditMessageTextRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message to edit InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message Text string `json:"text"` // New text of the message, 1-4096 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the message text. See formatting options for more details. Entities []MessageEntity `json:"entities,omitempty"` // A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Link preview generation options for the message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. }
see Bot.EditMessageText(ctx, &EditMessageTextRequest{})
type EditUserStarSubscriptionRequest ¶
type EditUserStarSubscriptionRequest struct { UserID int64 `json:"user_id"` // Identifier of the user whose subscription will be edited TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Telegram payment identifier for the subscription IsCanceled bool `json:"is_canceled"` // 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. }
see Bot.EditUserStarSubscription(ctx, &EditUserStarSubscriptionRequest{})
type EncryptedCredentials ¶
type EncryptedCredentials struct { Data string `json:"data"` // Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication Hash string `json:"hash"` // Base64-encoded data hash for data authentication Secret string `json:"secret"` // Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption }
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 { Type string `json:"type"` // Element type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email". Data string `json:"data,omitempty"` // Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types. Can be decrypted and verified using the accompanying EncryptedCredentials. PhoneNumber string `json:"phone_number,omitempty"` // Optional. User's verified phone number; available only for "phone_number" type Email string `json:"email,omitempty"` // Optional. User's verified email address; available only for "email" type Files []PassportFile `json:"files,omitempty"` // Optional. Array of encrypted files with documents provided by the user; available only for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials. FrontSide *PassportFile `json:"front_side,omitempty"` // Optional. Encrypted file with the front side of the document, provided by the user; available only for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials. ReverseSide *PassportFile `json:"reverse_side,omitempty"` // Optional. Encrypted file with the reverse side of the document, provided by the user; available only for "driver_license" and "identity_card". The file can be decrypted and verified using the accompanying EncryptedCredentials. Selfie *PassportFile `json:"selfie,omitempty"` // Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials. Translation []PassportFile `json:"translation,omitempty"` // Optional. Array of encrypted files with translated versions of documents provided by the user; available if requested for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials. Hash string `json:"hash"` // Base64-encoded element hash for using in PassportElementErrorUnspecified }
Describes documents or other Telegram Passport elements shared with the bot by the user.
type ErrDownloadFile ¶
func (ErrDownloadFile) Error ¶
func (e ErrDownloadFile) Error() string
type ExportChatInviteLinkRequest ¶
type ExportChatInviteLinkRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
see Bot.ExportChatInviteLink(ctx, &ExportChatInviteLinkRequest{})
type ExternalReplyInfo ¶
type ExternalReplyInfo struct { Origin *MessageOrigin `json:"origin"` // Origin of the message replied to by the given message Chat *Chat `json:"chat,omitempty"` // Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel. MessageID int `json:"message_id,omitempty"` // Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Optional. Options used for link preview generation for the original message, if it is a text message Animation *Animation `json:"animation,omitempty"` // Optional. Message is an animation, information about the animation Audio *Audio `json:"audio,omitempty"` // Optional. Message is an audio file, information about the file Document *Document `json:"document,omitempty"` // Optional. Message is a general file, information about the file PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"` // Optional. Message contains paid media; information about the paid media Photo []PhotoSize `json:"photo,omitempty"` // Optional. Message is a photo, available sizes of the photo Sticker *Sticker `json:"sticker,omitempty"` // Optional. Message is a sticker, information about the sticker Story *Story `json:"story,omitempty"` // Optional. Message is a forwarded story Video *Video `json:"video,omitempty"` // Optional. Message is a video, information about the video VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a video note, information about the video message Voice *Voice `json:"voice,omitempty"` // Optional. Message is a voice message, information about the file HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"` // Optional. True, if the message media is covered by a spoiler animation Contact *Contact `json:"contact,omitempty"` // Optional. Message is a shared contact, information about the contact Dice *Dice `json:"dice,omitempty"` // Optional. Message is a dice with random value Game *Game `json:"game,omitempty"` // Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games Giveaway *Giveaway `json:"giveaway,omitempty"` // Optional. Message is a scheduled giveaway, information about the giveaway GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` // Optional. A giveaway with public winners was completed Invoice *Invoice `json:"invoice,omitempty"` // Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments Location *Location `json:"location,omitempty"` // Optional. Message is a shared location, information about the location Poll *Poll `json:"poll,omitempty"` // Optional. Message is a native poll, information about the poll Venue *Venue `json:"venue,omitempty"` // Optional. Message is a venue, information about the venue }
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 { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. FileSize int `json:"file_size,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. FilePath string `json:"file_path,omitempty"` // Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the 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 ForceReply ¶
type ForceReply struct { ForceReply bool `json:"force_reply"` // Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` // Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters Selective bool `json:"selective,omitempty"` // Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. }
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.
type ForumTopic ¶
type ForumTopic struct { MessageThreadID int64 `json:"message_thread_id"` // Unique identifier of the forum topic Name string `json:"name"` // Name of the topic IconColor int `json:"icon_color"` // Color of the topic icon in RGB format IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Optional. Unique identifier of the custom emoji shown as the topic icon }
This object represents a forum topic.
type ForumTopicClosed ¶
type ForumTopicClosed interface{}
This object represents a service message about a forum topic closed in the chat. Currently holds no information.
type ForumTopicCreated ¶
type ForumTopicCreated struct { Name string `json:"name"` // Name of the topic IconColor int `json:"icon_color"` // Color of the topic icon in RGB format IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` // Optional. Unique identifier of the custom emoji shown as the topic icon }
This object represents a service message about a new forum topic created in the chat.
type ForumTopicEdited ¶
type ForumTopicEdited struct { Name string `json:"name,omitempty"` // Optional. New name of the topic, if it was edited IconCustomEmojiID string `json:"icon_custom_emoji_id,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 }
This object represents a service message about an edited forum topic.
type ForumTopicReopened ¶
type ForumTopicReopened interface{}
This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
type ForwardMessageRequest ¶
type ForwardMessageRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only FromChatID ChatID `json:"from_chat_id"` // Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) VideoStartTimestamp int `json:"video_start_timestamp,omitempty"` // New start timestamp for the forwarded video in the message DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the forwarded message from forwarding and saving MessageID int `json:"message_id"` // Message identifier in the chat specified in from_chat_id }
see Bot.ForwardMessage(ctx, &ForwardMessageRequest{})
type ForwardMessagesRequest ¶
type ForwardMessagesRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only FromChatID ChatID `json:"from_chat_id"` // Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) MessageIds []int `json:"message_ids"` // 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. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the messages silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the forwarded messages from forwarding and saving }
see Bot.ForwardMessages(ctx, &ForwardMessagesRequest{})
type Game ¶
type Game struct { Title string `json:"title"` // Title of the game Description string `json:"description"` // Description of the game Photo []PhotoSize `json:"photo"` // Photo that will be displayed in the game message in chats. Text string `json:"text,omitempty"` // Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. Animation *Animation `json:"animation,omitempty"` // Optional. Animation that will be displayed in the game message in chats. Upload via BotFather }
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 int `json:"position"` // Position in high score table for the game User *User `json:"user"` // User Score int `json:"score"` // Score }
This object represents one row of the high scores table for a game.
type GeneralForumTopicHidden ¶
type GeneralForumTopicHidden interface{}
This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
type GeneralForumTopicUnhidden ¶
type GeneralForumTopicUnhidden interface{}
This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
https://core.telegram.org/bots/api#generalforumtopicunhidden
type GetBusinessConnectionRequest ¶
type GetBusinessConnectionRequest struct {
BusinessConnectionID string `json:"business_connection_id"` // Unique identifier of the business connection
}
see Bot.GetBusinessConnection(ctx, &GetBusinessConnectionRequest{})
type GetChatAdministratorsRequest ¶
type GetChatAdministratorsRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
see Bot.GetChatAdministrators(ctx, &GetChatAdministratorsRequest{})
type GetChatMemberCountRequest ¶
type GetChatMemberCountRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
see Bot.GetChatMemberCount(ctx, &GetChatMemberCountRequest{})
type GetChatMemberRequest ¶
type GetChatMemberRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user }
see Bot.GetChatMember(ctx, &GetChatMemberRequest{})
type GetChatMenuButtonRequest ¶
type GetChatMenuButtonRequest struct {
ChatID int64 `json:"chat_id,omitempty"` // Unique identifier for the target private chat. If not specified, default bot's menu button will be returned
}
see Bot.GetChatMenuButton(ctx, &GetChatMenuButtonRequest{})
type GetChatRequest ¶
type GetChatRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
see Bot.GetChat(ctx, &GetChatRequest{})
type GetCustomEmojiStickersRequest ¶
type GetCustomEmojiStickersRequest struct {
CustomEmojiIds []string `json:"custom_emoji_ids"` // A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
}
see Bot.GetCustomEmojiStickers(ctx, &GetCustomEmojiStickersRequest{})
type GetFileRequest ¶
type GetFileRequest struct {
FileID string `json:"file_id"` // File identifier to get information about
}
see Bot.GetFile(ctx, &GetFileRequest{})
type GetGameHighScoresRequest ¶
type GetGameHighScoresRequest struct { UserID int64 `json:"user_id"` // Target user id ChatID int64 `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the sent message InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message }
see Bot.GetGameHighScores(ctx, &GetGameHighScoresRequest{})
type GetMyCommandsRequest ¶
type GetMyCommandsRequest struct { Scope *BotCommandScope `json:"scope,omitempty"` // A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. LanguageCode string `json:"language_code,omitempty"` // A two-letter ISO 639-1 language code or an empty string }
see Bot.GetMyCommands(ctx, &GetMyCommandsRequest{})
type GetMyDefaultAdministratorRightsRequest ¶
type GetMyDefaultAdministratorRightsRequest struct {
ForChannels bool `json:"for_channels,omitempty"` // 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.
}
see Bot.GetMyDefaultAdministratorRights(ctx, &GetMyDefaultAdministratorRightsRequest{})
type GetMyDescriptionRequest ¶
type GetMyDescriptionRequest struct {
LanguageCode string `json:"language_code,omitempty"` // A two-letter ISO 639-1 language code or an empty string
}
see Bot.GetMyDescription(ctx, &GetMyDescriptionRequest{})
type GetMyNameRequest ¶
type GetMyNameRequest struct {
LanguageCode string `json:"language_code,omitempty"` // A two-letter ISO 639-1 language code or an empty string
}
see Bot.GetMyName(ctx, &GetMyNameRequest{})
type GetMyShortDescriptionRequest ¶
type GetMyShortDescriptionRequest struct {
LanguageCode string `json:"language_code,omitempty"` // A two-letter ISO 639-1 language code or an empty string
}
see Bot.GetMyShortDescription(ctx, &GetMyShortDescriptionRequest{})
type GetStarTransactionsRequest ¶
type GetStarTransactionsRequest struct { Offset int64 `json:"offset,omitempty"` // Number of transactions to skip in the response Limit int `json:"limit,omitempty"` // The maximum number of transactions to be retrieved. Values between 1-100 are accepted. Defaults to 100. }
see Bot.GetStarTransactions(ctx, &GetStarTransactionsRequest{})
type GetStickerSetRequest ¶
type GetStickerSetRequest struct {
Name string `json:"name"` // Name of the sticker set
}
see Bot.GetStickerSet(ctx, &GetStickerSetRequest{})
type GetUpdatesRequest ¶
type GetUpdatesRequest struct { Offset int64 `json:"offset,omitempty"` // Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten. Limit int `json:"limit,omitempty"` // Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. Timeout int `json:"timeout,omitempty"` // Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. AllowedUpdates []UpdateType `json:"allowed_updates,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. }
see Bot.GetUpdates(ctx, &GetUpdatesRequest{})
type GetUserChatBoostsRequest ¶
type GetUserChatBoostsRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the chat or username of the channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user }
see Bot.GetUserChatBoosts(ctx, &GetUserChatBoostsRequest{})
type GetUserProfilePhotosRequest ¶
type GetUserProfilePhotosRequest struct { UserID int64 `json:"user_id"` // Unique identifier of the target user Offset int64 `json:"offset,omitempty"` // Sequential number of the first photo to be returned. By default, all photos are returned. Limit int `json:"limit,omitempty"` // Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. }
see Bot.GetUserProfilePhotos(ctx, &GetUserProfilePhotosRequest{})
type Gift ¶
type Gift struct { ID string `json:"id"` // Unique identifier of the gift Sticker *Sticker `json:"sticker"` // The sticker that represents the gift StarCount int `json:"star_count"` // The number of Telegram Stars that must be paid to send the sticker UpgradeStarCount int `json:"upgrade_star_count,omitempty"` // Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one TotalCount int `json:"total_count,omitempty"` // Optional. The total number of the gifts of this type that can be sent; for limited gifts only RemainingCount int `json:"remaining_count,omitempty"` // Optional. The number of remaining gifts of this type that can be sent; for limited gifts only }
This object represents a gift that can be sent by the bot.
type Gifts ¶
type Gifts struct {
Gifts []Gift `json:"gifts"` // The list of gifts
}
This object represent a list of gifts.
type Giveaway ¶
type Giveaway struct { Chats []Chat `json:"chats"` // The list of chats which the user must join to participate in the giveaway WinnersSelectionDate int `json:"winners_selection_date"` // Point in time (Unix timestamp) when winners of the giveaway will be selected WinnerCount int `json:"winner_count"` // The number of users which are supposed to be selected as winners of the giveaway OnlyNewMembers bool `json:"only_new_members,omitempty"` // Optional. True, if only users who join the chats after the giveaway started should be eligible to win HasPublicWinners bool `json:"has_public_winners,omitempty"` // Optional. True, if the list of giveaway winners will be visible to everyone PrizeDescription string `json:"prize_description,omitempty"` // Optional. Description of additional giveaway prize CountryCodes []string `json:"country_codes,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. PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` // Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only }
This object represents a message about a scheduled giveaway.
type GiveawayCompleted ¶
type GiveawayCompleted struct { WinnerCount int `json:"winner_count"` // Number of winners in the giveaway UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` // Optional. Number of undistributed prizes GiveawayMessage *Message `json:"giveaway_message,omitempty"` // Optional. Message with the giveaway that was completed, if it wasn't deleted IsStarGiveaway bool `json:"is_star_giveaway,omitempty"` // Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. }
This object represents a service message about the completion of a giveaway without public winners.
type GiveawayCreated ¶
type GiveawayCreated struct {
PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only
}
This object represents a service message about the creation of a scheduled giveaway.
type GiveawayWinners ¶
type GiveawayWinners struct { Chat *Chat `json:"chat"` // The chat that created the giveaway GiveawayMessageID int64 `json:"giveaway_message_id"` // Identifier of the message with the giveaway in the chat WinnersSelectionDate int `json:"winners_selection_date"` // Point in time (Unix timestamp) when winners of the giveaway were selected WinnerCount int `json:"winner_count"` // Total number of winners in the giveaway Winners []User `json:"winners"` // List of up to 100 winners of the giveaway AdditionalChatCount int `json:"additional_chat_count,omitempty"` // Optional. The number of other chats the user had to join in order to be eligible for the giveaway PrizeStarCount int `json:"prize_star_count,omitempty"` // Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` // Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` // Optional. Number of undistributed prizes OnlyNewMembers bool `json:"only_new_members,omitempty"` // Optional. True, if only users who had joined the chats after the giveaway started were eligible to win WasRefunded bool `json:"was_refunded,omitempty"` // Optional. True, if the giveaway was canceled because the payment for it was refunded PrizeDescription string `json:"prize_description,omitempty"` // Optional. Description of additional giveaway prize }
This object represents a message about the completion of a giveaway with public winners.
type HideGeneralForumTopicRequest ¶
type HideGeneralForumTopicRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
see Bot.HideGeneralForumTopic(ctx, &HideGeneralForumTopicRequest{})
type InlineKeyboardButton ¶
type InlineKeyboardButton struct { Text string `json:"text"` // Label text on the button Url string `json:"url,omitempty"` // Optional. HTTP or tg:// URL to be opened when 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. CallbackData string `json:"callback_data,omitempty"` // Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes WebApp *WebAppInfo `json:"web_app,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. LoginUrl *LoginUrl `json:"login_url,omitempty"` // Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. SwitchInlineQuery string `json:"switch_inline_query,omitempty"` // Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account. SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"` // Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. 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 on behalf of a Telegram Business account. SwitchInlineQueryChosenChat *SwitchInlineQueryChosenChat `json:"switch_inline_query_chosen_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 on behalf of a Telegram Business account. CopyText *CopyTextButton `json:"copy_text,omitempty"` // Optional. Description of the button that copies the specified text to the clipboard. CallbackGame CallbackGame `json:"callback_game,omitempty"` // Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row. Pay bool `json:"pay,omitempty"` // Optional. Specify True, to send a Pay button. 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. }
This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.
type InlineKeyboardMarkup ¶
type InlineKeyboardMarkup struct {
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"` // Array of button rows, each represented by an Array of InlineKeyboardButton objects
}
This object represents an inline keyboard that appears right next to the message it belongs to.
type InlineQuery ¶
type InlineQuery struct { ID string `json:"id"` // Unique identifier for this query From *User `json:"from"` // Sender Query string `json:"query"` // Text of the query (up to 256 characters) Offset string `json:"offset"` // Offset of the results to be returned, can be controlled by the bot ChatType InlineQueryChatType `json:"chat_type,omitempty"` // 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 Location *Location `json:"location,omitempty"` // Optional. Sender location, only for bots that request user location }
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
type InlineQueryChatType ¶
type InlineQueryChatType string
const ( InlineQueryChatTypeSender InlineQueryChatType = "sender" InlineQueryChatTypePrivate InlineQueryChatType = "private" InlineQueryChatTypeGroup InlineQueryChatType = "group" InlineQueryChatTypeSupergroup InlineQueryChatType = "supergroup" InlineQueryChatTypeChannel InlineQueryChatType = "channel" )
type InlineQueryResult ¶
type InlineQueryResult interface{}
This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
- InlineQueryResultCachedAudio
- InlineQueryResultCachedDocument
- InlineQueryResultCachedGif
- InlineQueryResultCachedMpeg4Gif
- InlineQueryResultCachedPhoto
- InlineQueryResultCachedSticker
- InlineQueryResultCachedVideo
- InlineQueryResultCachedVoice
- InlineQueryResultArticle
- InlineQueryResultAudio
- InlineQueryResultContact
- InlineQueryResultGame
- InlineQueryResultDocument
- InlineQueryResultGif
- InlineQueryResultLocation
- InlineQueryResultMpeg4Gif
- InlineQueryResultPhoto
- InlineQueryResultVenue
- InlineQueryResultVideo
- InlineQueryResultVoice
Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.
type InlineQueryResultArticle ¶
type InlineQueryResultArticle struct { Type string `json:"type"` // Type of the result, must be article ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Title string `json:"title"` // Title of the result InputMessageContent InputMessageContent `json:"input_message_content"` // Content of the message to be sent ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message Url string `json:"url,omitempty"` // Optional. URL of the result Description string `json:"description,omitempty"` // Optional. Short description of the result ThumbnailUrl string `json:"thumbnail_url,omitempty"` // Optional. Url of the thumbnail for the result ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail width ThumbnailHeight int `json:"thumbnail_height,omitempty"` // Optional. Thumbnail height }
Represents a link to an article or web page.
type InlineQueryResultAudio ¶
type InlineQueryResultAudio struct { Type string `json:"type"` // Type of the result, must be audio ID string `json:"id"` // Unique identifier for this result, 1-64 bytes AudioUrl string `json:"audio_url"` // A valid URL for the audio file Title string `json:"title"` // Title Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the audio caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode Performer string `json:"performer,omitempty"` // Optional. Performer AudioDuration int `json:"audio_duration,omitempty"` // Optional. Audio duration in seconds ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the audio }
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 string `json:"type"` // Type of the result, must be audio ID string `json:"id"` // Unique identifier for this result, 1-64 bytes AudioFileID string `json:"audio_file_id"` // A valid file identifier for the audio file Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the audio caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the audio }
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.
https://core.telegram.org/bots/api#inlinequeryresultcachedaudio
type InlineQueryResultCachedDocument ¶
type InlineQueryResultCachedDocument struct { Type string `json:"type"` // Type of the result, must be document ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Title string `json:"title"` // Title for the result DocumentFileID string `json:"document_file_id"` // A valid file identifier for the file Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the document caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the file }
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.
https://core.telegram.org/bots/api#inlinequeryresultcacheddocument
type InlineQueryResultCachedGif ¶
type InlineQueryResultCachedGif struct { Type string `json:"type"` // Type of the result, must be gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes GifFileID string `json:"gif_file_id"` // A valid file identifier for the GIF file Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the GIF animation }
Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.
https://core.telegram.org/bots/api#inlinequeryresultcachedgif
type InlineQueryResultCachedMpeg4Gif ¶
type InlineQueryResultCachedMpeg4Gif struct { Type string `json:"type"` // Type of the result, must be mpeg4_gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Mpeg4FileID string `json:"mpeg4_file_id"` // A valid file identifier for the MPEG4 file Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video animation }
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif
type InlineQueryResultCachedPhoto ¶
type InlineQueryResultCachedPhoto struct { Type string `json:"type"` // Type of the result, must be photo ID string `json:"id"` // Unique identifier for this result, 1-64 bytes PhotoFileID string `json:"photo_file_id"` // A valid file identifier of the photo Title string `json:"title,omitempty"` // Optional. Title for the result Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the photo caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the photo }
Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
https://core.telegram.org/bots/api#inlinequeryresultcachedphoto
type InlineQueryResultCachedSticker ¶
type InlineQueryResultCachedSticker struct { Type string `json:"type"` // Type of the result, must be sticker ID string `json:"id"` // Unique identifier for this result, 1-64 bytes StickerFileID string `json:"sticker_file_id"` // A valid file identifier of the sticker ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the sticker }
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.
https://core.telegram.org/bots/api#inlinequeryresultcachedsticker
type InlineQueryResultCachedVideo ¶
type InlineQueryResultCachedVideo struct { Type string `json:"type"` // Type of the result, must be video ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VideoFileID string `json:"video_file_id"` // A valid file identifier for the video file Title string `json:"title"` // Title for the result Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the video caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video }
Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
https://core.telegram.org/bots/api#inlinequeryresultcachedvideo
type InlineQueryResultCachedVoice ¶
type InlineQueryResultCachedVoice struct { Type string `json:"type"` // Type of the result, must be voice ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VoiceFileID string `json:"voice_file_id"` // A valid file identifier for the voice message Title string `json:"title"` // Voice message title Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the voice message }
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.
https://core.telegram.org/bots/api#inlinequeryresultcachedvoice
type InlineQueryResultContact ¶
type InlineQueryResultContact struct { Type string `json:"type"` // Type of the result, must be contact ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Optional. Contact's last name Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the contact ThumbnailUrl string `json:"thumbnail_url,omitempty"` // Optional. Url of the thumbnail for the result ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail width ThumbnailHeight int `json:"thumbnail_height,omitempty"` // Optional. Thumbnail height }
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 string `json:"type"` // Type of the result, must be document ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Title string `json:"title"` // Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the document caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode DocumentUrl string `json:"document_url"` // A valid URL for the file MimeType string `json:"mime_type"` // MIME type of the content of the file, either "application/pdf" or "application/zip" Description string `json:"description,omitempty"` // Optional. Short description of the result ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the file ThumbnailUrl string `json:"thumbnail_url,omitempty"` // Optional. URL of the thumbnail (JPEG only) for the file ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail width ThumbnailHeight int `json:"thumbnail_height,omitempty"` // Optional. Thumbnail height }
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.
https://core.telegram.org/bots/api#inlinequeryresultdocument
type InlineQueryResultGame ¶
type InlineQueryResultGame struct { Type string `json:"type"` // Type of the result, must be game ID string `json:"id"` // Unique identifier for this result, 1-64 bytes GameShortName string `json:"game_short_name"` // Short name of the game ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message }
Represents a Game.
type InlineQueryResultGif ¶
type InlineQueryResultGif struct { Type string `json:"type"` // Type of the result, must be gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes GifUrl string `json:"gif_url"` // A valid URL for the GIF file GifWidth int `json:"gif_width,omitempty"` // Optional. Width of the GIF GifHeight int `json:"gif_height,omitempty"` // Optional. Height of the GIF GifDuration int `json:"gif_duration,omitempty"` // Optional. Duration of the GIF in seconds ThumbnailUrl string `json:"thumbnail_url"` // URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result ThumbnailMimeType string `json:"thumbnail_mime_type,omitempty"` // Optional. MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the GIF animation }
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 string `json:"type"` // Type of the result, must be location ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Latitude float64 `json:"latitude"` // Location latitude in degrees Longitude float64 `json:"longitude"` // Location longitude in degrees Title string `json:"title"` // Location title HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500 LivePeriod int `json:"live_period,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. Heading int `json:"heading,omitempty"` // Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. ProximityAlertRadius int `json:"proximity_alert_radius,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. ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the location ThumbnailUrl string `json:"thumbnail_url,omitempty"` // Optional. Url of the thumbnail for the result ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail width ThumbnailHeight int `json:"thumbnail_height,omitempty"` // Optional. Thumbnail height }
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.
https://core.telegram.org/bots/api#inlinequeryresultlocation
type InlineQueryResultMpeg4Gif ¶
type InlineQueryResultMpeg4Gif struct { Type string `json:"type"` // Type of the result, must be mpeg4_gif ID string `json:"id"` // Unique identifier for this result, 1-64 bytes Mpeg4Url string `json:"mpeg4_url"` // A valid URL for the MPEG4 file Mpeg4Width int `json:"mpeg4_width,omitempty"` // Optional. Video width Mpeg4Height int `json:"mpeg4_height,omitempty"` // Optional. Video height Mpeg4Duration int `json:"mpeg4_duration,omitempty"` // Optional. Video duration in seconds ThumbnailUrl string `json:"thumbnail_url"` // URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result ThumbnailMimeType string `json:"thumbnail_mime_type,omitempty"` // Optional. MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" Title string `json:"title,omitempty"` // Optional. Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video animation }
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif
type InlineQueryResultPhoto ¶
type InlineQueryResultPhoto struct { Type string `json:"type"` // Type of the result, must be photo ID string `json:"id"` // Unique identifier for this result, 1-64 bytes PhotoUrl string `json:"photo_url"` // A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB ThumbnailUrl string `json:"thumbnail_url"` // URL of the thumbnail for the photo PhotoWidth int `json:"photo_width,omitempty"` // Optional. Width of the photo PhotoHeight int `json:"photo_height,omitempty"` // Optional. Height of the photo Title string `json:"title,omitempty"` // Optional. Title for the result Description string `json:"description,omitempty"` // Optional. Short description of the result Caption string `json:"caption,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the photo caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the photo }
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 string `json:"type"` // Type of the result, must be venue ID string `json:"id"` // Unique identifier for this result, 1-64 Bytes Latitude float64 `json:"latitude"` // Latitude of the venue location in degrees Longitude float64 `json:"longitude"` // Longitude of the venue location in degrees Title string `json:"title"` // Title of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue if known FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) GooglePlaceID string `json:"google_place_id,omitempty"` // Optional. Google Places identifier of the venue GooglePlaceType string `json:"google_place_type,omitempty"` // Optional. Google Places type of the venue. (See supported types.) ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the venue ThumbnailUrl string `json:"thumbnail_url,omitempty"` // Optional. Url of the thumbnail for the result ThumbnailWidth int `json:"thumbnail_width,omitempty"` // Optional. Thumbnail width ThumbnailHeight int `json:"thumbnail_height,omitempty"` // Optional. Thumbnail height }
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 string `json:"type"` // Type of the result, must be video ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VideoUrl string `json:"video_url"` // A valid URL for the embedded video player or video file MimeType string `json:"mime_type"` // MIME type of the content of the video URL, "text/html" or "video/mp4" ThumbnailUrl string `json:"thumbnail_url"` // URL of the thumbnail (JPEG only) for the video Title string `json:"title"` // Title for the result Caption string `json:"caption,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the video caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media VideoWidth int `json:"video_width,omitempty"` // Optional. Video width VideoHeight int `json:"video_height,omitempty"` // Optional. Video height VideoDuration int `json:"video_duration,omitempty"` // Optional. Video duration in seconds Description string `json:"description,omitempty"` // Optional. Short description of the result ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). }
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 string `json:"type"` // Type of the result, must be voice ID string `json:"id"` // Unique identifier for this result, 1-64 bytes VoiceUrl string `json:"voice_url"` // A valid URL for the voice recording Title string `json:"title"` // Recording title Caption string `json:"caption,omitempty"` // Optional. Caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode VoiceDuration int `json:"voice_duration,omitempty"` // Optional. Recording duration in seconds ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message InputMessageContent InputMessageContent `json:"input_message_content,omitempty"` // Optional. Content of the message to be sent instead of the voice recording }
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 { Text string `json:"text"` // Label text on the button WebApp *WebAppInfo `json:"web_app,omitempty"` // 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. StartParameter string `json:"start_parameter,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. }
This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
type InputContactMessageContent ¶
type InputContactMessageContent struct { PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Optional. Contact's last name Vcard string `json:"vcard,omitempty"` // Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes }
Represents the content of a contact message to be sent as the result of an inline query.
https://core.telegram.org/bots/api#inputcontactmessagecontent
type InputFile ¶
type InputFile struct { FileID string Reader NamedReader }
This object represents the contents of a file to be uploaded.
You can use file id of existing file or any struct that implements NamedReader interface. Also you can use a url in the file id field to send files from the internet. If FileId and Reader are both set, file id will be used.
See goram.NameReader also.
func (InputFile) MarshalJSON ¶ added in v0.0.8
type InputInvoiceMessageContent ¶
type InputInvoiceMessageContent struct { Title string `json:"title"` // Product name, 1-32 characters Description string `json:"description"` // Product description, 1-255 characters Payload string `json:"payload"` // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. ProviderToken string `json:"provider_token,omitempty"` // Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. Currency string `json:"currency"` // Three-letter ISO 4217 currency code, see more on currencies. Pass "XTR" for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` // 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. MaxTipAmount int `json:"max_tip_amount,omitempty"` // 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. SuggestedTipAmounts []int `json:"suggested_tip_amounts,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. ProviderData string `json:"provider_data,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. PhotoUrl string `json:"photo_url,omitempty"` // Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. PhotoSize int `json:"photo_size,omitempty"` // Optional. Photo size in bytes PhotoWidth int `json:"photo_width,omitempty"` // Optional. Photo width PhotoHeight int `json:"photo_height,omitempty"` // Optional. Photo height NeedName bool `json:"need_name,omitempty"` // Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. NeedPhoneNumber bool `json:"need_phone_number,omitempty"` // Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. NeedEmail bool `json:"need_email,omitempty"` // Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. NeedShippingAddress bool `json:"need_shipping_address,omitempty"` // Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` // Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` // Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. IsFlexible bool `json:"is_flexible,omitempty"` // Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. }
Represents the content of an invoice message to be sent as the result of an inline query.
https://core.telegram.org/bots/api#inputinvoicemessagecontent
type InputLocationMessageContent ¶
type InputLocationMessageContent struct { Latitude float64 `json:"latitude"` // Latitude of the location in degrees Longitude float64 `json:"longitude"` // Longitude of the location in degrees HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500 LivePeriod int `json:"live_period,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. Heading int `json:"heading,omitempty"` // Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. ProximityAlertRadius int `json:"proximity_alert_radius,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. }
Represents the content of a location message to be sent as the result of an inline query.
https://core.telegram.org/bots/api#inputlocationmessagecontent
type InputMedia ¶
type InputMedia interface {
// contains filtered or unexported methods
}
This object represents the content of a media message to be sent. It should be one of
- InputMediaAnimation
- InputMediaDocument
- InputMediaAudio
- InputMediaPhoto
- InputMediaVideo
type InputMediaAnimation ¶
type InputMediaAnimation struct { Type string `json:"type"` // Type of the result, must be animation Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Thumbnail string `json:"thumbnail,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the animation caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media Width int `json:"width,omitempty"` // Optional. Animation width Height int `json:"height,omitempty"` // Optional. Animation height Duration int `json:"duration,omitempty"` // Optional. Animation duration in seconds HasSpoiler bool `json:"has_spoiler,omitempty"` // Optional. Pass True if the animation needs to be covered with a spoiler animation }
Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
type InputMediaAudio ¶
type InputMediaAudio struct { Type string `json:"type"` // Type of the result, must be audio Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Thumbnail string `json:"thumbnail,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the audio caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode Duration int `json:"duration,omitempty"` // Optional. Duration of the audio in seconds Performer string `json:"performer,omitempty"` // Optional. Performer of the audio Title string `json:"title,omitempty"` // Optional. Title of the audio }
Represents an audio file to be treated as music to be sent.
type InputMediaDocument ¶
type InputMediaDocument struct { Type string `json:"type"` // Type of the result, must be document Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Thumbnail string `json:"thumbnail,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Optional. Caption of the document to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the document caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode DisableContentTypeDetection bool `json:"disable_content_type_detection,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. }
Represents a general file to be sent.
type InputMediaPhoto ¶
type InputMediaPhoto struct { Type string `json:"type"` // Type of the result, must be photo Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the photo caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media HasSpoiler bool `json:"has_spoiler,omitempty"` // Optional. Pass True if the photo needs to be covered with a spoiler animation }
Represents a photo to be sent.
type InputMediaVideo ¶
type InputMediaVideo struct { Type string `json:"type"` // Type of the result, must be video Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Thumbnail string `json:"thumbnail,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Cover string `json:"cover,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: https://core.telegram.org/bots/api#sending-files StartTimestamp int `json:"start_timestamp,omitempty"` // Optional. Start timestamp for the video in the message Caption string `json:"caption,omitempty"` // Optional. Caption of the video to be sent, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the video caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. Pass True, if the caption must be shown above the message media Width int `json:"width,omitempty"` // Optional. Video width Height int `json:"height,omitempty"` // Optional. Video height Duration int `json:"duration,omitempty"` // Optional. Video duration in seconds SupportsStreaming bool `json:"supports_streaming,omitempty"` // Optional. Pass True if the uploaded video is suitable for streaming HasSpoiler bool `json:"has_spoiler,omitempty"` // Optional. Pass True if the video needs to be covered with a spoiler animation }
Represents a video to be sent.
type InputMessageContent ¶
type InputMessageContent interface{}
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:
- InputTextMessageContent
- InputLocationMessageContent
- InputVenueMessageContent
- InputContactMessageContent
- InputInvoiceMessageContent
type InputPaidMedia ¶
type InputPaidMedia interface{}
This object describes the paid media to be sent. Currently, it can be one of
- InputPaidMediaPhoto
- InputPaidMediaVideo
type InputPaidMediaPhoto ¶
type InputPaidMediaPhoto struct { Type string `json:"type"` // Type of the media, must be photo Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files }
The paid media to send is a photo.
type InputPaidMediaVideo ¶
type InputPaidMediaVideo struct { Type string `json:"type"` // Type of the media, must be video Media InputFile `json:"media"` // File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Thumbnail string `json:"thumbnail,omitempty"` // Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Cover string `json:"cover,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: https://core.telegram.org/bots/api#sending-files StartTimestamp int `json:"start_timestamp,omitempty"` // Optional. Start timestamp for the video in the message Width int `json:"width,omitempty"` // Optional. Video width Height int `json:"height,omitempty"` // Optional. Video height Duration int `json:"duration,omitempty"` // Optional. Video duration in seconds SupportsStreaming bool `json:"supports_streaming,omitempty"` // Optional. Pass True if the uploaded video is suitable for streaming }
The paid media to send is a video.
type InputPollOption ¶
type InputPollOption struct { Text string `json:"text"` // Option text, 1-100 characters TextParseMode string `json:"text_parse_mode,omitempty"` // Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed TextEntities []MessageEntity `json:"text_entities,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 }
This object contains information about one answer option in a poll to be sent.
type InputSticker ¶
type InputSticker struct { Sticker InputFile `json:"sticker"` // The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Format string `json:"format"` // 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 EmojiList []string `json:"emoji_list"` // List of 1-20 emoji associated with the sticker MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Optional. Position where the mask should be placed on faces. For "mask" stickers only. Keywords []string `json:"keywords,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. }
This object describes a sticker to be added to a sticker set.
type InputTextMessageContent ¶
type InputTextMessageContent struct { MessageText string `json:"message_text"` // Text of the message to be sent, 1-4096 characters ParseMode ParseMode `json:"parse_mode,omitempty"` // Optional. Mode for parsing entities in the message text. See formatting options for more details. Entities []MessageEntity `json:"entities,omitempty"` // Optional. List of special entities that appear in message text, which can be specified instead of parse_mode LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Optional. Link preview generation options for the message }
Represents the content of a text message to be sent as the result of an inline query.
type InputVenueMessageContent ¶
type InputVenueMessageContent struct { Latitude float64 `json:"latitude"` // Latitude of the venue in degrees Longitude float64 `json:"longitude"` // Longitude of the venue in degrees Title string `json:"title"` // Name of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue, if known FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) GooglePlaceID string `json:"google_place_id,omitempty"` // Optional. Google Places identifier of the venue GooglePlaceType string `json:"google_place_type,omitempty"` // Optional. Google Places type of the venue. (See supported types.) }
Represents the content of a venue message to be sent as the result of an inline query.
type Invoice ¶
type Invoice struct { Title string `json:"title"` // Product name Description string `json:"description"` // Product description StartParameter string `json:"start_parameter"` // Unique bot deep-linking parameter that can be used to generate this invoice Currency string `json:"currency"` // Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars TotalAmount int `json:"total_amount"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). }
This object contains basic information about an invoice.
type KeyboardButton ¶
type KeyboardButton struct { Text string `json:"text"` // Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed RequestUsers *KeyboardButtonRequestUsers `json:"request_users,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. RequestChat *KeyboardButtonRequestChat `json:"request_chat,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. RequestContact bool `json:"request_contact,omitempty"` // Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. RequestLocation bool `json:"request_location,omitempty"` // Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only. RequestPoll *KeyboardButtonPollType `json:"request_poll,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. WebApp *WebAppInfo `json:"web_app,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. }
This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.
type KeyboardButtonPollType ¶
type KeyboardButtonPollType struct {
Type string `json:"type,omitempty"` // 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.
}
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 { RequestID int64 `json:"request_id"` // Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message ChatIsChannel bool `json:"chat_is_channel"` // Pass True to request a channel chat, pass False to request a group or a supergroup chat. ChatIsForum bool `json:"chat_is_forum,omitempty"` // Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied. ChatHasUsername bool `json:"chat_has_username,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. ChatIsCreated bool `json:"chat_is_created,omitempty"` // Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights,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. BotAdministratorRights *ChatAdministratorRights `json:"bot_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. BotIsMember bool `json:"bot_is_member,omitempty"` // Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. RequestTitle bool `json:"request_title,omitempty"` // Optional. Pass True to request the chat's title RequestUsername bool `json:"request_username,omitempty"` // Optional. Pass True to request the chat's username RequestPhoto bool `json:"request_photo,omitempty"` // Optional. Pass True to request the chat's photo }
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: https://core.telegram.org/bots/features#chat-and-user-selection.
https://core.telegram.org/bots/api#keyboardbuttonrequestchat
type KeyboardButtonRequestUsers ¶
type KeyboardButtonRequestUsers struct { RequestID int64 `json:"request_id"` // Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message UserIsBot bool `json:"user_is_bot,omitempty"` // Optional. Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied. UserIsPremium bool `json:"user_is_premium,omitempty"` // Optional. Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied. MaxQuantity int `json:"max_quantity,omitempty"` // Optional. The maximum number of users to be selected; 1-10. Defaults to 1. RequestName bool `json:"request_name,omitempty"` // Optional. Pass True to request the users' first and last names RequestUsername bool `json:"request_username,omitempty"` // Optional. Pass True to request the users' usernames RequestPhoto bool `json:"request_photo,omitempty"` // Optional. Pass True to request the users' photos }
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: https://core.telegram.org/bots/features#chat-and-user-selection
https://core.telegram.org/bots/api#keyboardbuttonrequestusers
type LabeledPrice ¶
type LabeledPrice struct { Label string `json:"label"` // Portion label Amount int `json:"amount"` // Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). }
This object represents a portion of the price for goods or services.
type LeaveChatRequest ¶
type LeaveChatRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
}
see Bot.LeaveChat(ctx, &LeaveChatRequest{})
type LinkPreviewOptions ¶
type LinkPreviewOptions struct { IsDisabled bool `json:"is_disabled,omitempty"` // Optional. True, if the link preview is disabled Url string `json:"url,omitempty"` // Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used PreferSmallMedia bool `json:"prefer_small_media,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 PreferLargeMedia bool `json:"prefer_large_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 ShowAboveText bool `json:"show_above_text,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 }
Describes the options used for link preview generation.
type Location ¶
type Location struct { Latitude float64 `json:"latitude"` // Latitude as defined by the sender Longitude float64 `json:"longitude"` // Longitude as defined by the sender HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // Optional. The radius of uncertainty for the location, measured in meters; 0-1500 LivePeriod int `json:"live_period,omitempty"` // Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. Heading int `json:"heading,omitempty"` // Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` // Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. }
This object represents a point on the map.
type LoginUrl ¶
type LoginUrl struct { Url string `json:"url"` // 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. ForwardText string `json:"forward_text,omitempty"` // Optional. New text of the button in forwarded messages. BotUsername string `json:"bot_username,omitempty"` // Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. RequestWriteAccess bool `json:"request_write_access,omitempty"` // Optional. Pass True to request the permission for your bot to send messages to the user. }
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 LongPollUpdatesOptions ¶ added in v0.0.3
type LongPollUpdatesOptions struct { RequestOptions GetUpdatesRequest // Initial getUpdates request options Cap uint // Optional. Updates channel capacity RetryInterval time.Duration // Optional. Sleep for this duration if an error happens on getUpdates request. Default is 0 MaxErrors uint // Optional. Exit from polling loop after MaxErrors errors in a row. The returned channel gets closed too. Default is unlimited }
See goram.LongPollUpdates()
type Markup ¶
type Markup interface{}
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
type MaskPosition ¶
type MaskPosition struct { Point string `json:"point"` // The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". XShift float64 `json:"x_shift"` // Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. YShift float64 `json:"y_shift"` // Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. Scale float64 `json:"scale"` // Mask scaling coefficient. For example, 2.0 means double size. }
This object describes the position on faces where a mask should be placed by default.
type MenuButton ¶
type MenuButton struct { Type string `json:"type"` Text string `json:"text"` // Text on the button WebApp *WebAppInfo `json:"web_app"` // 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. }
This object describes the bot's menu button in a private chat. It should be one of
- MenuButtonCommands
- MenuButtonWebApp
- MenuButtonDefault
If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.
type Message ¶
type Message struct { MessageID int `json:"message_id"` // 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 MessageThreadID int64 `json:"message_thread_id,omitempty"` // Optional. Unique identifier of a message thread to which the message belongs; for supergroups only From *User `json:"from,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 SenderChat *Chat `json:"sender_chat,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. SenderBoostCount int `json:"sender_boost_count,omitempty"` // Optional. If the sender of the message boosted the chat, the number of boosts added by the user SenderBusinessBot *User `json:"sender_business_bot,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. Date int `json:"date"` // Date the message was sent in Unix time. It is always a positive number, representing a valid date. BusinessConnectionID string `json:"business_connection_id,omitempty"` // 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. Chat *Chat `json:"chat"` // Chat the message belongs to ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"` // Optional. Information about the original message for forwarded messages IsTopicMessage bool `json:"is_topic_message,omitempty"` // Optional. True, if the message is sent to a forum topic IsAutomaticForward bool `json:"is_automatic_forward,omitempty"` // Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group ReplyToMessage *Message `json:"reply_to_message,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. ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"` // Optional. Information about the message that is being replied to, which may come from another chat or forum topic Quote *TextQuote `json:"quote,omitempty"` // Optional. For replies that quote part of the original message, the quoted part of the message ReplyToStory *Story `json:"reply_to_story,omitempty"` // Optional. For replies to a story, the original story ViaBot *User `json:"via_bot,omitempty"` // Optional. Bot through which the message was sent EditDate int `json:"edit_date,omitempty"` // Optional. Date the message was last edited in Unix time HasProtectedContent bool `json:"has_protected_content,omitempty"` // Optional. True, if the message can't be forwarded IsFromOffline bool `json:"is_from_offline,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 MediaGroupID string `json:"media_group_id,omitempty"` // Optional. The unique identifier of a media message group this message belongs to AuthorSignature string `json:"author_signature,omitempty"` // Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator Text string `json:"text,omitempty"` // Optional. For text messages, the actual UTF-8 text of the message Entities []MessageEntity `json:"entities,omitempty"` // Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed EffectID string `json:"effect_id,omitempty"` // Optional. Unique identifier of the message effect added to the message Animation *Animation `json:"animation,omitempty"` // Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set Audio *Audio `json:"audio,omitempty"` // Optional. Message is an audio file, information about the file Document *Document `json:"document,omitempty"` // Optional. Message is a general file, information about the file PaidMedia *PaidMediaInfo `json:"paid_media,omitempty"` // Optional. Message contains paid media; information about the paid media Photo []PhotoSize `json:"photo,omitempty"` // Optional. Message is a photo, available sizes of the photo Sticker *Sticker `json:"sticker,omitempty"` // Optional. Message is a sticker, information about the sticker Story *Story `json:"story,omitempty"` // Optional. Message is a forwarded story Video *Video `json:"video,omitempty"` // Optional. Message is a video, information about the video VideoNote *VideoNote `json:"video_note,omitempty"` // Optional. Message is a video note, information about the video message Voice *Voice `json:"voice,omitempty"` // Optional. Message is a voice message, information about the file Caption string `json:"caption,omitempty"` // Optional. Caption for the animation, audio, document, paid media, photo, video or voice CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Optional. True, if the caption must be shown above the message media HasMediaSpoiler bool `json:"has_media_spoiler,omitempty"` // Optional. True, if the message media is covered by a spoiler animation Contact *Contact `json:"contact,omitempty"` // Optional. Message is a shared contact, information about the contact Dice *Dice `json:"dice,omitempty"` // Optional. Message is a dice with random value Game *Game `json:"game,omitempty"` // Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games Poll *Poll `json:"poll,omitempty"` // Optional. Message is a native poll, information about the poll Venue *Venue `json:"venue,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 Location *Location `json:"location,omitempty"` // Optional. Message is a shared location, information about the location NewChatMembers []User `json:"new_chat_members,omitempty"` // Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) LeftChatMember *User `json:"left_chat_member,omitempty"` // Optional. A member was removed from the group, information about them (this member may be the bot itself) NewChatTitle string `json:"new_chat_title,omitempty"` // Optional. A chat title was changed to this value NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"` // Optional. A chat photo was change to this value DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"` // Optional. Service message: the chat photo was deleted GroupChatCreated bool `json:"group_chat_created,omitempty"` // Optional. Service message: the group has been created SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"` // Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. ChannelChatCreated bool `json:"channel_chat_created,omitempty"` // Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"` // Optional. Service message: auto-delete timer settings changed in the chat MigrateToChatID int64 `json:"migrate_to_chat_id,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. MigrateFromChatID int64 `json:"migrate_from_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. PinnedMessage *Message `json:"pinned_message,omitempty"` // Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. Invoice *Invoice `json:"invoice,omitempty"` // Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"` // Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments RefundedPayment *RefundedPayment `json:"refunded_payment,omitempty"` // Optional. Message is a service message about a refunded payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments ConnectedWebsite string `json:"connected_website,omitempty"` // Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,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 PassportData *PassportData `json:"passport_data,omitempty"` // Optional. Telegram Passport data ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"` // Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. BoostAdded *ChatBoostAdded `json:"boost_added,omitempty"` // Optional. Service message: user boosted the chat ChatBackgroundSet *ChatBackground `json:"chat_background_set,omitempty"` // Optional. Service message: chat background set ForumTopicCreated *ForumTopicCreated `json:"forum_topic_created,omitempty"` // Optional. Service message: forum topic created ForumTopicEdited *ForumTopicEdited `json:"forum_topic_edited,omitempty"` // Optional. Service message: forum topic edited ForumTopicClosed ForumTopicClosed `json:"forum_topic_closed,omitempty"` // Optional. Service message: forum topic closed ForumTopicReopened ForumTopicReopened `json:"forum_topic_reopened,omitempty"` // Optional. Service message: forum topic reopened GeneralForumTopicHidden GeneralForumTopicHidden `json:"general_forum_topic_hidden,omitempty"` // Optional. Service message: the 'General' forum topic hidden GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"` // Optional. Service message: a scheduled giveaway was created Giveaway *Giveaway `json:"giveaway,omitempty"` // Optional. The message is a scheduled giveaway message GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` // Optional. A giveaway with public winners was completed GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` // Optional. Service message: a giveaway without public winners was completed VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"` // Optional. Service message: video chat scheduled VideoChatStarted VideoChatStarted `json:"video_chat_started,omitempty"` // Optional. Service message: video chat started VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"` // Optional. Service message: video chat ended VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"` // Optional. Service message: new participants invited to a video chat WebAppData *WebAppData `json:"web_app_data,omitempty"` // Optional. Service message: data sent by a Web App ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. }
This object represents a message.
type MessageAutoDeleteTimerChanged ¶
type MessageAutoDeleteTimerChanged struct {
MessageAutoDeleteTime int `json:"message_auto_delete_time"` // New auto-delete time for messages in the chat; in seconds
}
This object represents a service message about a change in auto-delete timer settings.
https://core.telegram.org/bots/api#messageautodeletetimerchanged
type MessageEntity ¶
type MessageEntity struct { Type MessageEntityType `json:"type"` // 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) Offset int64 `json:"offset"` // Offset in UTF-16 code units to the start of the entity Length int `json:"length"` // Length of the entity in UTF-16 code units Url string `json:"url,omitempty"` // Optional. For "text_link" only, URL that will be opened after user taps on the text User *User `json:"user,omitempty"` // Optional. For "text_mention" only, the mentioned user Language string `json:"language,omitempty"` // Optional. For "pre" only, the programming language of the entity text CustomEmojiID string `json:"custom_emoji_id,omitempty"` // Optional. For "custom_emoji" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker }
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
type MessageEntityType ¶
type MessageEntityType string
const ( MessageEntityTypeMention MessageEntityType = "mention" MessageEntityTypeHashtag MessageEntityType = "hashtag" MessageEntityTypeCashtag MessageEntityType = "cashtag" MessageEntityTypeBotCommand MessageEntityType = "bot_command" MessageEntityTypeUrl MessageEntityType = "url" MessageEntityTypeEmail MessageEntityType = "email" MessageEntityTypePhoneNumber MessageEntityType = "phone_number" MessageEntityTypeBold MessageEntityType = "bold" MessageEntityTypeItalic MessageEntityType = "italic" MessageEntityTypeUnderline MessageEntityType = "underline" MessageEntityTypeStrikethrough MessageEntityType = "strikethrough" MessageEntityTypeSpoiler MessageEntityType = "spoiler" MessageEntityTypeBlockquote MessageEntityType = "blockquote" MessageEntityTypeExpandableBlockquote MessageEntityType = "expandable_blockquote" MessageEntityTypeCode MessageEntityType = "code" MessageEntityTypePre MessageEntityType = "pre" MessageEntityTypeTextLink MessageEntityType = "text_link" MessageEntityTypeTextMention MessageEntityType = "text_mention" MessageEntityTypeCustomEmoji MessageEntityType = "custom_emoji" )
type MessageId ¶
type MessageId struct {
MessageID int `json:"message_id"` // 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
}
This object represents a unique message identifier.
type MessageOrigin ¶
type MessageOrigin struct { Type string `json:"type"` Date int `json:"date"` // Date the message was sent originally in Unix time SenderUser *User `json:"sender_user"` // User that sent the message originally SenderUserName string `json:"sender_user_name"` // Name of the user that sent the message originally SenderChat *Chat `json:"sender_chat"` // Chat that sent the message originally AuthorSignature string `json:"author_signature,omitempty"` // Optional. For messages originally sent by an anonymous chat administrator, original message author signature Chat *Chat `json:"chat"` // Channel chat to which the message was originally sent MessageID int `json:"message_id"` // Unique message identifier inside the chat }
This object describes the origin of a message. It can be one of
- MessageOriginUser
- MessageOriginHiddenUser
- MessageOriginChat
- MessageOriginChannel
type MessageReactionCountUpdated ¶
type MessageReactionCountUpdated struct { Chat *Chat `json:"chat"` // The chat containing the message MessageID int `json:"message_id"` // Unique message identifier inside the chat Date int `json:"date"` // Date of the change in Unix time Reactions []ReactionCount `json:"reactions"` // List of reactions that are present on the message }
This object represents reaction changes on a message with anonymous reactions.
https://core.telegram.org/bots/api#messagereactioncountupdated
type MessageReactionUpdated ¶
type MessageReactionUpdated struct { Chat *Chat `json:"chat"` // The chat containing the message the user reacted to MessageID int `json:"message_id"` // Unique identifier of the message inside the chat User *User `json:"user,omitempty"` // Optional. The user that changed the reaction, if the user isn't anonymous ActorChat *Chat `json:"actor_chat,omitempty"` // Optional. The chat on behalf of which the reaction was changed, if the user is anonymous Date int `json:"date"` // Date of the change in Unix time OldReaction []ReactionType `json:"old_reaction"` // Previous list of reaction types that were set by the user NewReaction []ReactionType `json:"new_reaction"` // New list of reaction types that have been set by the user }
This object represents a change of a reaction on a message performed by a user.
type NameReader ¶
Use this if you need to pass an io.Reader that does not have .Name() method to InputFile.
For example: you want to send a photo via Bot.SendPhoto() method, but you have only a bytes.Buffer and the photo filename. Or you have a file, but you want different filename.
func (NameReader) Name ¶
func (n NameReader) Name() string
type NamedReader ¶
type OrderInfo ¶
type OrderInfo struct { Name string `json:"name,omitempty"` // Optional. User name PhoneNumber string `json:"phone_number,omitempty"` // Optional. User's phone number Email string `json:"email,omitempty"` // Optional. User email ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` // Optional. User shipping address }
This object represents information about an order.
type PaidMedia ¶
type PaidMedia struct { Type string `json:"type"` Width int `json:"width,omitempty"` // Optional. Media width as defined by the sender Height int `json:"height,omitempty"` // Optional. Media height as defined by the sender Duration int `json:"duration,omitempty"` // Optional. Duration of the media in seconds as defined by the sender Photo []PhotoSize `json:"photo"` // The photo Video *Video `json:"video"` // The video }
This object describes paid media. Currently, it can be one of
- PaidMediaPreview
- PaidMediaPhoto
- PaidMediaVideo
type PaidMediaInfo ¶
type PaidMediaInfo struct { StarCount int `json:"star_count"` // The number of Telegram Stars that must be paid to buy access to the media PaidMedia []PaidMedia `json:"paid_media"` // Information about the paid media }
Describes the paid media added to a message.
type PaidMediaPurchased ¶
type PaidMediaPurchased struct { From *User `json:"from"` // User who purchased the media PaidMediaPayload string `json:"paid_media_payload"` // Bot-specified paid media payload }
This object contains information about a paid media purchase.
type PassportData ¶
type PassportData struct { Data []EncryptedPassportElement `json:"data"` // Array with information about documents and other Telegram Passport elements that was shared with the bot Credentials *EncryptedCredentials `json:"credentials"` // Encrypted credentials required to decrypt the data }
Describes Telegram Passport data shared with the bot by the user.
type PassportElementError ¶
type PassportElementError struct { Source string `json:"source"` Type string `json:"type"` // The section of the user's Telegram Passport which has the error, one of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address" FieldName string `json:"field_name"` // Name of the data field which has the error DataHash string `json:"data_hash"` // Base64-encoded data hash Message string `json:"message"` // Error message FileHash string `json:"file_hash"` // Base64-encoded hash of the file with the front side of the document FileHashes []string `json:"file_hashes"` // List of base64-encoded file hashes ElementHash string `json:"element_hash"` // Base64-encoded element hash }
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:
- PassportElementErrorDataField
- PassportElementErrorFrontSide
- PassportElementErrorReverseSide
- PassportElementErrorSelfie
- PassportElementErrorFile
- PassportElementErrorFiles
- PassportElementErrorTranslationFile
- PassportElementErrorTranslationFiles
- PassportElementErrorUnspecified
type PassportFile ¶
type PassportFile struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. FileSize int `json:"file_size"` // File size in bytes FileDate int `json:"file_date"` // Unix time when the file was uploaded }
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 { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Width int `json:"width"` // Photo width Height int `json:"height"` // Photo height FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes }
This object represents one size of a photo or a file / sticker thumbnail.
type PinChatMessageRequest ¶
type PinChatMessageRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be pinned ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // Identifier of a message to pin DisableNotification bool `json:"disable_notification,omitempty"` // Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. }
see Bot.PinChatMessage(ctx, &PinChatMessageRequest{})
type Poll ¶
type Poll struct { ID string `json:"id"` // Unique poll identifier Question string `json:"question"` // Poll question, 1-300 characters QuestionEntities []MessageEntity `json:"question_entities,omitempty"` // Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions Options []PollOption `json:"options"` // List of poll options TotalVoterCount int `json:"total_voter_count"` // Total number of users that voted in the poll IsClosed bool `json:"is_closed"` // True, if the poll is closed IsAnonymous bool `json:"is_anonymous"` // True, if the poll is anonymous Type string `json:"type"` // Poll type, currently can be "regular" or "quiz" AllowsMultipleAnswers bool `json:"allows_multiple_answers"` // True, if the poll allows multiple answers CorrectOptionID int64 `json:"correct_option_id,omitempty"` // Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. Explanation string `json:"explanation,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 ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` // Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation OpenPeriod int `json:"open_period,omitempty"` // Optional. Amount of time in seconds the poll will be active after creation CloseDate int `json:"close_date,omitempty"` // Optional. Point in time (Unix timestamp) when the poll will be automatically closed }
This object contains information about a poll.
type PollAnswer ¶
type PollAnswer struct { PollID string `json:"poll_id"` // Unique poll identifier VoterChat *Chat `json:"voter_chat,omitempty"` // Optional. The chat that changed the answer to the poll, if the voter is anonymous User *User `json:"user,omitempty"` // Optional. The user that changed the answer to the poll, if the voter isn't anonymous OptionIds []int `json:"option_ids"` // 0-based identifiers of chosen answer options. May be empty if the vote was retracted. }
This object represents an answer of a user in a non-anonymous poll.
type PollOption ¶
type PollOption struct { Text string `json:"text"` // Option text, 1-100 characters TextEntities []MessageEntity `json:"text_entities,omitempty"` // Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts VoterCount int `json:"voter_count"` // Number of users that voted for this option }
This object contains information about one answer option in a poll.
type PreCheckoutQuery ¶
type PreCheckoutQuery struct { ID string `json:"id"` // Unique query identifier From *User `json:"from"` // User who sent the query Currency string `json:"currency"` // Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars TotalAmount int `json:"total_amount"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). InvoicePayload string `json:"invoice_payload"` // Bot-specified invoice payload ShippingOptionID string `json:"shipping_option_id,omitempty"` // Optional. Identifier of the shipping option chosen by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` // Optional. Order information provided by the user }
This object contains information about an incoming pre-checkout query.
type PreparedInlineMessage ¶
type PreparedInlineMessage struct { ID string `json:"id"` // Unique identifier of the prepared message ExpirationDate int `json:"expiration_date"` // Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used }
Describes an inline message to be sent by a user of a Mini App.
type PromoteChatMemberRequest ¶
type PromoteChatMemberRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user IsAnonymous bool `json:"is_anonymous,omitempty"` // Pass True if the administrator's presence in the chat is hidden CanManageChat bool `json:"can_manage_chat,omitempty"` // Pass True if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege. CanDeleteMessages bool `json:"can_delete_messages,omitempty"` // Pass True if the administrator can delete messages of other users CanManageVideoChats bool `json:"can_manage_video_chats,omitempty"` // Pass True if the administrator can manage video chats CanRestrictMembers bool `json:"can_restrict_members,omitempty"` // Pass True if the administrator can restrict, ban or unban chat members, or access supergroup statistics CanPromoteMembers bool `json:"can_promote_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) CanChangeInfo bool `json:"can_change_info,omitempty"` // Pass True if the administrator can change chat title, photo and other settings CanInviteUsers bool `json:"can_invite_users,omitempty"` // Pass True if the administrator can invite new users to the chat CanPostStories bool `json:"can_post_stories,omitempty"` // Pass True if the administrator can post stories to the chat CanEditStories bool `json:"can_edit_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 CanDeleteStories bool `json:"can_delete_stories,omitempty"` // Pass True if the administrator can delete stories posted by other users CanPostMessages bool `json:"can_post_messages,omitempty"` // Pass True if the administrator can post messages in the channel, or access channel statistics; for channels only CanEditMessages bool `json:"can_edit_messages,omitempty"` // Pass True if the administrator can edit messages of other users and can pin messages; for channels only CanPinMessages bool `json:"can_pin_messages,omitempty"` // Pass True if the administrator can pin messages; for supergroups only CanManageTopics bool `json:"can_manage_topics,omitempty"` // Pass True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only }
see Bot.PromoteChatMember(ctx, &PromoteChatMemberRequest{})
type ProximityAlertTriggered ¶
type ProximityAlertTriggered struct { Traveler *User `json:"traveler"` // User that triggered the alert Watcher *User `json:"watcher"` // User that set the alert Distance int `json:"distance"` // The distance between the users }
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 *ReactionType `json:"type"` // Type of the reaction TotalCount int `json:"total_count"` // Number of times the reaction was added }
Represents a reaction added to a message along with the number of times it was added.
type ReactionType ¶
type ReactionType struct { Type string `json:"type"` Emoji string `json:"emoji"` // Reaction emoji. Currently, it can be one of "👍", "👎", "❤", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷♂", "🤷", "🤷♀", "😡" CustomEmojiID string `json:"custom_emoji_id"` // Custom emoji identifier }
This object describes the type of a reaction. Currently, it can be one of
- ReactionTypeEmoji
- ReactionTypeCustomEmoji
- ReactionTypePaid
type RefundStarPaymentRequest ¶
type RefundStarPaymentRequest struct { UserID int64 `json:"user_id"` // Identifier of the user whose payment will be refunded TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Telegram payment identifier }
see Bot.RefundStarPayment(ctx, &RefundStarPaymentRequest{})
type RefundedPayment ¶
type RefundedPayment struct { Currency string `json:"currency"` // Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars. Currently, always "XTR" TotalAmount int `json:"total_amount"` // 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). InvoicePayload string `json:"invoice_payload"` // Bot-specified invoice payload TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Telegram payment identifier ProviderPaymentChargeID string `json:"provider_payment_charge_id,omitempty"` // Optional. Provider payment identifier }
This object contains basic information about a refunded payment.
type RemoveChatVerificationRequest ¶
type RemoveChatVerificationRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
see Bot.RemoveChatVerification(ctx, &RemoveChatVerificationRequest{})
type RemoveUserVerificationRequest ¶
type RemoveUserVerificationRequest struct {
UserID int64 `json:"user_id"` // Unique identifier of the target user
}
see Bot.RemoveUserVerification(ctx, &RemoveUserVerificationRequest{})
type ReopenForumTopicRequest ¶
type ReopenForumTopicRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) MessageThreadID int64 `json:"message_thread_id"` // Unique identifier for the target message thread of the forum topic }
see Bot.ReopenForumTopic(ctx, &ReopenForumTopicRequest{})
type ReopenGeneralForumTopicRequest ¶
type ReopenGeneralForumTopicRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
see Bot.ReopenGeneralForumTopic(ctx, &ReopenGeneralForumTopicRequest{})
type ReplaceStickerInSetRequest ¶
type ReplaceStickerInSetRequest struct { UserID int64 `json:"user_id"` // User identifier of the sticker set owner Name string `json:"name"` // Sticker set name OldSticker string `json:"old_sticker"` // File identifier of the replaced sticker Sticker *InputSticker `json:"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. }
see Bot.ReplaceStickerInSet(ctx, &ReplaceStickerInSetRequest{})
type ReplyKeyboardMarkup ¶
type ReplyKeyboardMarkup struct { Keyboard [][]KeyboardButton `json:"keyboard"` // Array of button rows, each represented by an Array of KeyboardButton objects IsPersistent bool `json:"is_persistent,omitempty"` // 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. ResizeKeyboard bool `json:"resize_keyboard,omitempty"` // Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. OneTimeKeyboard bool `json:"one_time_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. InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` // Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters Selective bool `json:"selective,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. }
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 { RemoveKeyboard bool `json:"remove_keyboard"` // Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) Selective bool `json:"selective,omitempty"` // Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply 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. }
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 ReplyParameters ¶
type ReplyParameters struct { MessageID int `json:"message_id"` // Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified ChatID ChatID `json:"chat_id,omitempty"` // 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. AllowSendingWithoutReply bool `json:"allow_sending_without_reply,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. Quote string `json:"quote,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. QuoteParseMode string `json:"quote_parse_mode,omitempty"` // Optional. Mode for parsing entities in the quote. See formatting options for more details. QuoteEntities []MessageEntity `json:"quote_entities,omitempty"` // Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. QuotePosition int `json:"quote_position,omitempty"` // Optional. Position of the quote in the original message in UTF-16 code units }
Describes reply parameters for the message that is being sent.
type ResponseParameters ¶
type ResponseParameters struct { MigrateToChatID int64 `json:"migrate_to_chat_id,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. RetryAfter int `json:"retry_after,omitempty"` // Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated }
Describes why a request was unsuccessful.
type RestrictChatMemberRequest ¶
type RestrictChatMemberRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) UserID int64 `json:"user_id"` // Unique identifier of the target user Permissions *ChatPermissions `json:"permissions"` // A JSON-serialized object for new user permissions UseIndependentChatPermissions bool `json:"use_independent_chat_permissions,omitempty"` // 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. UntilDate int `json:"until_date,omitempty"` // Date when restrictions will be lifted for the user; Unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever }
see Bot.RestrictChatMember(ctx, &RestrictChatMemberRequest{})
type RevenueWithdrawalState ¶
type RevenueWithdrawalState struct { Type string `json:"type"` Date int `json:"date"` // Date the withdrawal was completed in Unix time Url string `json:"url"` // An HTTPS URL that can be used to see transaction details }
This object describes the state of a revenue withdrawal operation. Currently, it can be one of
- RevenueWithdrawalStatePending
- RevenueWithdrawalStateSucceeded
- RevenueWithdrawalStateFailed
type RevokeChatInviteLinkRequest ¶
type RevokeChatInviteLinkRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier of the target chat or username of the target channel (in the format @channelusername) InviteLink string `json:"invite_link"` // The invite link to revoke }
see Bot.RevokeChatInviteLink(ctx, &RevokeChatInviteLinkRequest{})
type SavePreparedInlineMessageRequest ¶
type SavePreparedInlineMessageRequest struct { UserID int64 `json:"user_id"` // Unique identifier of the target user that can use the prepared message Result InlineQueryResult `json:"result"` // A JSON-serialized object describing the message to be sent AllowUserChats bool `json:"allow_user_chats,omitempty"` // Pass True if the message can be sent to private chats with users AllowBotChats bool `json:"allow_bot_chats,omitempty"` // Pass True if the message can be sent to private chats with bots AllowGroupChats bool `json:"allow_group_chats,omitempty"` // Pass True if the message can be sent to group and supergroup chats AllowChannelChats bool `json:"allow_channel_chats,omitempty"` // Pass True if the message can be sent to channel chats }
see Bot.SavePreparedInlineMessage(ctx, &SavePreparedInlineMessageRequest{})
type SendAnimationRequest ¶
type SendAnimationRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Animation InputFile `json:"animation"` // Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Duration int `json:"duration,omitempty"` // Duration of sent animation in seconds Width int `json:"width,omitempty"` // Animation width Height int `json:"height,omitempty"` // Animation height Thumbnail InputFile `json:"thumbnail,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: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the animation caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Pass True, if the caption must be shown above the message media HasSpoiler bool `json:"has_spoiler,omitempty"` // Pass True if the animation needs to be covered with a spoiler animation DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendAnimation(ctx, &SendAnimationRequest{})
type SendAudioRequest ¶
type SendAudioRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Audio InputFile `json:"audio"` // Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Audio caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the audio caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode Duration int `json:"duration,omitempty"` // Duration of the audio in seconds Performer string `json:"performer,omitempty"` // Performer Title string `json:"title,omitempty"` // Track name Thumbnail InputFile `json:"thumbnail,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: https://core.telegram.org/bots/api#sending-files DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendAudio(ctx, &SendAudioRequest{})
type SendChatActionRequest ¶
type SendChatActionRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the action will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread; for supergroups only Action ChatAction `json:"action"` // Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_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. }
see Bot.SendChatAction(ctx, &SendChatActionRequest{})
type SendContactRequest ¶
type SendContactRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only PhoneNumber string `json:"phone_number"` // Contact's phone number FirstName string `json:"first_name"` // Contact's first name LastName string `json:"last_name,omitempty"` // Contact's last name Vcard string `json:"vcard,omitempty"` // Additional data about the contact in the form of a vCard, 0-2048 bytes DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendContact(ctx, &SendContactRequest{})
type SendDiceRequest ¶
type SendDiceRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Emoji string `json:"emoji,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 "🎲" DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendDice(ctx, &SendDiceRequest{})
type SendDocumentRequest ¶
type SendDocumentRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Document InputFile `json:"document"` // File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Thumbnail InputFile `json:"thumbnail,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: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the document caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"` // Disables automatic server-side content type detection for files uploaded using multipart/form-data DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendDocument(ctx, &SendDocumentRequest{})
type SendGameRequest ¶
type SendGameRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID int64 `json:"chat_id"` // Unique identifier for the target chat MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only GameShortName string `json:"game_short_name"` // Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. }
see Bot.SendGame(ctx, &SendGameRequest{})
type SendGiftRequest ¶
type SendGiftRequest struct { UserID int64 `json:"user_id,omitempty"` // Required if chat_id is not specified. Unique identifier of the target user who will receive the gift. ChatID ChatID `json:"chat_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. GiftID string `json:"gift_id"` // Identifier of the gift PayForUpgrade bool `json:"pay_for_upgrade,omitempty"` // Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver Text string `json:"text,omitempty"` // Text that will be shown along with the gift; 0-128 characters TextParseMode string `json:"text_parse_mode,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. TextEntities []MessageEntity `json:"text_entities,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. }
see Bot.SendGift(ctx, &SendGiftRequest{})
type SendInvoiceRequest ¶
type SendInvoiceRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Title string `json:"title"` // Product name, 1-32 characters Description string `json:"description"` // Product description, 1-255 characters Payload string `json:"payload"` // Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. ProviderToken string `json:"provider_token,omitempty"` // Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. Currency string `json:"currency"` // Three-letter ISO 4217 currency code, see more on currencies. Pass "XTR" for payments in Telegram Stars. Prices []LabeledPrice `json:"prices"` // 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. MaxTipAmount int `json:"max_tip_amount,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. SuggestedTipAmounts []int `json:"suggested_tip_amounts,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. StartParameter string `json:"start_parameter,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 ProviderData string `json:"provider_data,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. PhotoUrl string `json:"photo_url,omitempty"` // URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. PhotoSize int `json:"photo_size,omitempty"` // Photo size in bytes PhotoWidth int `json:"photo_width,omitempty"` // Photo width PhotoHeight int `json:"photo_height,omitempty"` // Photo height NeedName bool `json:"need_name,omitempty"` // Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. NeedPhoneNumber bool `json:"need_phone_number,omitempty"` // Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. NeedEmail bool `json:"need_email,omitempty"` // Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. NeedShippingAddress bool `json:"need_shipping_address,omitempty"` // Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` // Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` // Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. IsFlexible bool `json:"is_flexible,omitempty"` // Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. }
see Bot.SendInvoice(ctx, &SendInvoiceRequest{})
type SendLocationRequest ¶
type SendLocationRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Latitude float64 `json:"latitude"` // Latitude of the location Longitude float64 `json:"longitude"` // Longitude of the location HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` // The radius of uncertainty for the location, measured in meters; 0-1500 LivePeriod int `json:"live_period,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. Heading int `json:"heading,omitempty"` // For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. ProximityAlertRadius int `json:"proximity_alert_radius,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. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendLocation(ctx, &SendLocationRequest{})
type SendMediaGroupRequest ¶
type SendMediaGroupRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Media []InputMedia `json:"media"` // A JSON-serialized array describing messages to be sent, must include 2-10 items DisableNotification bool `json:"disable_notification,omitempty"` // Sends messages silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent messages from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to }
see Bot.SendMediaGroup(ctx, &SendMediaGroupRequest{})
type SendMessageRequest ¶
type SendMessageRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Text string `json:"text"` // Text of the message to be sent, 1-4096 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the message text. See formatting options for more details. Entities []MessageEntity `json:"entities,omitempty"` // A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` // Link preview generation options for the message DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendMessage(ctx, &SendMessageRequest{})
type SendPaidMediaRequest ¶
type SendPaidMediaRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // 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. StarCount int `json:"star_count"` // The number of Telegram Stars that must be paid to buy access to the media; 1-2500 Media []InputPaidMedia `json:"media"` // A JSON-serialized array describing the media to be sent; up to 10 items Payload string `json:"payload,omitempty"` // Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes. Caption string `json:"caption,omitempty"` // Media caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the media caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Pass True, if the caption must be shown above the message media DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendPaidMedia(ctx, &SendPaidMediaRequest{})
type SendPhotoRequest ¶
type SendPhotoRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Photo InputFile `json:"photo"` // Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. 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: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the photo caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Pass True, if the caption must be shown above the message media HasSpoiler bool `json:"has_spoiler,omitempty"` // Pass True if the photo needs to be covered with a spoiler animation DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendPhoto(ctx, &SendPhotoRequest{})
type SendPollRequest ¶
type SendPollRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Question string `json:"question"` // Poll question, 1-300 characters QuestionParseMode string `json:"question_parse_mode,omitempty"` // Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed QuestionEntities []MessageEntity `json:"question_entities,omitempty"` // A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode Options []InputPollOption `json:"options"` // A JSON-serialized list of 2-10 answer options IsAnonymous bool `json:"is_anonymous,omitempty"` // True, if the poll needs to be anonymous, defaults to True Type string `json:"type,omitempty"` // Poll type, "quiz" or "regular", defaults to "regular" AllowsMultipleAnswers bool `json:"allows_multiple_answers,omitempty"` // True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False CorrectOptionID int64 `json:"correct_option_id,omitempty"` // 0-based identifier of the correct answer option, required for polls in quiz mode Explanation string `json:"explanation,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 ExplanationParseMode string `json:"explanation_parse_mode,omitempty"` // Mode for parsing entities in the explanation. See formatting options for more details. ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` // A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode OpenPeriod int `json:"open_period,omitempty"` // Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. CloseDate int `json:"close_date,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. IsClosed bool `json:"is_closed,omitempty"` // Pass True if the poll needs to be immediately closed. This can be useful for poll preview. DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendPoll(ctx, &SendPollRequest{})
type SendStickerRequest ¶
type SendStickerRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Sticker InputFile `json:"sticker"` // Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Video and animated stickers can't be sent via an HTTP URL. Emoji string `json:"emoji,omitempty"` // Emoji associated with the sticker; only for just uploaded stickers DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendSticker(ctx, &SendStickerRequest{})
type SendVenueRequest ¶
type SendVenueRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Latitude float64 `json:"latitude"` // Latitude of the venue Longitude float64 `json:"longitude"` // Longitude of the venue Title string `json:"title"` // Name of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Foursquare identifier of the venue FoursquareType string `json:"foursquare_type,omitempty"` // Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) GooglePlaceID string `json:"google_place_id,omitempty"` // Google Places identifier of the venue GooglePlaceType string `json:"google_place_type,omitempty"` // Google Places type of the venue. (See supported types.) DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendVenue(ctx, &SendVenueRequest{})
type SendVideoNoteRequest ¶
type SendVideoNoteRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only VideoNote InputFile `json:"video_note"` // Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files. Sending video notes by a URL is currently unsupported Duration int `json:"duration,omitempty"` // Duration of sent video in seconds Length int `json:"length,omitempty"` // Video width and height, i.e. diameter of the video message Thumbnail InputFile `json:"thumbnail,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: https://core.telegram.org/bots/api#sending-files DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendVideoNote(ctx, &SendVideoNoteRequest{})
type SendVideoRequest ¶
type SendVideoRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Video InputFile `json:"video"` // Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Duration int `json:"duration,omitempty"` // Duration of sent video in seconds Width int `json:"width,omitempty"` // Video width Height int `json:"height,omitempty"` // Video height Thumbnail InputFile `json:"thumbnail,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: https://core.telegram.org/bots/api#sending-files Cover InputFile `json:"cover,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: https://core.telegram.org/bots/api#sending-files StartTimestamp int `json:"start_timestamp,omitempty"` // Start timestamp for the video in the message Caption string `json:"caption,omitempty"` // Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the video caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Pass True, if the caption must be shown above the message media HasSpoiler bool `json:"has_spoiler,omitempty"` // Pass True if the video needs to be covered with a spoiler animation SupportsStreaming bool `json:"supports_streaming,omitempty"` // Pass True if the uploaded video is suitable for streaming DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendVideo(ctx, &SendVideoRequest{})
type SendVoiceRequest ¶
type SendVoiceRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageThreadID int64 `json:"message_thread_id,omitempty"` // Unique identifier for the target message thread (topic) of the forum; for forum supergroups only Voice InputFile `json:"voice"` // Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files: https://core.telegram.org/bots/api#sending-files Caption string `json:"caption,omitempty"` // Voice message caption, 0-1024 characters after entities parsing ParseMode ParseMode `json:"parse_mode,omitempty"` // Mode for parsing entities in the voice message caption. See formatting options for more details. CaptionEntities []MessageEntity `json:"caption_entities,omitempty"` // A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode Duration int `json:"duration,omitempty"` // Duration of the voice message in seconds DisableNotification bool `json:"disable_notification,omitempty"` // Sends the message silently. Users will receive a notification with no sound. ProtectContent bool `json:"protect_content,omitempty"` // Protects the contents of the sent message from forwarding and saving AllowPaidBroadcast bool `json:"allow_paid_broadcast,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 MessageEffectID string `json:"message_effect_id,omitempty"` // Unique identifier of the message effect to be added to the message; for private chats only ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"` // Description of the message to reply to ReplyMarkup Markup `json:"reply_markup,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 }
see Bot.SendVoice(ctx, &SendVoiceRequest{})
type SentWebAppMessage ¶
type SentWebAppMessage struct {
InlineMessageID string `json:"inline_message_id,omitempty"` // Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.
}
Describes an inline message sent by a Web App on behalf of a user.
type SetChatAdministratorCustomTitleRequest ¶
type SetChatAdministratorCustomTitleRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) UserID int64 `json:"user_id"` // Unique identifier of the target user CustomTitle string `json:"custom_title"` // New custom title for the administrator; 0-16 characters, emoji are not allowed }
see Bot.SetChatAdministratorCustomTitle(ctx, &SetChatAdministratorCustomTitleRequest{})
type SetChatDescriptionRequest ¶
type SetChatDescriptionRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Description string `json:"description,omitempty"` // New chat description, 0-255 characters }
see Bot.SetChatDescription(ctx, &SetChatDescriptionRequest{})
type SetChatMenuButtonRequest ¶
type SetChatMenuButtonRequest struct { ChatID int64 `json:"chat_id,omitempty"` // Unique identifier for the target private chat. If not specified, default bot's menu button will be changed MenuButton *MenuButton `json:"menu_button,omitempty"` // A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault }
see Bot.SetChatMenuButton(ctx, &SetChatMenuButtonRequest{})
type SetChatPermissionsRequest ¶
type SetChatPermissionsRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) Permissions *ChatPermissions `json:"permissions"` // A JSON-serialized object for new default chat permissions UseIndependentChatPermissions bool `json:"use_independent_chat_permissions,omitempty"` // 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. }
see Bot.SetChatPermissions(ctx, &SetChatPermissionsRequest{})
type SetChatPhotoRequest ¶
type SetChatPhotoRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Photo InputFile `json:"photo"` // New chat photo, uploaded using multipart/form-data }
see Bot.SetChatPhoto(ctx, &SetChatPhotoRequest{})
type SetChatStickerSetRequest ¶
type SetChatStickerSetRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) StickerSetName string `json:"sticker_set_name"` // Name of the sticker set to be set as the group sticker set }
see Bot.SetChatStickerSet(ctx, &SetChatStickerSetRequest{})
type SetChatTitleRequest ¶
type SetChatTitleRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) Title string `json:"title"` // New chat title, 1-128 characters }
see Bot.SetChatTitle(ctx, &SetChatTitleRequest{})
type SetCustomEmojiStickerSetThumbnailRequest ¶
type SetCustomEmojiStickerSetThumbnailRequest struct { Name string `json:"name"` // Sticker set name CustomEmojiID string `json:"custom_emoji_id,omitempty"` // 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. }
see Bot.SetCustomEmojiStickerSetThumbnail(ctx, &SetCustomEmojiStickerSetThumbnailRequest{})
type SetGameScoreRequest ¶
type SetGameScoreRequest struct { UserID int64 `json:"user_id"` // User identifier Score int `json:"score"` // New score, must be non-negative Force bool `json:"force,omitempty"` // Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters DisableEditMessage bool `json:"disable_edit_message,omitempty"` // Pass True if the game message should not be automatically edited to include the current scoreboard ChatID int64 `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the sent message InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message }
see Bot.SetGameScore(ctx, &SetGameScoreRequest{})
type SetMessageReactionRequest ¶
type SetMessageReactionRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead. Reaction []ReactionType `json:"reaction,omitempty"` // 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. IsBig bool `json:"is_big,omitempty"` // Pass True to set the reaction with a big animation }
see Bot.SetMessageReaction(ctx, &SetMessageReactionRequest{})
type SetMyCommandsRequest ¶
type SetMyCommandsRequest struct { Commands []BotCommand `json:"commands"` // A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. Scope *BotCommandScope `json:"scope,omitempty"` // A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. LanguageCode string `json:"language_code,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 }
see Bot.SetMyCommands(ctx, &SetMyCommandsRequest{})
type SetMyDefaultAdministratorRightsRequest ¶
type SetMyDefaultAdministratorRightsRequest struct { Rights *ChatAdministratorRights `json:"rights,omitempty"` // A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared. ForChannels bool `json:"for_channels,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. }
see Bot.SetMyDefaultAdministratorRights(ctx, &SetMyDefaultAdministratorRightsRequest{})
type SetMyDescriptionRequest ¶
type SetMyDescriptionRequest struct { Description string `json:"description,omitempty"` // New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. LanguageCode string `json:"language_code,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. }
see Bot.SetMyDescription(ctx, &SetMyDescriptionRequest{})
type SetMyNameRequest ¶
type SetMyNameRequest struct { Name string `json:"name,omitempty"` // New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. LanguageCode string `json:"language_code,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. }
see Bot.SetMyName(ctx, &SetMyNameRequest{})
type SetMyShortDescriptionRequest ¶
type SetMyShortDescriptionRequest struct { ShortDescription string `json:"short_description,omitempty"` // New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language. LanguageCode string `json:"language_code,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. }
see Bot.SetMyShortDescription(ctx, &SetMyShortDescriptionRequest{})
type SetPassportDataErrorsRequest ¶
type SetPassportDataErrorsRequest struct { UserID int64 `json:"user_id"` // User identifier Errors []PassportElementError `json:"errors"` // A JSON-serialized array describing the errors }
see Bot.SetPassportDataErrors(ctx, &SetPassportDataErrorsRequest{})
type SetStickerEmojiListRequest ¶
type SetStickerEmojiListRequest struct { Sticker string `json:"sticker"` // File identifier of the sticker EmojiList []string `json:"emoji_list"` // A JSON-serialized list of 1-20 emoji associated with the sticker }
see Bot.SetStickerEmojiList(ctx, &SetStickerEmojiListRequest{})
type SetStickerKeywordsRequest ¶
type SetStickerKeywordsRequest struct { Sticker string `json:"sticker"` // File identifier of the sticker Keywords []string `json:"keywords,omitempty"` // A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters }
see Bot.SetStickerKeywords(ctx, &SetStickerKeywordsRequest{})
type SetStickerMaskPositionRequest ¶
type SetStickerMaskPositionRequest struct { Sticker string `json:"sticker"` // File identifier of the sticker MaskPosition *MaskPosition `json:"mask_position,omitempty"` // A JSON-serialized object with the position where the mask should be placed on faces. Omit the parameter to remove the mask position. }
see Bot.SetStickerMaskPosition(ctx, &SetStickerMaskPositionRequest{})
type SetStickerPositionInSetRequest ¶
type SetStickerPositionInSetRequest struct { Sticker string `json:"sticker"` // File identifier of the sticker Position int `json:"position"` // New sticker position in the set, zero-based }
see Bot.SetStickerPositionInSet(ctx, &SetStickerPositionInSetRequest{})
type SetStickerSetThumbnailRequest ¶
type SetStickerSetThumbnailRequest struct { Name string `json:"name"` // Sticker set name UserID int64 `json:"user_id"` // User identifier of the sticker set owner Thumbnail InputFile `json:"thumbnail,omitempty"` // 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: https://core.telegram.org/bots/api#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. Format string `json:"format"` // 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 }
see Bot.SetStickerSetThumbnail(ctx, &SetStickerSetThumbnailRequest{})
type SetStickerSetTitleRequest ¶
type SetStickerSetTitleRequest struct { Name string `json:"name"` // Sticker set name Title string `json:"title"` // Sticker set title, 1-64 characters }
see Bot.SetStickerSetTitle(ctx, &SetStickerSetTitleRequest{})
type SetUserEmojiStatusRequest ¶
type SetUserEmojiStatusRequest struct { UserID int64 `json:"user_id"` // Unique identifier of the target user EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` // Custom emoji identifier of the emoji status to set. Pass an empty string to remove the status. EmojiStatusExpirationDate int `json:"emoji_status_expiration_date,omitempty"` // Expiration date of the emoji status, if any }
see Bot.SetUserEmojiStatus(ctx, &SetUserEmojiStatusRequest{})
type SetWebhookRequest ¶
type SetWebhookRequest struct { Url string `json:"url"` // HTTPS URL to send updates to. Use an empty string to remove webhook integration Certificate InputFile `json:"certificate,omitempty"` // Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details. IpAddress string `json:"ip_address,omitempty"` // The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS MaxConnections int `json:"max_connections,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. AllowedUpdates []UpdateType `json:"allowed_updates,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. DropPendingUpdates bool `json:"drop_pending_updates,omitempty"` // Pass True to drop all pending updates SecretToken string `json:"secret_token,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. }
see Bot.SetWebhook(ctx, &SetWebhookRequest{})
type SharedUser ¶
type SharedUser struct {}
This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
type ShippingAddress ¶
type ShippingAddress struct { CountryCode string `json:"country_code"` // Two-letter ISO 3166-1 alpha-2 country code State string `json:"state"` // State, if applicable City string `json:"city"` // City StreetLine1 string `json:"street_line1"` // First line for the address StreetLine2 string `json:"street_line2"` // Second line for the address PostCode string `json:"post_code"` // Address post code }
This object represents a shipping address.
type ShippingOption ¶
type ShippingOption struct { ID string `json:"id"` // Shipping option identifier Title string `json:"title"` // Option title Prices []LabeledPrice `json:"prices"` // List of price portions }
This object represents one shipping option.
type ShippingQuery ¶
type ShippingQuery struct { ID string `json:"id"` // Unique query identifier From *User `json:"from"` // User who sent the query InvoicePayload string `json:"invoice_payload"` // Bot-specified invoice payload ShippingAddress *ShippingAddress `json:"shipping_address"` // User specified shipping address }
This object contains information about an incoming shipping query.
type StarTransaction ¶
type StarTransaction struct { ID string `json:"id"` // 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. Amount int `json:"amount"` // Integer amount of Telegram Stars transferred by the transaction NanostarAmount int `json:"nanostar_amount,omitempty"` // Optional. The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 Date int `json:"date"` // Date the transaction was created in Unix time Source *TransactionPartner `json:"source,omitempty"` // Optional. Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions Receiver *TransactionPartner `json:"receiver,omitempty"` // Optional. Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions }
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 {
Transactions []StarTransaction `json:"transactions"` // The list of transactions
}
Contains a list of Telegram Star transactions.
type Sticker ¶
type Sticker struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Type string `json:"type"` // 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. Width int `json:"width"` // Sticker width Height int `json:"height"` // Sticker height IsAnimated bool `json:"is_animated"` // True, if the sticker is animated IsVideo bool `json:"is_video"` // True, if the sticker is a video sticker Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Sticker thumbnail in the .WEBP or .JPG format Emoji string `json:"emoji,omitempty"` // Optional. Emoji associated with the sticker SetName string `json:"set_name,omitempty"` // Optional. Name of the sticker set to which the sticker belongs PremiumAnimation *File `json:"premium_animation,omitempty"` // Optional. For premium regular stickers, premium animation for the sticker MaskPosition *MaskPosition `json:"mask_position,omitempty"` // Optional. For mask stickers, the position where the mask should be placed CustomEmojiID string `json:"custom_emoji_id,omitempty"` // Optional. For custom emoji stickers, unique identifier of the custom emoji NeedsRepainting bool `json:"needs_repainting,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 FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes }
This object represents a sticker.
type StickerSet ¶
type StickerSet struct { Name string `json:"name"` // Sticker set name Title string `json:"title"` // Sticker set title StickerType string `json:"sticker_type"` // Type of stickers in the set, currently one of "regular", "mask", "custom_emoji" Stickers []Sticker `json:"stickers"` // List of all set stickers Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format }
This object represents a sticker set.
type StopMessageLiveLocationRequest ¶
type StopMessageLiveLocationRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id,omitempty"` // Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // Required if inline_message_id is not specified. Identifier of the message with live location to stop InlineMessageID string `json:"inline_message_id,omitempty"` // Required if chat_id and message_id are not specified. Identifier of the inline message ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new inline keyboard. }
see Bot.StopMessageLiveLocation(ctx, &StopMessageLiveLocationRequest{})
type StopPollRequest ¶
type StopPollRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message to be edited was sent ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id"` // Identifier of the original message with the poll ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // A JSON-serialized object for a new message inline keyboard. }
see Bot.StopPoll(ctx, &StopPollRequest{})
type Story ¶
type Story struct { Chat *Chat `json:"chat"` // Chat that posted the story ID int64 `json:"id"` // Unique identifier for the story in the chat }
This object represents a story.
type SuccessfulPayment ¶
type SuccessfulPayment struct { Currency string `json:"currency"` // Three-letter ISO 4217 currency code, or "XTR" for payments in Telegram Stars TotalAmount int `json:"total_amount"` // Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). InvoicePayload string `json:"invoice_payload"` // Bot-specified invoice payload SubscriptionExpirationDate int `json:"subscription_expiration_date,omitempty"` // Optional. Expiration date of the subscription, in Unix time; for recurring payments only IsRecurring bool `json:"is_recurring,omitempty"` // Optional. True, if the payment is a recurring payment for a subscription IsFirstRecurring bool `json:"is_first_recurring,omitempty"` // Optional. True, if the payment is the first payment for a subscription ShippingOptionID string `json:"shipping_option_id,omitempty"` // Optional. Identifier of the shipping option chosen by the user OrderInfo *OrderInfo `json:"order_info,omitempty"` // Optional. Order information provided by the user TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` // Telegram payment identifier ProviderPaymentChargeID string `json:"provider_payment_charge_id"` // Provider payment identifier }
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 SwitchInlineQueryChosenChat ¶
type SwitchInlineQueryChosenChat struct { Query string `json:"query,omitempty"` // Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted AllowUserChats bool `json:"allow_user_chats,omitempty"` // Optional. True, if private chats with users can be chosen AllowBotChats bool `json:"allow_bot_chats,omitempty"` // Optional. True, if private chats with bots can be chosen AllowGroupChats bool `json:"allow_group_chats,omitempty"` // Optional. True, if group and supergroup chats can be chosen AllowChannelChats bool `json:"allow_channel_chats,omitempty"` // Optional. True, if channel chats can be chosen }
This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
https://core.telegram.org/bots/api#switchinlinequerychosenchat
type TextQuote ¶
type TextQuote struct { Text string `json:"text"` // Text of the quoted part of a message that is replied to by the given message Entities []MessageEntity `json:"entities,omitempty"` // Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. Position int `json:"position"` // Approximate quote position in the original message in UTF-16 code units as specified by the sender IsManual bool `json:"is_manual,omitempty"` // Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. }
This object contains information about the quoted part of a message that is replied to by the given message.
type TransactionPartner ¶
type TransactionPartner struct { Type string `json:"type"` User *User `json:"user"` // Information about the user Affiliate *AffiliateInfo `json:"affiliate,omitempty"` // Optional. Information about the affiliate that received a commission via this transaction InvoicePayload string `json:"invoice_payload,omitempty"` // Optional. Bot-specified invoice payload SubscriptionPeriod int `json:"subscription_period,omitempty"` // Optional. The duration of the paid subscription PaidMedia []PaidMedia `json:"paid_media,omitempty"` // Optional. Information about the paid media bought by the user PaidMediaPayload string `json:"paid_media_payload,omitempty"` // Optional. Bot-specified paid media payload Gift *Gift `json:"gift,omitempty"` // Optional. The gift sent to the user by the bot Chat *Chat `json:"chat"` // Information about the chat SponsorUser *User `json:"sponsor_user,omitempty"` // Optional. Information about the bot that sponsored the affiliate program CommissionPerMille int `json:"commission_per_mille"` // The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users WithdrawalState *RevenueWithdrawalState `json:"withdrawal_state,omitempty"` // Optional. State of the transaction if the transaction is outgoing RequestCount int `json:"request_count"` // The number of successful requests that exceeded regular limits and were therefore billed }
This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
- TransactionPartnerUser
- TransactionPartnerChat
- TransactionPartnerAffiliateProgram
- TransactionPartnerFragment
- TransactionPartnerTelegramAds
- TransactionPartnerTelegramApi
- TransactionPartnerOther
type UnbanChatMemberRequest ¶
type UnbanChatMemberRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) UserID int64 `json:"user_id"` // Unique identifier of the target user OnlyIfBanned bool `json:"only_if_banned,omitempty"` // Do nothing if the user is not banned }
see Bot.UnbanChatMember(ctx, &UnbanChatMemberRequest{})
type UnbanChatSenderChatRequest ¶
type UnbanChatSenderChatRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) SenderChatID int64 `json:"sender_chat_id"` // Unique identifier of the target sender chat }
see Bot.UnbanChatSenderChat(ctx, &UnbanChatSenderChatRequest{})
type UnhideGeneralForumTopicRequest ¶
type UnhideGeneralForumTopicRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
see Bot.UnhideGeneralForumTopic(ctx, &UnhideGeneralForumTopicRequest{})
type UnpinAllChatMessagesRequest ¶
type UnpinAllChatMessagesRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername)
}
see Bot.UnpinAllChatMessages(ctx, &UnpinAllChatMessagesRequest{})
type UnpinAllForumTopicMessagesRequest ¶
type UnpinAllForumTopicMessagesRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) MessageThreadID int64 `json:"message_thread_id"` // Unique identifier for the target message thread of the forum topic }
see Bot.UnpinAllForumTopicMessages(ctx, &UnpinAllForumTopicMessagesRequest{})
type UnpinAllGeneralForumTopicMessagesRequest ¶
type UnpinAllGeneralForumTopicMessagesRequest struct {
ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
}
see Bot.UnpinAllGeneralForumTopicMessages(ctx, &UnpinAllGeneralForumTopicMessagesRequest{})
type UnpinChatMessageRequest ¶
type UnpinChatMessageRequest struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` // Unique identifier of the business connection on behalf of which the message will be unpinned ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) MessageID int `json:"message_id,omitempty"` // 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. }
see Bot.UnpinChatMessage(ctx, &UnpinChatMessageRequest{})
type Update ¶
type Update struct { UpdateID int64 `json:"update_id"` // 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. Message *Message `json:"message,omitempty"` // Optional. New incoming message of any kind - text, photo, sticker, etc. EditedMessage *Message `json:"edited_message,omitempty"` // Optional. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. ChannelPost *Message `json:"channel_post,omitempty"` // Optional. New incoming channel post of any kind - text, photo, sticker, etc. EditedChannelPost *Message `json:"edited_channel_post,omitempty"` // Optional. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. BusinessConnection *BusinessConnection `json:"business_connection,omitempty"` // Optional. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot BusinessMessage *Message `json:"business_message,omitempty"` // Optional. New message from a connected business account EditedBusinessMessage *Message `json:"edited_business_message,omitempty"` // Optional. New version of a message from a connected business account DeletedBusinessMessages *BusinessMessagesDeleted `json:"deleted_business_messages,omitempty"` // Optional. Messages were deleted from a connected business account MessageReaction *MessageReactionUpdated `json:"message_reaction,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. MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,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. InlineQuery *InlineQuery `json:"inline_query,omitempty"` // Optional. New incoming inline query ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` // Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` // Optional. New incoming callback query ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` // Optional. New incoming shipping query. Only for invoices with flexible price PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` // Optional. New incoming pre-checkout query. Contains full information about checkout PurchasedPaidMedia *PaidMediaPurchased `json:"purchased_paid_media,omitempty"` // Optional. A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat Poll *Poll `json:"poll,omitempty"` // Optional. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot PollAnswer *PollAnswer `json:"poll_answer,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. MyChatMember *ChatMemberUpdated `json:"my_chat_member,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. ChatMember *ChatMemberUpdated `json:"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. ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,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. ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"` // Optional. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` // Optional. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. }
This object represents an incoming update.
At most one of the optional parameters can be present in any given update.
type UpdateType ¶ added in v0.0.14
type UpdateType string
const ( // New incoming message of any kind - text, photo, sticker, etc. UpdateMessage UpdateType = "message" // 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. UpdateEditedMessage UpdateType = "edited_message" // New incoming channel post of any kind - text, photo, sticker, etc. UpdateChannelPost UpdateType = "channel_post" // 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. UpdateEditedChannelPost UpdateType = "edited_channel_post" // The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot UpdateBusinessConnection UpdateType = "business_connection" // New message from a connected business account UpdateBusinessMessage UpdateType = "business_message" // New version of a message from a connected business account UpdateEditedBusinessMessage UpdateType = "edited_business_message" // Messages were deleted from a connected business account UpdateDeletedBusinessMessages UpdateType = "deleted_business_messages" // 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. UpdateMessageReaction UpdateType = "message_reaction" // 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. UpdateMessageReactionCount UpdateType = "message_reaction_count" // New incoming inline query UpdateInlineQuery UpdateType = "inline_query" // 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. UpdateChosenInlineResult UpdateType = "chosen_inline_result" // New incoming callback query UpdateCallbackQuery UpdateType = "callback_query" // New incoming shipping query. Only for invoices with flexible price UpdateShippingQuery UpdateType = "shipping_query" // New incoming pre-checkout query. Contains full information about checkout UpdatePreCheckoutQuery UpdateType = "pre_checkout_query" // A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat UpdatePurchasedPaidMedia UpdateType = "purchased_paid_media" // New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot UpdatePoll UpdateType = "poll" // A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. UpdatePollAnswer UpdateType = "poll_answer" // 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. UpdateMyChatMember UpdateType = "my_chat_member" // 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. UpdateChatMember UpdateType = "chat_member" // 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. UpdateChatJoinRequest UpdateType = "chat_join_request" // A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. UpdateChatBoost UpdateType = "chat_boost" // A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. UpdateRemovedChatBoost UpdateType = "removed_chat_boost" )
type UploadStickerFileRequest ¶
type UploadStickerFileRequest struct { UserID int64 `json:"user_id"` // User identifier of sticker file owner Sticker InputFile `json:"sticker"` // A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files: https://core.telegram.org/bots/api#sending-files StickerFormat string `json:"sticker_format"` // Format of the sticker, must be one of "static", "animated", "video" }
see Bot.UploadStickerFile(ctx, &UploadStickerFileRequest{})
type User ¶
type User struct { ID int64 `json:"id"` // 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. IsBot bool `json:"is_bot"` // True, if this user is a bot FirstName string `json:"first_name"` // User's or bot's first name LastName string `json:"last_name,omitempty"` // Optional. User's or bot's last name Username string `json:"username,omitempty"` // Optional. User's or bot's username LanguageCode string `json:"language_code,omitempty"` // Optional. IETF language tag of the user's language IsPremium bool `json:"is_premium,omitempty"` // Optional. True, if this user is a Telegram Premium user AddedToAttachmentMenu bool `json:"added_to_attachment_menu,omitempty"` // Optional. True, if this user added the bot to the attachment menu CanJoinGroups bool `json:"can_join_groups,omitempty"` // Optional. True, if the bot can be invited to groups. Returned only in getMe. CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"` // Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"` // Optional. True, if the bot supports inline queries. Returned only in getMe. CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"` // Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. HasMainWebApp bool `json:"has_main_web_app,omitempty"` // Optional. True, if the bot has a main Web App. Returned only in getMe. }
This object represents a Telegram user or bot.
type UserChatBoosts ¶
type UserChatBoosts struct {
Boosts []ChatBoost `json:"boosts"` // The list of boosts added to the chat by the user
}
This object represents a list of boosts added to a chat by a user.
type UserProfilePhotos ¶
type UserProfilePhotos struct { TotalCount int `json:"total_count"` // Total number of profile pictures the target user has Photos [][]PhotoSize `json:"photos"` // Requested profile pictures (in up to 4 sizes each) }
This object represent a user's profile pictures.
type UsersShared ¶
type UsersShared struct {}
This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
type Venue ¶
type Venue struct { Location *Location `json:"location"` // Venue location. Can't be a live location Title string `json:"title"` // Name of the venue Address string `json:"address"` // Address of the venue FoursquareID string `json:"foursquare_id,omitempty"` // Optional. Foursquare identifier of the venue FoursquareType string `json:"foursquare_type,omitempty"` // Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) GooglePlaceID string `json:"google_place_id,omitempty"` // Optional. Google Places identifier of the venue GooglePlaceType string `json:"google_place_type,omitempty"` // Optional. Google Places type of the venue. (See supported types.) }
This object represents a venue.
type VerifyChatRequest ¶
type VerifyChatRequest struct { ChatID ChatID `json:"chat_id"` // Unique identifier for the target chat or username of the target channel (in the format @channelusername) CustomDescription string `json:"custom_description,omitempty"` // Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. }
see Bot.VerifyChat(ctx, &VerifyChatRequest{})
type VerifyUserRequest ¶
type VerifyUserRequest struct { UserID int64 `json:"user_id"` // Unique identifier of the target user CustomDescription string `json:"custom_description,omitempty"` // Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description. }
see Bot.VerifyUser(ctx, &VerifyUserRequest{})
type Video ¶
type Video struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Width int `json:"width"` // Video width as defined by the sender Height int `json:"height"` // Video height as defined by the sender Duration int `json:"duration"` // Duration of the video in seconds as defined by the sender Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Video thumbnail Cover []PhotoSize `json:"cover,omitempty"` // Optional. Available sizes of the cover of the video in the message StartTimestamp int `json:"start_timestamp,omitempty"` // Optional. Timestamp in seconds from which the video will play in the message FileName string `json:"file_name,omitempty"` // Optional. Original filename as defined by the sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender FileSize int `json:"file_size,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. }
This object represents a video file.
type VideoChatEnded ¶
type VideoChatEnded struct {
Duration int `json:"duration"` // Video chat duration in seconds
}
This object represents a service message about a video chat ended in the chat.
type VideoChatParticipantsInvited ¶
type VideoChatParticipantsInvited struct {
Users []User `json:"users"` // New members that were invited to the video chat
}
This object represents a service message about new members invited to a video chat.
https://core.telegram.org/bots/api#videochatparticipantsinvited
type VideoChatScheduled ¶
type VideoChatScheduled struct {
StartDate int `json:"start_date"` // Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
}
This object represents a service message about a video chat scheduled in the chat.
type VideoChatStarted ¶
type VideoChatStarted interface{}
This object represents a service message about a video chat started in the chat. Currently holds no information.
type VideoNote ¶
type VideoNote struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Length int `json:"length"` // Video width and height (diameter of the video message) as defined by the sender Duration int `json:"duration"` // Duration of the video in seconds as defined by the sender Thumbnail *PhotoSize `json:"thumbnail,omitempty"` // Optional. Video thumbnail FileSize int `json:"file_size,omitempty"` // Optional. File size in bytes }
This object represents a video message (available in Telegram apps as of v.4.0).
type Voice ¶
type Voice struct { FileID string `json:"file_id"` // Identifier for this file, which can be used to download or reuse the file FileUniqueID string `json:"file_unique_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. Duration int `json:"duration"` // Duration of the audio in seconds as defined by the sender MimeType string `json:"mime_type,omitempty"` // Optional. MIME type of the file as defined by the sender FileSize int `json:"file_size,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. }
This object represents a voice note.
type WebAppData ¶
type WebAppData struct { Data string `json:"data"` // The data. Be aware that a bad client can send arbitrary data in this field. ButtonText string `json:"button_text"` // 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. }
Describes data sent from a Web App to the bot.
type WebAppInfo ¶
type WebAppInfo struct {
Url string `json:"url"` // An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
}
Describes a Web App.
type WebhookInfo ¶
type WebhookInfo struct { Url string `json:"url"` // Webhook URL, may be empty if webhook is not set up HasCustomCertificate bool `json:"has_custom_certificate"` // True, if a custom certificate was provided for webhook certificate checks PendingUpdateCount int `json:"pending_update_count"` // Number of updates awaiting delivery IpAddress string `json:"ip_address,omitempty"` // Optional. Currently used webhook IP address LastErrorDate int `json:"last_error_date,omitempty"` // Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook LastErrorMessage string `json:"last_error_message,omitempty"` // Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook LastSynchronizationErrorDate int `json:"last_synchronization_error_date,omitempty"` // Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters MaxConnections int `json:"max_connections,omitempty"` // Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery AllowedUpdates []UpdateType `json:"allowed_updates,omitempty"` // Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member }
Describes the current status of a webhook.
type WriteAccessAllowed ¶
type WriteAccessAllowed struct { FromRequest bool `json:"from_request,omitempty"` // Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess WebAppName string `json:"web_app_name,omitempty"` // Optional. Name of the Web App, if the access was granted when the Web App was launched from a link FromAttachmentMenu bool `json:"from_attachment_menu,omitempty"` // Optional. True, if the access was granted when the bot was added to the attachment or side menu }
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.