From ce228e02492ed898015fbefdbb287e83b55a336b Mon Sep 17 00:00:00 2001 From: Ivan Kalashnikov Date: Thu, 30 Oct 2025 14:19:13 +0700 Subject: [PATCH 1/6] Improve documentation for option functions. --- options.go | 64 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/options.go b/options.go index 0530ab18..a049bf77 100644 --- a/options.go +++ b/options.go @@ -9,73 +9,84 @@ import ( // Option is a function that configures a bot. type Option func(b *Bot) -// WithCheckInitTimeout allows to redefine CheckInitTimeout +// WithCheckInitTimeout returns Option that redefine CheckInitTimeout. +// This timeout is used to check if bot initialization was successful. func WithCheckInitTimeout(timeout time.Duration) Option { return func(b *Bot) { b.checkInitTimeout = timeout } } -// WithMiddlewares allows to set middlewares for each incoming request +// WithMiddlewares returns Option that sets middlewares for each incoming update. +// Middlewares are functions that execute before handlers. +// They are called in the order in which they are added. func WithMiddlewares(middlewares ...Middleware) Option { return func(b *Bot) { b.middlewares = append(b.middlewares, middlewares...) } } -// WithMessageTextHandler allows to set handler for incoming text messages -// Also you can use *bot.RegisterHandler function after bot creation +// WithMessageTextHandler returns Option that sets handler for incoming text messages. +// This handler will be called when a text message matches the specified pattern and match type. +// Also you can use *bot.RegisterHandler function after bot creation. func WithMessageTextHandler(pattern string, matchType MatchType, handler HandlerFunc) Option { return func(b *Bot) { b.RegisterHandler(HandlerTypeMessageText, pattern, matchType, handler) } } -// WithCallbackQueryDataHandler allows to set handler for incoming callback query -// Also you can use *bot.RegisterHandler function after bot creation +// WithCallbackQueryDataHandler returns Option that sets handler for incoming callback query. +// This handler will be called when a callback query data matches the specified pattern and match type. +// Also you can use *bot.RegisterHandler function after bot creation. func WithCallbackQueryDataHandler(pattern string, matchType MatchType, handler HandlerFunc) Option { return func(b *Bot) { b.RegisterHandler(HandlerTypeCallbackQueryData, pattern, matchType, handler) } } -// WithPhotoCaptionHandler allows to set handler for incoming photos with caption -// Also you can use *bot.RegisterHandler function after bot creation +// WithPhotoCaptionHandler returns Option that sets handler for incoming photos with caption. +// This handler will be called when a photo caption matches the specified pattern and match type. +// Also you can use *bot.RegisterHandler function after bot creation. func WithPhotoCaptionHandler(pattern string, matchType MatchType, handler HandlerFunc) Option { return func(b *Bot) { b.RegisterHandler(HandlerTypePhotoCaption, pattern, matchType, handler) } } -// WithDefaultHandler allows to set default handler for incoming updates +// WithDefaultHandler returns Option that sets default handler for incoming updates. +// This handler will be called when no other handlers match the incoming update. func WithDefaultHandler(handler HandlerFunc) Option { return func(b *Bot) { b.defaultHandlerFunc = handler } } -// WithDebug allows to enable debug mode. In debug mode, all requests and responses are logged by debug handler +// WithDebug returns Option that enables debug mode. +// In debug mode, all requests and responses are logged by debug handler. func WithDebug() Option { return func(b *Bot) { b.isDebug = true } } -// WithErrorsHandler allows to set handler for errors +// WithErrorsHandler returns Option that sets handler for errors. +// This handler will be called whenever an error occurs during bot operation. func WithErrorsHandler(handler ErrorsHandler) Option { return func(b *Bot) { b.errorsHandler = handler } } -// WithDebugHandler allows to set handler for debug messages +// WithDebugHandler returns Option that sets handler for debug messages. +// This handler will be called to process debug information when debug mode is enabled. func WithDebugHandler(handler DebugHandler) Option { return func(b *Bot) { b.debugHandler = handler } } -// WithHTTPClient allows to set custom http client +// WithHTTPClient returns Option that sets custom http client. +// This enables using custom HTTP configuration for all requests to Telegram API. func WithHTTPClient(pollTimeout time.Duration, client HttpClient) Option { return func(b *Bot) { b.pollTimeout = pollTimeout @@ -83,63 +94,72 @@ func WithHTTPClient(pollTimeout time.Duration, client HttpClient) Option { } } -// WithServerURL allows to set custom server url +// WithServerURL returns Option that sets custom server url. +// This is useful for using local Bot API server or alternative endpoints. func WithServerURL(serverURL string) Option { return func(b *Bot) { b.url = serverURL } } -// WithSkipGetMe allows skip call GetMe on bot init +// WithSkipGetMe returns Option that skips call GetMe on bot init. +// This can speed up bot initialization when bot information is not needed. func WithSkipGetMe() Option { return func(b *Bot) { b.skipGetMe = true } } -// WithAllowedUpdates allows to set custom params for getUpdates method +// WithAllowedUpdates returns Option that sets custom params for getUpdates method. +// This helps to filter which update types the bot should receive. func WithAllowedUpdates(params AllowedUpdates) Option { return func(b *Bot) { b.allowedUpdates = params } } -// WithUpdatesChannelCap allows setting custom capacity for the Updates channel +// WithUpdatesChannelCap returns Option that sets custom capacity for the Updates channel. +// Higher capacity can improve performance under high load at the cost of memory usage. func WithUpdatesChannelCap(cap int) Option { return func(b *Bot) { b.updates = make(chan *models.Update, cap) } } -// WithWebhookSecretToken allows setting X-Telegram-Bot-Api-Secret-Token sent from Telegram servers +// WithWebhookSecretToken returns Option that sets X-Telegram-Bot-Api-Secret-Token sent from Telegram servers. +// This token is used to verify that webhook requests actually come from Telegram. func WithWebhookSecretToken(webhookSecretToken string) Option { return func(b *Bot) { b.webhookSecretToken = webhookSecretToken } } -// WithWorkers allows setting the number of workers that are processing the Updates channel +// WithWorkers returns Option that sets the number of workers that are processing the Updates channel. +// More workers can improve concurrent update processing performance. func WithWorkers(workers int) Option { return func(b *Bot) { b.workers = workers } } -// UseTestEnvironment allows to use test environment +// UseTestEnvironment returns Option that enables test environment. +// This switches the bot to use Telegram's test servers for development and testing. func UseTestEnvironment() Option { return func(b *Bot) { b.testEnvironment = true } } -// WithNotAsyncHandlers allows to run handlers in the main goroutine +// WithNotAsyncHandlers returns Option that runs handlers in the main goroutine. +// This ensures handlers execute sequentially instead of concurrently. func WithNotAsyncHandlers() Option { return func(b *Bot) { b.notAsyncHandlers = true } } -// WithInitialOffset allows to set initial offset for getUpdates method +// WithInitialOffset returns Option that sets initial offset for getUpdates method. +// This determines which updates to skip when starting to receive new updates. func WithInitialOffset(offset int64) Option { return func(b *Bot) { b.lastUpdateID = offset From 5be0ec48a3fffd85cb3612aa1684f0784dd892f5 Mon Sep 17 00:00:00 2001 From: Ivan Kalashnikov Date: Thu, 30 Oct 2025 14:28:36 +0700 Subject: [PATCH 2/6] Update API documentation references to Telegram API. --- methods.go | 314 +++++++++++++++++++++++----------------------- methods_params.go | 116 ++++++++--------- 2 files changed, 215 insertions(+), 215 deletions(-) diff --git a/methods.go b/methods.go index 34f8274a..85a65f5c 100644 --- a/methods.go +++ b/methods.go @@ -6,1099 +6,1099 @@ import ( "github.com/go-telegram/bot/models" ) -// SetWebhook https://core.telegram.org/bots/api#setwebhook +// See Telegram API docs: https://core.telegram.org/bots/api#setwebhook func (b *Bot) SetWebhook(ctx context.Context, params *SetWebhookParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setWebhook", params, &result) return result, err } -// GetWebhookInfo https://core.telegram.org/bots/api#getwebhookinfo +// See Telegram API docs: https://core.telegram.org/bots/api#getwebhookinfo func (b *Bot) GetWebhookInfo(ctx context.Context) (*models.WebhookInfo, error) { result := &models.WebhookInfo{} err := b.rawRequest(ctx, "getWebhookInfo", nil, &result) return result, err } -// DeleteWebhook https://core.telegram.org/bots/api#deletewebhook +// See Telegram API docs: https://core.telegram.org/bots/api#deletewebhook func (b *Bot) DeleteWebhook(ctx context.Context, params *DeleteWebhookParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteWebhook", params, &result) return result, err } -// GetMe https://core.telegram.org/bots/api#getme +// See Telegram API docs: https://core.telegram.org/bots/api#getme func (b *Bot) GetMe(ctx context.Context) (*models.User, error) { result := &models.User{} err := b.rawRequest(ctx, "getMe", nil, result) return result, err } -// Logout https://core.telegram.org/bots/api#logout +// See Telegram API docs: https://core.telegram.org/bots/api#logout func (b *Bot) Logout(ctx context.Context) (bool, error) { var result bool err := b.rawRequest(ctx, "logout", nil, &result) return result, err } -// Close https://core.telegram.org/bots/api#close +// See Telegram API docs: https://core.telegram.org/bots/api#close func (b *Bot) Close(ctx context.Context) (bool, error) { var result bool err := b.rawRequest(ctx, "close", nil, &result) return result, err } -// SendMessage https://core.telegram.org/bots/api#sendmessage +// See Telegram API docs: https://core.telegram.org/bots/api#sendmessage func (b *Bot) SendMessage(ctx context.Context, params *SendMessageParams) (*models.Message, error) { mes := &models.Message{} err := b.rawRequest(ctx, "sendMessage", params, mes) return mes, err } -// ForwardMessage https://core.telegram.org/bots/api#forwardmessage +// See Telegram API docs: https://core.telegram.org/bots/api#forwardmessage func (b *Bot) ForwardMessage(ctx context.Context, params *ForwardMessageParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "forwardMessage", params, result) return result, err } -// ForwardMessages https://core.telegram.org/bots/api#forwardmessages +// See Telegram API docs: https://core.telegram.org/bots/api#forwardmessages func (b *Bot) ForwardMessages(ctx context.Context, params *ForwardMessagesParams) ([]models.MessageID, error) { var result []models.MessageID err := b.rawRequest(ctx, "forwardMessages", params, &result) return result, err } -// CopyMessage https://core.telegram.org/bots/api#copymessage +// See Telegram API docs: https://core.telegram.org/bots/api#copymessage func (b *Bot) CopyMessage(ctx context.Context, params *CopyMessageParams) (*models.MessageID, error) { result := &models.MessageID{} err := b.rawRequest(ctx, "copyMessage", params, result) return result, err } -// CopyMessages https://core.telegram.org/bots/api#copymessages +// See Telegram API docs: https://core.telegram.org/bots/api#copymessages func (b *Bot) CopyMessages(ctx context.Context, params *CopyMessagesParams) ([]models.MessageID, error) { var result []models.MessageID err := b.rawRequest(ctx, "copyMessages", params, &result) return result, err } -// SendPhoto https://core.telegram.org/bots/api#sendphoto +// See Telegram API docs: https://core.telegram.org/bots/api#sendphoto func (b *Bot) SendPhoto(ctx context.Context, params *SendPhotoParams) (*models.Message, error) { mes := &models.Message{} err := b.rawRequest(ctx, "sendPhoto", params, mes) return mes, err } -// SendAudio https://core.telegram.org/bots/api#sendaudio +// See Telegram API docs: https://core.telegram.org/bots/api#sendaudio func (b *Bot) SendAudio(ctx context.Context, params *SendAudioParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendAudio", params, result) return result, err } -// SendDocument https://core.telegram.org/bots/api#senddocument +// See Telegram API docs: https://core.telegram.org/bots/api#senddocument func (b *Bot) SendDocument(ctx context.Context, params *SendDocumentParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendDocument", params, result) return result, err } -// SendVideo https://core.telegram.org/bots/api#sendvideo +// See Telegram API docs: https://core.telegram.org/bots/api#sendvideo func (b *Bot) SendVideo(ctx context.Context, params *SendVideoParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendVideo", params, result) return result, err } -// SendAnimation https://core.telegram.org/bots/api#sendanimation +// See Telegram API docs: https://core.telegram.org/bots/api#sendanimation func (b *Bot) SendAnimation(ctx context.Context, params *SendAnimationParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendAnimation", params, result) return result, err } -// SendVoice https://core.telegram.org/bots/api#sendvoice +// See Telegram API docs: https://core.telegram.org/bots/api#sendvoice func (b *Bot) SendVoice(ctx context.Context, params *SendVoiceParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendVoice", params, result) return result, err } -// SendVideoNote https://core.telegram.org/bots/api#sendvideonote +// See Telegram API docs: https://core.telegram.org/bots/api#sendvideonote func (b *Bot) SendVideoNote(ctx context.Context, params *SendVideoNoteParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendVideoNote", params, result) return result, err } -// SendPaidMedia https://core.telegram.org/bots/api#sendpaidmedia +// See Telegram API docs: https://core.telegram.org/bots/api#sendpaidmedia func (b *Bot) SendPaidMedia(ctx context.Context, params *SendPaidMediaParams) (*models.Message, error) { var result models.Message err := b.rawRequest(ctx, "sendPaidMedia", params, &result) return &result, err } -// SendMediaGroup https://core.telegram.org/bots/api#sendmediagroup +// See Telegram API docs: https://core.telegram.org/bots/api#sendmediagroup func (b *Bot) SendMediaGroup(ctx context.Context, params *SendMediaGroupParams) ([]*models.Message, error) { var result []*models.Message err := b.rawRequest(ctx, "sendMediaGroup", params, &result) return result, err } -// SendLocation https://core.telegram.org/bots/api#sendlocation +// See Telegram API docs: https://core.telegram.org/bots/api#sendlocation func (b *Bot) SendLocation(ctx context.Context, params *SendLocationParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendLocation", params, result) return result, err } -// EditMessageLiveLocation https://core.telegram.org/bots/api#editmessagelivelocation +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagelivelocation func (b *Bot) EditMessageLiveLocation(ctx context.Context, params *EditMessageLiveLocationParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "editMessageLiveLocation", params, result) return result, err } -// StopMessageLiveLocation https://core.telegram.org/bots/api#stopmessagelivelocation +// See Telegram API docs: https://core.telegram.org/bots/api#stopmessagelivelocation func (b *Bot) StopMessageLiveLocation(ctx context.Context, params *StopMessageLiveLocationParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "stopMessageLiveLocation", params, result) return result, err } -// SendVenue https://core.telegram.org/bots/api#sendvenue +// See Telegram API docs: https://core.telegram.org/bots/api#sendvenue func (b *Bot) SendVenue(ctx context.Context, params *SendVenueParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendVenue", params, result) return result, err } -// SendContact https://core.telegram.org/bots/api#sendcontact +// See Telegram API docs: https://core.telegram.org/bots/api#sendcontact func (b *Bot) SendContact(ctx context.Context, params *SendContactParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendContact", params, result) return result, err } -// SendPoll https://core.telegram.org/bots/api#sendpoll +// See Telegram API docs: https://core.telegram.org/bots/api#sendpoll func (b *Bot) SendPoll(ctx context.Context, params *SendPollParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendPoll", params, result) return result, err } -// SendChecklist https://core.telegram.org/bots/api#sendchecklist +// See Telegram API docs: https://core.telegram.org/bots/api#sendchecklist func (b *Bot) SendChecklist(ctx context.Context, params *SendChecklistParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendChecklist", params, &result) return result, err } -// SendDice https://core.telegram.org/bots/api#senddice +// See Telegram API docs: https://core.telegram.org/bots/api#senddice func (b *Bot) SendDice(ctx context.Context, params *SendDiceParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendDice", params, &result) return result, err } -// SendChatAction https://core.telegram.org/bots/api#sendchataction +// See Telegram API docs: https://core.telegram.org/bots/api#sendchataction func (b *Bot) SendChatAction(ctx context.Context, params *SendChatActionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "sendChatAction", params, &result) return result, err } -// SetMessageReaction https://core.telegram.org/bots/api#setmessagereaction +// See Telegram API docs: https://core.telegram.org/bots/api#setmessagereaction func (b *Bot) SetMessageReaction(ctx context.Context, params *SetMessageReactionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setMessageReaction", params, &result) return result, err } -// GetUserProfilePhotos https://core.telegram.org/bots/api#getuserprofilephotos +// See Telegram API docs: https://core.telegram.org/bots/api#getuserprofilephotos func (b *Bot) GetUserProfilePhotos(ctx context.Context, params *GetUserProfilePhotosParams) (*models.UserProfilePhotos, error) { result := &models.UserProfilePhotos{} err := b.rawRequest(ctx, "getUserProfilePhotos", params, result) return result, err } -// SetUserEmojiStatus https://core.telegram.org/bots/api#setuseremojistatus +// See Telegram API docs: https://core.telegram.org/bots/api#setuseremojistatus func (b *Bot) SetUserEmojiStatus(ctx context.Context, params *SetUserEmojiStatusParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setUserEmojiStatus", params, &result) return result, err } -// GetFile https://core.telegram.org/bots/api#getfile +// See Telegram API docs: https://core.telegram.org/bots/api#getfile func (b *Bot) GetFile(ctx context.Context, params *GetFileParams) (*models.File, error) { result := &models.File{} err := b.rawRequest(ctx, "getFile", params, result) return result, err } -// BanChatMember https://core.telegram.org/bots/api#banchatmember +// See Telegram API docs: https://core.telegram.org/bots/api#banchatmember func (b *Bot) BanChatMember(ctx context.Context, params *BanChatMemberParams) (bool, error) { var result bool err := b.rawRequest(ctx, "banChatMember", params, &result) return result, err } -// UnbanChatMember https://core.telegram.org/bots/api#unbanchatmember +// See Telegram API docs: https://core.telegram.org/bots/api#unbanchatmember func (b *Bot) UnbanChatMember(ctx context.Context, params *UnbanChatMemberParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unbanChatMember", params, &result) return result, err } -// RestrictChatMember https://core.telegram.org/bots/api#restrictchatmember +// See Telegram API docs: https://core.telegram.org/bots/api#restrictchatmember func (b *Bot) RestrictChatMember(ctx context.Context, params *RestrictChatMemberParams) (bool, error) { var result bool err := b.rawRequest(ctx, "restrictChatMember", params, &result) return result, err } -// PromoteChatMember https://core.telegram.org/bots/api#promotechatmember +// See Telegram API docs: https://core.telegram.org/bots/api#promotechatmember func (b *Bot) PromoteChatMember(ctx context.Context, params *PromoteChatMemberParams) (bool, error) { var result bool err := b.rawRequest(ctx, "promoteChatMember", params, &result) return result, err } -// SetChatAdministratorCustomTitle https://core.telegram.org/bots/api#setchatadministratorcustomtitle +// See Telegram API docs: https://core.telegram.org/bots/api#setchatadministratorcustomtitle func (b *Bot) SetChatAdministratorCustomTitle(ctx context.Context, params *SetChatAdministratorCustomTitleParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatAdministratorCustomTitle", params, &result) return result, err } -// BanChatSenderChat https://core.telegram.org/bots/api#banchatsenderchat +// See Telegram API docs: https://core.telegram.org/bots/api#banchatsenderchat func (b *Bot) BanChatSenderChat(ctx context.Context, params *BanChatSenderChatParams) (bool, error) { var result bool err := b.rawRequest(ctx, "banChatSenderChat", params, &result) return result, err } -// UnbanChatSenderChat https://core.telegram.org/bots/api#unbanchatsenderchat +// See Telegram API docs: https://core.telegram.org/bots/api#unbanchatsenderchat func (b *Bot) UnbanChatSenderChat(ctx context.Context, params *UnbanChatSenderChatParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unbanChatSenderChat", params, &result) return result, err } -// SetChatPermissions https://core.telegram.org/bots/api#setchatpermissions +// See Telegram API docs: https://core.telegram.org/bots/api#setchatpermissions func (b *Bot) SetChatPermissions(ctx context.Context, params *SetChatPermissionsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatPermissions", params, &result) return result, err } -// ExportChatInviteLink https://core.telegram.org/bots/api#exportchatinvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#exportchatinvitelink func (b *Bot) ExportChatInviteLink(ctx context.Context, params *ExportChatInviteLinkParams) (string, error) { var result string err := b.rawRequest(ctx, "exportChatInviteLink", params, &result) return result, err } -// CreateChatInviteLink https://core.telegram.org/bots/api#createchatinvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#createchatinvitelink func (b *Bot) CreateChatInviteLink(ctx context.Context, params *CreateChatInviteLinkParams) (*models.ChatInviteLink, error) { result := &models.ChatInviteLink{} err := b.rawRequest(ctx, "createChatInviteLink", params, &result) return result, err } -// EditChatInviteLink https://core.telegram.org/bots/api#editchatinvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#editchatinvitelink func (b *Bot) EditChatInviteLink(ctx context.Context, params *EditChatInviteLinkParams) (*models.ChatInviteLink, error) { result := &models.ChatInviteLink{} err := b.rawRequest(ctx, "editChatInviteLink", params, &result) return result, err } -// CreateChatSubscriptionInviteLink https://core.telegram.org/bots/api#createchatsubscriptioninvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink func (b *Bot) CreateChatSubscriptionInviteLink(ctx context.Context, params *CreateChatSubscriptionInviteLinkParams) (*models.ChatInviteLink, error) { result := &models.ChatInviteLink{} err := b.rawRequest(ctx, "createChatSubscriptionInviteLink", params, &result) return result, err } -// EditChatSubscriptionInviteLink https://core.telegram.org/bots/api#editchatsubscriptioninvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink func (b *Bot) EditChatSubscriptionInviteLink(ctx context.Context, params *EditChatSubscriptionInviteLinkParams) (*models.ChatInviteLink, error) { result := &models.ChatInviteLink{} err := b.rawRequest(ctx, "editChatSubscriptionInviteLink", params, &result) return result, err } -// RevokeChatInviteLink https://core.telegram.org/bots/api#revokechatinvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#revokechatinvitelink func (b *Bot) RevokeChatInviteLink(ctx context.Context, params *RevokeChatInviteLinkParams) (*models.ChatInviteLink, error) { result := &models.ChatInviteLink{} err := b.rawRequest(ctx, "revokeChatInviteLink", params, &result) return result, err } -// ApproveChatJoinRequest https://core.telegram.org/bots/api#approvechatjoinrequest +// See Telegram API docs: https://core.telegram.org/bots/api#approvechatjoinrequest func (b *Bot) ApproveChatJoinRequest(ctx context.Context, params *ApproveChatJoinRequestParams) (bool, error) { var result bool err := b.rawRequest(ctx, "approveChatJoinRequest", params, &result) return result, err } -// DeclineChatJoinRequest https://core.telegram.org/bots/api#declinechatjoinrequest +// See Telegram API docs: https://core.telegram.org/bots/api#declinechatjoinrequest func (b *Bot) DeclineChatJoinRequest(ctx context.Context, params *DeclineChatJoinRequestParams) (bool, error) { var result bool err := b.rawRequest(ctx, "declineChatJoinRequest", params, &result) return result, err } -// SetChatPhoto https://core.telegram.org/bots/api#setchatphoto +// See Telegram API docs: https://core.telegram.org/bots/api#setchatphoto func (b *Bot) SetChatPhoto(ctx context.Context, params *SetChatPhotoParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatPhoto", params, &result) return result, err } -// DeleteChatPhoto https://core.telegram.org/bots/api#deletechatphoto +// See Telegram API docs: https://core.telegram.org/bots/api#deletechatphoto func (b *Bot) DeleteChatPhoto(ctx context.Context, params *DeleteChatPhotoParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteChatPhoto", params, &result) return result, err } -// SetChatTitle https://core.telegram.org/bots/api#setchattitle +// See Telegram API docs: https://core.telegram.org/bots/api#setchattitle func (b *Bot) SetChatTitle(ctx context.Context, params *SetChatTitleParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatTitle", params, &result) return result, err } -// SetChatDescription https://core.telegram.org/bots/api#setchatdescription +// See Telegram API docs: https://core.telegram.org/bots/api#setchatdescription func (b *Bot) SetChatDescription(ctx context.Context, params *SetChatDescriptionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatDescription", params, &result) return result, err } -// PinChatMessage https://core.telegram.org/bots/api#pinchatmessage +// See Telegram API docs: https://core.telegram.org/bots/api#pinchatmessage func (b *Bot) PinChatMessage(ctx context.Context, params *PinChatMessageParams) (bool, error) { var result bool err := b.rawRequest(ctx, "pinChatMessage", params, &result) return result, err } -// UnpinChatMessage https://core.telegram.org/bots/api#unpinchatmessage +// See Telegram API docs: https://core.telegram.org/bots/api#unpinchatmessage func (b *Bot) UnpinChatMessage(ctx context.Context, params *UnpinChatMessageParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unpinChatMessage", params, &result) return result, err } -// UnpinAllChatMessages https://core.telegram.org/bots/api#unpinallchatmessages +// See Telegram API docs: https://core.telegram.org/bots/api#unpinallchatmessages func (b *Bot) UnpinAllChatMessages(ctx context.Context, params *UnpinAllChatMessagesParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unpinAllChatMessages", params, &result) return result, err } -// LeaveChat https://core.telegram.org/bots/api#leavechat +// See Telegram API docs: https://core.telegram.org/bots/api#leavechat func (b *Bot) LeaveChat(ctx context.Context, params *LeaveChatParams) (bool, error) { var result bool err := b.rawRequest(ctx, "leaveChat", params, &result) return result, err } -// GetChat https://core.telegram.org/bots/api#getchat +// See Telegram API docs: https://core.telegram.org/bots/api#getchat func (b *Bot) GetChat(ctx context.Context, params *GetChatParams) (*models.ChatFullInfo, error) { var result *models.ChatFullInfo err := b.rawRequest(ctx, "getChat", params, &result) return result, err } -// GetChatAdministrators https://core.telegram.org/bots/api#getchatadministrators +// See Telegram API docs: https://core.telegram.org/bots/api#getchatadministrators func (b *Bot) GetChatAdministrators(ctx context.Context, params *GetChatAdministratorsParams) ([]models.ChatMember, error) { var result []models.ChatMember err := b.rawRequest(ctx, "getChatAdministrators", params, &result) return result, err } -// GetChatMemberCount https://core.telegram.org/bots/api#getchatmembercount +// See Telegram API docs: https://core.telegram.org/bots/api#getchatmembercount func (b *Bot) GetChatMemberCount(ctx context.Context, params *GetChatMemberCountParams) (int, error) { var result int err := b.rawRequest(ctx, "getChatMemberCount", params, &result) return result, err } -// GetChatMember https://core.telegram.org/bots/api#getchatmember +// See Telegram API docs: https://core.telegram.org/bots/api#getchatmember func (b *Bot) GetChatMember(ctx context.Context, params *GetChatMemberParams) (*models.ChatMember, error) { result := &models.ChatMember{} err := b.rawRequest(ctx, "getChatMember", params, &result) return result, err } -// SetChatStickerSet https://core.telegram.org/bots/api#setchatstickerset +// See Telegram API docs: https://core.telegram.org/bots/api#setchatstickerset func (b *Bot) SetChatStickerSet(ctx context.Context, params *SetChatStickerSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatStickerSet", params, &result) return result, err } -// GetForumTopicIconStickers https://core.telegram.org/bots/api#getforumtopiciconstickers +// See Telegram API docs: https://core.telegram.org/bots/api#getforumtopiciconstickers func (b *Bot) GetForumTopicIconStickers(ctx context.Context) ([]*models.Sticker, error) { var result []*models.Sticker err := b.rawRequest(ctx, "getForumTopicIconStickers", nil, &result) return result, err } -// CreateForumTopic https://core.telegram.org/bots/api#createforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#createforumtopic func (b *Bot) CreateForumTopic(ctx context.Context, params *CreateForumTopicParams) (*models.ForumTopic, error) { result := &models.ForumTopic{} err := b.rawRequest(ctx, "createForumTopic", params, &result) return result, err } -// EditForumTopic https://core.telegram.org/bots/api#editforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#editforumtopic func (b *Bot) EditForumTopic(ctx context.Context, params *EditForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "editForumTopic", params, &result) return result, err } -// CloseForumTopic https://core.telegram.org/bots/api#closeforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#closeforumtopic func (b *Bot) CloseForumTopic(ctx context.Context, params *CloseForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "closeForumTopic", params, &result) return result, err } -// ReopenForumTopic https://core.telegram.org/bots/api#reopenforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#reopenforumtopic func (b *Bot) ReopenForumTopic(ctx context.Context, params *ReopenForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "reopenForumTopic", params, &result) return result, err } -// UnpinAllForumTopicMessages https://core.telegram.org/bots/api#deleteforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#deleteforumtopic func (b *Bot) UnpinAllForumTopicMessages(ctx context.Context, params *UnpinAllForumTopicMessagesParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unpinAllForumTopicMessages", params, &result) return result, err } -// EditGeneralForumTopic https://core.telegram.org/bots/api#editgeneralforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#editgeneralforumtopic func (b *Bot) EditGeneralForumTopic(ctx context.Context, params *EditGeneralForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "editGeneralForumTopic", params, &result) return result, err } -// CloseGeneralForumTopic https://core.telegram.org/bots/api#closegeneralforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#closegeneralforumtopic func (b *Bot) CloseGeneralForumTopic(ctx context.Context, params *CloseGeneralForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "closeGeneralForumTopic", params, &result) return result, err } -// ReopenGeneralForumTopic https://core.telegram.org/bots/api#reopengeneralforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#reopengeneralforumtopic func (b *Bot) ReopenGeneralForumTopic(ctx context.Context, params *ReopenGeneralForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "reopenGeneralForumTopic", params, &result) return result, err } -// HideGeneralForumTopic https://core.telegram.org/bots/api#hidegeneralforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#hidegeneralforumtopic func (b *Bot) HideGeneralForumTopic(ctx context.Context, params *HideGeneralForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "hideGeneralForumTopic", params, &result) return result, err } -// UnhideGeneralForumTopic https://core.telegram.org/bots/api#unhidegeneralforumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#unhidegeneralforumtopic func (b *Bot) UnhideGeneralForumTopic(ctx context.Context, params *UnhideGeneralForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unhideGeneralForumTopic", params, &result) return result, err } -// UnpinAllGeneralForumTopicMessages https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages +// See Telegram API docs: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages func (b *Bot) UnpinAllGeneralForumTopicMessages(ctx context.Context, params *UnpinAllGeneralForumTopicMessagesParams) (bool, error) { var result bool err := b.rawRequest(ctx, "unpinAllGeneralForumTopicMessages", params, &result) return result, err } -// DeleteForumTopic https://core.telegram.org/bots/api#unpinallforumtopicmessages +// See Telegram API docs: https://core.telegram.org/bots/api#unpinallforumtopicmessages func (b *Bot) DeleteForumTopic(ctx context.Context, params *DeleteForumTopicParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteForumTopic", params, &result) return result, err } -// DeleteChatStickerSet https://core.telegram.org/bots/api#deletechatstickerset +// See Telegram API docs: https://core.telegram.org/bots/api#deletechatstickerset func (b *Bot) DeleteChatStickerSet(ctx context.Context, params *DeleteChatStickerSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteChatStickerSet", params, &result) return result, err } -// AnswerCallbackQuery https://core.telegram.org/bots/api#answercallbackquery +// See Telegram API docs: https://core.telegram.org/bots/api#answercallbackquery func (b *Bot) AnswerCallbackQuery(ctx context.Context, params *AnswerCallbackQueryParams) (bool, error) { var result bool err := b.rawRequest(ctx, "answerCallbackQuery", params, &result) return result, err } -// GetUserChatBoosts https://core.telegram.org/bots/api#getuserchatboosts +// See Telegram API docs: https://core.telegram.org/bots/api#getuserchatboosts func (b *Bot) GetUserChatBoosts(ctx context.Context, params *GetUserChatBoostsParams) (*models.UserChatBoosts, error) { result := &models.UserChatBoosts{} err := b.rawRequest(ctx, "getUserChatBoosts", params, &result) return result, err } -// GetBusinessConnection https://core.telegram.org/bots/api#getbusinessconnection +// See Telegram API docs: https://core.telegram.org/bots/api#getbusinessconnection func (b *Bot) GetBusinessConnection(ctx context.Context, params *GetBusinessConnectionParams) (*models.BusinessConnection, error) { result := &models.BusinessConnection{} err := b.rawRequest(ctx, "getBusinessConnection", params, &result) return result, err } -// SetMyCommands https://core.telegram.org/bots/api#setmycommands +// See Telegram API docs: https://core.telegram.org/bots/api#setmycommands func (b *Bot) SetMyCommands(ctx context.Context, params *SetMyCommandsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setMyCommands", params, &result) return result, err } -// DeleteMyCommands https://core.telegram.org/bots/api#deletemycommands +// See Telegram API docs: https://core.telegram.org/bots/api#deletemycommands func (b *Bot) DeleteMyCommands(ctx context.Context, params *DeleteMyCommandsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteMyCommands", params, &result) return result, err } -// GetMyCommands https://core.telegram.org/bots/api#getmycommands +// See Telegram API docs: https://core.telegram.org/bots/api#getmycommands func (b *Bot) GetMyCommands(ctx context.Context, params *GetMyCommandsParams) ([]models.BotCommand, error) { var result []models.BotCommand err := b.rawRequest(ctx, "getMyCommands", params, &result) return result, err } -// SetMyName https://core.telegram.org/bots/api#setmyname +// See Telegram API docs: https://core.telegram.org/bots/api#setmyname func (b *Bot) SetMyName(ctx context.Context, params *SetMyNameParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setMyName", params, &result) return result, err } -// GetMyName https://core.telegram.org/bots/api#getmyname +// See Telegram API docs: https://core.telegram.org/bots/api#getmyname func (b *Bot) GetMyName(ctx context.Context, params *GetMyNameParams) (models.BotName, error) { var result models.BotName err := b.rawRequest(ctx, "getMyName", params, &result) return result, err } -// SetMyDescription https://core.telegram.org/bots/api#setmydescription +// See Telegram API docs: https://core.telegram.org/bots/api#setmydescription func (b *Bot) SetMyDescription(ctx context.Context, params *SetMyDescriptionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setMyDescription", params, &result) return result, err } -// GetMyDescription https://core.telegram.org/bots/api#getmydescription +// See Telegram API docs: https://core.telegram.org/bots/api#getmydescription func (b *Bot) GetMyDescription(ctx context.Context, params *GetMyDescriptionParams) (models.BotDescription, error) { var result models.BotDescription err := b.rawRequest(ctx, "getMyDescription", params, &result) return result, err } -// SetMyShortDescription https://core.telegram.org/bots/api#setmyshortdescription +// See Telegram API docs: https://core.telegram.org/bots/api#setmyshortdescription func (b *Bot) SetMyShortDescription(ctx context.Context, params *SetMyShortDescriptionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setMyShortDescription", params, &result) return result, err } -// GetMyShortDescription https://core.telegram.org/bots/api#getmyshortdescription +// See Telegram API docs: https://core.telegram.org/bots/api#getmyshortdescription func (b *Bot) GetMyShortDescription(ctx context.Context, params *GetMyShortDescriptionParams) (models.BotShortDescription, error) { var result models.BotShortDescription err := b.rawRequest(ctx, "getMyShortDescription", params, &result) return result, err } -// SetChatMenuButton https://core.telegram.org/bots/api#setchatmenubutton +// See Telegram API docs: https://core.telegram.org/bots/api#setchatmenubutton func (b *Bot) SetChatMenuButton(ctx context.Context, params *SetChatMenuButtonParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setChatMenuButton", params, &result) return result, err } -// GetChatMenuButton https://core.telegram.org/bots/api#getchatmenubutton +// See Telegram API docs: https://core.telegram.org/bots/api#getchatmenubutton func (b *Bot) GetChatMenuButton(ctx context.Context, params *GetChatMenuButtonParams) (models.MenuButton, error) { var result models.MenuButton err := b.rawRequest(ctx, "getChatMenuButton", params, &result) return result, err } -// SetMyDefaultAdministratorRights https://core.telegram.org/bots/api#setmydefaultadministratorrights +// See Telegram API docs: https://core.telegram.org/bots/api#setmydefaultadministratorrights func (b *Bot) SetMyDefaultAdministratorRights(ctx context.Context, params *SetMyDefaultAdministratorRightsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setMyDefaultAdministratorRights", params, &result) return result, err } -// GetMyDefaultAdministratorRights https://core.telegram.org/bots/api#getmydefaultadministratorrights +// See Telegram API docs: https://core.telegram.org/bots/api#getmydefaultadministratorrights func (b *Bot) GetMyDefaultAdministratorRights(ctx context.Context, params *GetMyDefaultAdministratorRightsParams) (*models.ChatAdministratorRights, error) { result := &models.ChatAdministratorRights{} err := b.rawRequest(ctx, "setMyDefaultAdministratorRights", params, &result) return result, err } -// EditMessageText https://core.telegram.org/bots/api#editmessagetext +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagetext func (b *Bot) EditMessageText(ctx context.Context, params *EditMessageTextParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "editMessageText", params, result) return result, err } -// EditMessageCaption https://core.telegram.org/bots/api#editmessagecaption +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagecaption func (b *Bot) EditMessageCaption(ctx context.Context, params *EditMessageCaptionParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "editMessageCaption", params, result) return result, err } -// EditMessageMedia https://core.telegram.org/bots/api#editmessagemedia +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagemedia func (b *Bot) EditMessageMedia(ctx context.Context, params *EditMessageMediaParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "editMessageMedia", params, result) return result, err } -// EditMessageChecklist https://core.telegram.org/bots/api#editmessagechecklist +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagechecklist func (b *Bot) EditMessageChecklist(ctx context.Context, params *EditMessageChecklistParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "editMessageChecklist", params, result) return result, err } -// EditMessageReplyMarkup https://core.telegram.org/bots/api#editmessagereplymarkup +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagereplymarkup func (b *Bot) EditMessageReplyMarkup(ctx context.Context, params *EditMessageReplyMarkupParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "editMessageReplyMarkup", params, result) return result, err } -// StopPoll https://core.telegram.org/bots/api#stoppoll +// See Telegram API docs: https://core.telegram.org/bots/api#stoppoll func (b *Bot) StopPoll(ctx context.Context, params *StopPollParams) (*models.Poll, error) { result := &models.Poll{} err := b.rawRequest(ctx, "stopPoll", params, &result) return result, err } -// ApproveSuggestedPost https://core.telegram.org/bots/api#approvesuggestedpost +// See Telegram API docs: https://core.telegram.org/bots/api#approvesuggestedpost func (b *Bot) ApproveSuggestedPost(ctx context.Context, params *ApproveSuggestedPostParams) (bool, error) { var result bool err := b.rawRequest(ctx, "approveSuggestedPost", params, &result) return result, err } -// DeclineSuggestedPost https://core.telegram.org/bots/api#declinesuggestedpost +// See Telegram API docs: https://core.telegram.org/bots/api#declinesuggestedpost func (b *Bot) DeclineSuggestedPost(ctx context.Context, params *DeclineSuggestedPostParams) (bool, error) { var result bool err := b.rawRequest(ctx, "declineSuggestedPost", params, &result) return result, err } -// DeleteMessage https://core.telegram.org/bots/api#deletemessage +// See Telegram API docs: https://core.telegram.org/bots/api#deletemessage func (b *Bot) DeleteMessage(ctx context.Context, params *DeleteMessageParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteMessage", params, &result) return result, err } -// DeleteMessages https://core.telegram.org/bots/api#deletemessages +// See Telegram API docs: https://core.telegram.org/bots/api#deletemessages func (b *Bot) DeleteMessages(ctx context.Context, params *DeleteMessagesParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteMessages", params, &result) return result, err } -// SendSticker https://core.telegram.org/bots/api#sendsticker +// See Telegram API docs: https://core.telegram.org/bots/api#sendsticker func (b *Bot) SendSticker(ctx context.Context, params *SendStickerParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendSticker", params, &result) return result, err } -// GetStickerSet https://core.telegram.org/bots/api#getstickerset +// See Telegram API docs: https://core.telegram.org/bots/api#getstickerset func (b *Bot) GetStickerSet(ctx context.Context, params *GetStickerSetParams) (*models.StickerSet, error) { result := &models.StickerSet{} err := b.rawRequest(ctx, "getStickerSet", params, &result) return result, err } -// GetCustomEmojiStickers https://core.telegram.org/bots/api#getcustomemojistickers +// See Telegram API docs: https://core.telegram.org/bots/api#getcustomemojistickers func (b *Bot) GetCustomEmojiStickers(ctx context.Context, params *GetCustomEmojiStickersParams) ([]*models.Sticker, error) { var result []*models.Sticker err := b.rawRequest(ctx, "getCustomEmojiStickers", params, &result) return result, err } -// UploadStickerFile https://core.telegram.org/bots/api#uploadstickerfile +// See Telegram API docs: https://core.telegram.org/bots/api#uploadstickerfile func (b *Bot) UploadStickerFile(ctx context.Context, params *UploadStickerFileParams) (*models.File, error) { result := &models.File{} err := b.rawRequest(ctx, "uploadStickerFile", params, &result) return result, err } -// CreateNewStickerSet https://core.telegram.org/bots/api#createnewstickerset +// See Telegram API docs: https://core.telegram.org/bots/api#createnewstickerset func (b *Bot) CreateNewStickerSet(ctx context.Context, params *CreateNewStickerSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "createNewStickerSet", params, &result) return result, err } -// AddStickerToSet https://core.telegram.org/bots/api#addstickertoset +// See Telegram API docs: https://core.telegram.org/bots/api#addstickertoset func (b *Bot) AddStickerToSet(ctx context.Context, params *AddStickerToSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "addStickerToSet", params, &result) return result, err } -// SetStickerPositionInSet https://core.telegram.org/bots/api#setstickerpositioninset +// See Telegram API docs: https://core.telegram.org/bots/api#setstickerpositioninset func (b *Bot) SetStickerPositionInSet(ctx context.Context, params *SetStickerPositionInSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setStickerPositionInSet", params, &result) return result, err } -// DeleteStickerFromSet https://core.telegram.org/bots/api#deletestickerfromset +// See Telegram API docs: https://core.telegram.org/bots/api#deletestickerfromset func (b *Bot) DeleteStickerFromSet(ctx context.Context, params *DeleteStickerFromSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteStickerFromSet", params, &result) return result, err } -// ReplaceStickerInSet https://core.telegram.org/bots/api#replacestickerinset +// See Telegram API docs: https://core.telegram.org/bots/api#replacestickerinset func (b *Bot) ReplaceStickerInSet(ctx context.Context, params *ReplaceStickerInSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "replaceStickerInSet", params, &result) return result, err } -// SetStickerEmojiList https://core.telegram.org/bots/api#setstickeremojilist +// See Telegram API docs: https://core.telegram.org/bots/api#setstickeremojilist func (b *Bot) SetStickerEmojiList(ctx context.Context, params *SetStickerEmojiListParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setStickerEmojiList", params, &result) return result, err } -// SetStickerKeywords https://core.telegram.org/bots/api#setstickerkeywords +// See Telegram API docs: https://core.telegram.org/bots/api#setstickerkeywords func (b *Bot) SetStickerKeywords(ctx context.Context, params *SetStickerKeywordsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setStickerKeywords", params, &result) return result, err } -// SetStickerMaskPosition https://core.telegram.org/bots/api#setstickermaskposition +// See Telegram API docs: https://core.telegram.org/bots/api#setstickermaskposition func (b *Bot) SetStickerMaskPosition(ctx context.Context, params *SetStickerMaskPositionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setStickerMaskPosition", params, &result) return result, err } -// SetStickerSetTitle https://core.telegram.org/bots/api#setstickermaskposition +// See Telegram API docs: https://core.telegram.org/bots/api#setstickermaskposition func (b *Bot) SetStickerSetTitle(ctx context.Context, params *SetStickerSetTitleParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setStickerSetTitle", params, &result) return result, err } -// SetStickerSetThumbnail https://core.telegram.org/bots/api#setstickersetthumbnail +// See Telegram API docs: https://core.telegram.org/bots/api#setstickersetthumbnail func (b *Bot) SetStickerSetThumbnail(ctx context.Context, params *SetStickerSetThumbnailParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setStickerSetThumbnail", params, &result) return result, err } -// SetCustomEmojiStickerSetThumbnail https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail +// See Telegram API docs: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail func (b *Bot) SetCustomEmojiStickerSetThumbnail(ctx context.Context, params *SetCustomEmojiStickerSetThumbnailParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setCustomEmojiStickerSetThumbnail", params, &result) return result, err } -// DeleteStickerSet https://core.telegram.org/bots/api#deletestickerset +// See Telegram API docs: https://core.telegram.org/bots/api#deletestickerset func (b *Bot) DeleteStickerSet(ctx context.Context, params *DeleteStickerSetParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteStickerSet", params, &result) return result, err } -// AnswerInlineQuery https://core.telegram.org/bots/api#answerinlinequery +// See Telegram API docs: https://core.telegram.org/bots/api#answerinlinequery func (b *Bot) AnswerInlineQuery(ctx context.Context, params *AnswerInlineQueryParams) (bool, error) { var result bool err := b.rawRequest(ctx, "answerInlineQuery", params, &result) return result, err } -// AnswerWebAppQuery https://core.telegram.org/bots/api#answerwebappquery +// See Telegram API docs: https://core.telegram.org/bots/api#answerwebappquery func (b *Bot) AnswerWebAppQuery(ctx context.Context, params *AnswerWebAppQueryParams) (*models.SentWebAppMessage, error) { result := &models.SentWebAppMessage{} err := b.rawRequest(ctx, "answerWebAppQuery", params, result) return result, err } -// SavePreparedInlineMessage https://core.telegram.org/bots/api#savepreparedinlinemessage +// See Telegram API docs: https://core.telegram.org/bots/api#savepreparedinlinemessage func (b *Bot) SavePreparedInlineMessage(ctx context.Context, params *SavePreparedInlineMessageParams) (*models.PreparedInlineMessage, error) { result := &models.PreparedInlineMessage{} err := b.rawRequest(ctx, "savePreparedInlineMessage", params, result) return result, err } -// SendInvoice https://core.telegram.org/bots/api#sendinvoice +// See Telegram API docs: https://core.telegram.org/bots/api#sendinvoice func (b *Bot) SendInvoice(ctx context.Context, params *SendInvoiceParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendInvoice", params, result) return result, err } -// CreateInvoiceLink https://core.telegram.org/bots/api#createinvoicelink +// See Telegram API docs: https://core.telegram.org/bots/api#createinvoicelink func (b *Bot) CreateInvoiceLink(ctx context.Context, params *CreateInvoiceLinkParams) (string, error) { var result string err := b.rawRequest(ctx, "createInvoiceLink", params, &result) return result, err } -// AnswerShippingQuery https://core.telegram.org/bots/api#answershippingquery +// See Telegram API docs: https://core.telegram.org/bots/api#answershippingquery func (b *Bot) AnswerShippingQuery(ctx context.Context, params *AnswerShippingQueryParams) (bool, error) { var result bool err := b.rawRequest(ctx, "answerShippingQuery", params, &result) return result, err } -// AnswerPreCheckoutQuery https://core.telegram.org/bots/api#answerprecheckoutquery +// See Telegram API docs: https://core.telegram.org/bots/api#answerprecheckoutquery func (b *Bot) AnswerPreCheckoutQuery(ctx context.Context, params *AnswerPreCheckoutQueryParams) (bool, error) { var result bool err := b.rawRequest(ctx, "answerPreCheckoutQuery", params, &result) return result, err } -// GetMyStarBalance https://core.telegram.org/bots/api#getmystarbalance +// See Telegram API docs: https://core.telegram.org/bots/api#getmystarbalance func (b *Bot) GetMyStarBalance(ctx context.Context) (*models.StarAmount, error) { result := models.StarAmount{} err := b.rawRequest(ctx, "getMyStarBalance", nil, &result) return &result, err } -// GetStarTransactions https://core.telegram.org/bots/api#getstartransactions +// See Telegram API docs: https://core.telegram.org/bots/api#getstartransactions func (b *Bot) GetStarTransactions(ctx context.Context, params *GetStarTransactionsParams) (*models.StarTransactions, error) { result := models.StarTransactions{} err := b.rawRequest(ctx, "getStarTransactions", params, &result) return &result, err } -// RefundStarPayment https://core.telegram.org/bots/api#refundstarpayment +// See Telegram API docs: https://core.telegram.org/bots/api#refundstarpayment func (b *Bot) RefundStarPayment(ctx context.Context, params *RefundStarPaymentParams) (bool, error) { var result bool err := b.rawRequest(ctx, "refundStarPayment", params, &result) return result, err } -// EditUserStarSubscription https://core.telegram.org/bots/api#edituserstarsubscription +// See Telegram API docs: https://core.telegram.org/bots/api#edituserstarsubscription func (b *Bot) EditUserStarSubscription(ctx context.Context, params *EditUserStarSubscriptionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "editUserStarSubscription", params, &result) return result, err } -// SetPassportDataErrors https://core.telegram.org/bots/api#setpassportdataerrors +// See Telegram API docs: https://core.telegram.org/bots/api#setpassportdataerrors func (b *Bot) SetPassportDataErrors(ctx context.Context, params *SetPassportDataErrorsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setPassportDataErrors", params, &result) return result, err } -// SendGame https://core.telegram.org/bots/api#sendgame +// See Telegram API docs: https://core.telegram.org/bots/api#sendgame func (b *Bot) SendGame(ctx context.Context, params *SendGameParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "sendGame", params, result) return result, err } -// SetGameScore https://core.telegram.org/bots/api#setgamescore +// See Telegram API docs: https://core.telegram.org/bots/api#setgamescore func (b *Bot) SetGameScore(ctx context.Context, params *SetGameScoreParams) (*models.Message, error) { result := &models.Message{} err := b.rawRequest(ctx, "setGameScore", params, result) return result, err } -// GetGameHighScores https://core.telegram.org/bots/api#getgamehighscores +// See Telegram API docs: https://core.telegram.org/bots/api#getgamehighscores func (b *Bot) GetGameHighScores(ctx context.Context, params *GetGameHighScoresParams) ([]*models.GameHighScore, error) { var result []*models.GameHighScore err := b.rawRequest(ctx, "getGameHighScores", params, &result) return result, err } -// GetAvailableGifts https://core.telegram.org/bots/api#getavailablegifts +// See Telegram API docs: https://core.telegram.org/bots/api#getavailablegifts func (b *Bot) GetAvailableGifts(ctx context.Context) (*models.Gifts, error) { result := &models.Gifts{} err := b.rawRequest(ctx, "getAvailableGifts", nil, result) return result, err } -// SendGift https://core.telegram.org/bots/api#sendgift +// See Telegram API docs: https://core.telegram.org/bots/api#sendgift func (b *Bot) SendGift(ctx context.Context, params *SendGiftParams) (bool, error) { var result bool err := b.rawRequest(ctx, "sendGift", params, &result) return result, err } -// VerifyUser https://core.telegram.org/bots/api#verifyuser +// See Telegram API docs: https://core.telegram.org/bots/api#verifyuser func (b *Bot) VerifyUser(ctx context.Context, params *VerifyUserParams) (bool, error) { var result bool err := b.rawRequest(ctx, "verifyUser", params, &result) return result, err } -// VerifyChat https://core.telegram.org/bots/api#verifychat +// See Telegram API docs: https://core.telegram.org/bots/api#verifychat func (b *Bot) VerifyChat(ctx context.Context, params *VerifyChatParams) (bool, error) { var result bool err := b.rawRequest(ctx, "verifyChat", params, &result) return result, err } -// RemoveUserVerification https://core.telegram.org/bots/api#removeuserverification +// See Telegram API docs: https://core.telegram.org/bots/api#removeuserverification func (b *Bot) RemoveUserVerification(ctx context.Context, params *RemoveUserVerificationParams) (bool, error) { var result bool err := b.rawRequest(ctx, "removeUserVerification", params, &result) return result, err } -// RemoveChatVerification https://core.telegram.org/bots/api#removechatverification +// See Telegram API docs: https://core.telegram.org/bots/api#removechatverification func (b *Bot) RemoveChatVerification(ctx context.Context, params *RemoveChatVerificationParams) (bool, error) { var result bool err := b.rawRequest(ctx, "removeChatVerification", params, &result) return result, err } -// ReadBusinessMessage https://core.telegram.org/bots/api#readbusinessmessage +// See Telegram API docs: https://core.telegram.org/bots/api#readbusinessmessage func (b *Bot) ReadBusinessMessage(ctx context.Context, params *ReadBusinessMessageParams) (bool, error) { var result bool err := b.rawRequest(ctx, "readBusinessMessage", params, &result) return result, err } -// DeleteBusinessMessages https://core.telegram.org/bots/api#deletebusinessmessages +// See Telegram API docs: https://core.telegram.org/bots/api#deletebusinessmessages func (b *Bot) DeleteBusinessMessages(ctx context.Context, params *DeleteBusinessMessagesParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteBusinessMessages", params, &result) return result, err } -// SetBusinessAccountName https://core.telegram.org/bots/api#setbusinessaccountname +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountname func (b *Bot) SetBusinessAccountName(ctx context.Context, params *SetBusinessAccountNameParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setBusinessAccountName", params, &result) return result, err } -// SetBusinessAccountUsername https://core.telegram.org/bots/api#setbusinessaccountusername +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountusername func (b *Bot) SetBusinessAccountUsername(ctx context.Context, params *SetBusinessAccountUsernameParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setBusinessAccountUsername", params, &result) return result, err } -// SetBusinessAccountBio https://core.telegram.org/bots/api#setbusinessaccountbio +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountbio func (b *Bot) SetBusinessAccountBio(ctx context.Context, params *SetBusinessAccountBioParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setBusinessAccountBio", params, &result) return result, err } -// SetBusinessAccountProfilePhoto https://core.telegram.org/bots/api#setbusinessaccountprofilephoto +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto func (b *Bot) SetBusinessAccountProfilePhoto(ctx context.Context, params *SetBusinessAccountProfilePhotoParams) (bool, error) { var result bool err := b.rawRequest(ctx, "SetBusinessAccountProfilePhoto", params, &result) return result, err } -// RemoveBusinessAccountProfilePhoto https://core.telegram.org/bots/api#removebusinessaccountprofilephoto +// See Telegram API docs: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto func (b *Bot) RemoveBusinessAccountProfilePhoto(ctx context.Context, params *RemoveBusinessAccountProfilePhotoParams) (bool, error) { var result bool err := b.rawRequest(ctx, "removeBusinessAccountProfilePhoto", params, &result) return result, err } -// SetBusinessAccountGiftSettings https://core.telegram.org/bots/api#setbusinessaccountgiftsettings +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings func (b *Bot) SetBusinessAccountGiftSettings(ctx context.Context, params *SetBusinessAccountGiftSettingsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "setBusinessAccountGiftSettings", params, &result) return result, err } -// GetBusinessAccountStarBalance https://core.telegram.org/bots/api#getbusinessaccountstarbalance +// See Telegram API docs: https://core.telegram.org/bots/api#getbusinessaccountstarbalance func (b *Bot) GetBusinessAccountStarBalance(ctx context.Context, params *GetBusinessAccountStarBalanceParams) (*models.StarAmount, error) { result := &models.StarAmount{} err := b.rawRequest(ctx, "getBusinessAccountStarBalance", params, &result) return result, err } -// TransferBusinessAccountStars https://core.telegram.org/bots/api#transferbusinessaccountstars +// See Telegram API docs: https://core.telegram.org/bots/api#transferbusinessaccountstars func (b *Bot) TransferBusinessAccountStars(ctx context.Context, params *TransferBusinessAccountStarsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "transferBusinessAccountStars", params, &result) return result, err } -// GetBusinessAccountGifts https://core.telegram.org/bots/api#getbusinessaccountgifts +// See Telegram API docs: https://core.telegram.org/bots/api#getbusinessaccountgifts func (b *Bot) GetBusinessAccountGifts(ctx context.Context, params *GetBusinessAccountGiftsParams) (*models.OwnedGifts, error) { result := &models.OwnedGifts{} err := b.rawRequest(ctx, "getBusinessAccountGifts", params, &result) return result, err } -// ConvertGiftToStars https://core.telegram.org/bots/api#convertgifttostars +// See Telegram API docs: https://core.telegram.org/bots/api#convertgifttostars func (b *Bot) ConvertGiftToStars(ctx context.Context, params *ConvertGiftToStarsParams) (bool, error) { var result bool err := b.rawRequest(ctx, "convertGiftToStars", params, &result) return result, err } -// UpgradeGift https://core.telegram.org/bots/api#upgradegift +// See Telegram API docs: https://core.telegram.org/bots/api#upgradegift func (b *Bot) UpgradeGift(ctx context.Context, params *UpgradeGiftParams) (bool, error) { var result bool err := b.rawRequest(ctx, "upgradeGift", params, &result) return result, err } -// TransferGift https://core.telegram.org/bots/api#transfergift +// See Telegram API docs: https://core.telegram.org/bots/api#transfergift func (b *Bot) TransferGift(ctx context.Context, params *TransferGiftParams) (bool, error) { var result bool err := b.rawRequest(ctx, "transferGift", params, &result) return result, err } -// PostStory https://core.telegram.org/bots/api#poststory +// See Telegram API docs: https://core.telegram.org/bots/api#poststory func (b *Bot) PostStory(ctx context.Context, params *PostStoryParams) (*models.Story, error) { result := &models.Story{} err := b.rawRequest(ctx, "postStory", params, &result) return result, err } -// EditStory https://core.telegram.org/bots/api#editstory +// See Telegram API docs: https://core.telegram.org/bots/api#editstory func (b *Bot) EditStory(ctx context.Context, params *EditStoryParams) (*models.Story, error) { result := &models.Story{} err := b.rawRequest(ctx, "editStory", params, &result) return result, err } -// DeleteStory https://core.telegram.org/bots/api#deletestory +// See Telegram API docs: https://core.telegram.org/bots/api#deletestory func (b *Bot) DeleteStory(ctx context.Context, params *DeleteStoryParams) (bool, error) { var result bool err := b.rawRequest(ctx, "deleteStory", params, &result) return result, err } -// GiftPremiumSubscription https://core.telegram.org/bots/api#giftpremiumsubscription +// See Telegram API docs: https://core.telegram.org/bots/api#giftpremiumsubscription func (b *Bot) GiftPremiumSubscription(ctx context.Context, params *GiftPremiumSubscriptionParams) (bool, error) { var result bool err := b.rawRequest(ctx, "giftPremiumSubscription", params, &result) diff --git a/methods_params.go b/methods_params.go index c87e0916..f751d975 100644 --- a/methods_params.go +++ b/methods_params.go @@ -18,7 +18,7 @@ type DeleteWebhookParams struct { DropPendingUpdates bool `json:"drop_pending_updates,omitempty"` } -// SendMessageParams https://core.telegram.org/bots/api#sendmessage +// See Telegram API docs: https://core.telegram.org/bots/api#sendmessage type SendMessageParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -37,7 +37,7 @@ type SendMessageParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// ForwardMessageParams https://core.telegram.org/bots/api#forwardmessage +// See Telegram API docs: https://core.telegram.org/bots/api#forwardmessage type ForwardMessageParams struct { ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` @@ -50,7 +50,7 @@ type ForwardMessageParams struct { MessageID int `json:"message_id"` } -// ForwardMessagesParams https://core.telegram.org/bots/api#forwardmessages +// See Telegram API docs: https://core.telegram.org/bots/api#forwardmessages type ForwardMessagesParams struct { ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` @@ -61,7 +61,7 @@ type ForwardMessagesParams struct { ProtectContent bool `json:"protect_content,omitempty"` } -// CopyMessageParams https://core.telegram.org/bots/api#copymessage +// See Telegram API docs: https://core.telegram.org/bots/api#copymessage type CopyMessageParams struct { ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` @@ -81,7 +81,7 @@ type CopyMessageParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// CopyMessagesParams https://core.telegram.org/bots/api#copymessages +// See Telegram API docs: https://core.telegram.org/bots/api#copymessages type CopyMessagesParams struct { ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` @@ -93,7 +93,7 @@ type CopyMessagesParams struct { RemoveCaption bool `json:"remove_caption,omitempty"` } -// SendPhotoParams https://core.telegram.org/bots/api#sendphoto +// See Telegram API docs: https://core.telegram.org/bots/api#sendphoto type SendPhotoParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -114,7 +114,7 @@ type SendPhotoParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendAudioParams https://core.telegram.org/bots/api#sendaudio +// See Telegram API docs: https://core.telegram.org/bots/api#sendaudio type SendAudioParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -137,7 +137,7 @@ type SendAudioParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendDocumentParams https://core.telegram.org/bots/api#senddocument +// See Telegram API docs: https://core.telegram.org/bots/api#senddocument type SendDocumentParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -158,7 +158,7 @@ type SendDocumentParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendVideoParams https://core.telegram.org/bots/api#sendvideo +// See Telegram API docs: https://core.telegram.org/bots/api#sendvideo type SendVideoParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -186,7 +186,7 @@ type SendVideoParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendAnimationParams https://core.telegram.org/bots/api#sendanimation +// See Telegram API docs: https://core.telegram.org/bots/api#sendanimation type SendAnimationParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -211,7 +211,7 @@ type SendAnimationParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendVoiceParams https://core.telegram.org/bots/api#sendvoice +// See Telegram API docs: https://core.telegram.org/bots/api#sendvoice type SendVoiceParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -231,7 +231,7 @@ type SendVoiceParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendVideoNoteParams https://core.telegram.org/bots/api#sendvideonote +// See Telegram API docs: https://core.telegram.org/bots/api#sendvideonote type SendVideoNoteParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -250,7 +250,7 @@ type SendVideoNoteParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendPaidMediaParams https://core.telegram.org/bots/api#sendpaidmedia +// See Telegram API docs: https://core.telegram.org/bots/api#sendpaidmedia type SendPaidMediaParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -271,7 +271,7 @@ type SendPaidMediaParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendMediaGroupParams https://core.telegram.org/bots/api#sendmediagroup +// See Telegram API docs: https://core.telegram.org/bots/api#sendmediagroup type SendMediaGroupParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -285,7 +285,7 @@ type SendMediaGroupParams struct { ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` } -// SendLocationParams https://core.telegram.org/bots/api#sendlocation +// See Telegram API docs: https://core.telegram.org/bots/api#sendlocation type SendLocationParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -328,7 +328,7 @@ type StopMessageLiveLocationParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendVenueParams https://core.telegram.org/bots/api#sendvenue +// See Telegram API docs: https://core.telegram.org/bots/api#sendvenue type SendVenueParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -351,7 +351,7 @@ type SendVenueParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendContactParams https://core.telegram.org/bots/api#sendcontact +// See Telegram API docs: https://core.telegram.org/bots/api#sendcontact type SendContactParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -370,7 +370,7 @@ type SendContactParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendPollParams https://core.telegram.org/bots/api#sendpoll +// See Telegram API docs: https://core.telegram.org/bots/api#sendpoll type SendPollParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -397,7 +397,7 @@ type SendPollParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendChecklistParams https://core.telegram.org/bots/api#sendchecklist +// See Telegram API docs: https://core.telegram.org/bots/api#sendchecklist type SendChecklistParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID int `json:"chat_id"` @@ -409,7 +409,7 @@ type SendChecklistParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// SendDiceParams https://core.telegram.org/bots/api#senddice +// See Telegram API docs: https://core.telegram.org/bots/api#senddice type SendDiceParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -432,7 +432,7 @@ type SendChatActionParams struct { Action models.ChatAction `json:"action"` } -// SetMessageReactionParams https://core.telegram.org/bots/api#setmessagereaction +// See Telegram API docs: https://core.telegram.org/bots/api#setmessagereaction type SetMessageReactionParams struct { ChatID any `json:"chat_id"` MessageID int `json:"message_id"` @@ -446,7 +446,7 @@ type GetUserProfilePhotosParams struct { Limit int `json:"limit,omitempty"` } -// SetUserEmojiStatusParams https://core.telegram.org/bots/api#setuseremojistatus +// See Telegram API docs: https://core.telegram.org/bots/api#setuseremojistatus type SetUserEmojiStatusParams struct { UserID int64 `json:"user_id"` EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` @@ -702,13 +702,13 @@ type AnswerCallbackQueryParams struct { CacheTime int `json:"cache_time,omitempty"` } -// GetUserChatBoostsParams https://core.telegram.org/bots/api#getuserchatboosts +// See Telegram API docs: https://core.telegram.org/bots/api#getuserchatboosts type GetUserChatBoostsParams struct { ChatID any `json:"chat_id"` UserID int `json:"user_id"` } -// GetBusinessConnectionParams https://core.telegram.org/bots/api#getbusinessconnection +// See Telegram API docs: https://core.telegram.org/bots/api#getbusinessconnection type GetBusinessConnectionParams struct { BusinessConnectionID any `json:"business_connection_id"` } @@ -774,7 +774,7 @@ type GetMyDefaultAdministratorRightsParams struct { ForChannels bool `json:"for_channels,omitempty"` } -// EditMessageTextParams https://core.telegram.org/bots/api#editmessagetext +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagetext type EditMessageTextParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id,omitempty"` @@ -809,7 +809,7 @@ type EditMessageMediaParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// EditMessageChecklistParams https://core.telegram.org/bots/api#editmessagechecklist +// See Telegram API docs: https://core.telegram.org/bots/api#editmessagechecklist type EditMessageChecklistParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID int `json:"chat_id,omitempty"` @@ -833,33 +833,33 @@ type StopPollParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } -// ApproveSuggestedPostParams https://core.telegram.org/bots/api#approvesuggestedpost +// See Telegram API docs: https://core.telegram.org/bots/api#approvesuggestedpost type ApproveSuggestedPostParams struct { ChatID int `json:"chat_id"` MessageID int `json:"message_id"` SendDate int `json:"send_date,omitempty"` } -// DeclineSuggestedPostParams https://core.telegram.org/bots/api#declinesuggestedpost +// See Telegram API docs: https://core.telegram.org/bots/api#declinesuggestedpost type DeclineSuggestedPostParams struct { ChatID int `json:"chat_id"` MessageID int `json:"message_id"` Comment string `json:"comment,omitempty"` } -// DeleteMessageParams https://core.telegram.org/bots/api#deletemessage +// See Telegram API docs: https://core.telegram.org/bots/api#deletemessage type DeleteMessageParams struct { ChatID any `json:"chat_id"` MessageID int `json:"message_id"` } -// DeleteMessagesParams https://core.telegram.org/bots/api#deletemessages +// See Telegram API docs: https://core.telegram.org/bots/api#deletemessages type DeleteMessagesParams struct { ChatID any `json:"chat_id"` MessageIDs []int `json:"message_ids"` } -// SendStickerParams https://core.telegram.org/bots/api#sendsticker +// See Telegram API docs: https://core.telegram.org/bots/api#sendsticker type SendStickerParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -971,7 +971,7 @@ type AnswerWebAppQueryParams struct { Result models.InlineQueryResult `json:"result"` } -// SavePreparedInlineMessageParams https://core.telegram.org/bots/api#savepreparedinlinemessage +// See Telegram API docs: https://core.telegram.org/bots/api#savepreparedinlinemessage type SavePreparedInlineMessageParams struct { UserID int64 `json:"user_id"` Result models.InlineQueryResult `json:"result"` @@ -981,7 +981,7 @@ type SavePreparedInlineMessageParams struct { AllowChannelChats bool `json:"allow_channel_chats,omitempty"` } -// SendInvoiceParams https://core.telegram.org/bots/api#sendinvoice +// See Telegram API docs: https://core.telegram.org/bots/api#sendinvoice type SendInvoiceParams struct { ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` @@ -1064,7 +1064,7 @@ type RefundStarPaymentParams struct { TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` } -// EditUserStarSubscriptionParams https://core.telegram.org/bots/api#edituserstarsubscription +// See Telegram API docs: https://core.telegram.org/bots/api#edituserstarsubscription type EditUserStarSubscriptionParams struct { UserID int64 `json:"user_id"` TelegramPaymentChargeID string `json:"telegram_payment_charge_id"` @@ -1076,7 +1076,7 @@ type SetPassportDataErrorsParams struct { Errors []models.PassportElementError `json:"errors"` } -// SendGameParams https://core.telegram.org/bots/api#sendgame +// See Telegram API docs: https://core.telegram.org/bots/api#sendgame type SendGameParams struct { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` @@ -1107,7 +1107,7 @@ type GetGameHighScoresParams struct { InlineMessageID int `json:"inline_message_id,omitempty"` } -// SendGiftParams https://core.telegram.org/bots/api#sendgift +// See Telegram API docs: https://core.telegram.org/bots/api#sendgift type SendGiftParams struct { UserID int64 `json:"user_id"` ChatID any `json:"chat_id,omitempty"` @@ -1118,92 +1118,92 @@ type SendGiftParams struct { TextEntities []models.MessageEntity `json:"text_entities,omitempty"` } -// VerifyUserParams https://core.telegram.org/bots/api#verifyuser +// See Telegram API docs: https://core.telegram.org/bots/api#verifyuser type VerifyUserParams struct { UserID int64 `json:"user_id"` CustomDescription string `json:"custom_description,omitempty"` } -// VerifyChatParams https://core.telegram.org/bots/api#verifychat +// See Telegram API docs: https://core.telegram.org/bots/api#verifychat type VerifyChatParams struct { ChatID any `json:"chat_id"` CustomDescription string `json:"custom_description,omitempty"` } -// RemoveUserVerificationParams https://core.telegram.org/bots/api#removeuserverification +// See Telegram API docs: https://core.telegram.org/bots/api#removeuserverification type RemoveUserVerificationParams struct { UserID int64 `json:"user_id"` } -// RemoveChatVerificationParams https://core.telegram.org/bots/api#removechatverification +// See Telegram API docs: https://core.telegram.org/bots/api#removechatverification type RemoveChatVerificationParams struct { ChatID any `json:"chat_id"` } -// ReadBusinessMessageParams https://core.telegram.org/bots/api#readbusinessmessage +// See Telegram API docs: https://core.telegram.org/bots/api#readbusinessmessage type ReadBusinessMessageParams struct { BusinessConnectionID string `json:"business_connection_id"` ChatID int `json:"chat_id"` MessageID int `json:"message_id"` } -// DeleteBusinessMessagesParams https://core.telegram.org/bots/api#deletebusinessmessages +// See Telegram API docs: https://core.telegram.org/bots/api#deletebusinessmessages type DeleteBusinessMessagesParams struct { BusinessConnectionID string `json:"business_connection_id"` MessageIDs []int `json:"message_ids"` } -// SetBusinessAccountNameParams https://core.telegram.org/bots/api#setbusinessaccountname +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountname type SetBusinessAccountNameParams struct { BusinessConnectionID string `json:"business_connection_id"` FirstName string `json:"first_name"` LastName string `json:"last_name,omitempty"` } -// SetBusinessAccountUsernameParams https://core.telegram.org/bots/api#setbusinessaccountusername +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountusername type SetBusinessAccountUsernameParams struct { BusinessConnectionID string `json:"business_connection_id"` Username string `json:"username,omitempty"` } -// SetBusinessAccountBioParams https://core.telegram.org/bots/api#setbusinessaccountbio +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountbio type SetBusinessAccountBioParams struct { BusinessConnectionID string `json:"business_connection_id"` Bio string `json:"bio,omitempty"` } -// SetBusinessAccountProfilePhotoParams https://core.telegram.org/bots/api#setbusinessaccountprofilephoto +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto type SetBusinessAccountProfilePhotoParams struct { BusinessConnectionID string `json:"business_connection_id"` Photo models.InputProfilePhoto `json:"photo"` IsPublic bool `json:"is_public,omitempty"` } -// RemoveBusinessAccountProfilePhotoParams https://core.telegram.org/bots/api#removebusinessaccountprofilephoto +// See Telegram API docs: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto type RemoveBusinessAccountProfilePhotoParams struct { BusinessConnectionID string `json:"business_connection_id"` IsPublic bool `json:"is_public,omitempty"` } -// SetBusinessAccountGiftSettingsParams https://core.telegram.org/bots/api#setbusinessaccountgiftsettings +// See Telegram API docs: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings type SetBusinessAccountGiftSettingsParams struct { BusinessConnectionID string `json:"business_connection_id"` ShowGiftButton bool `json:"show_gift_button"` AcceptedGiftTypes models.AcceptedGiftTypes `json:"accepted_gift_types"` } -// GetBusinessAccountStarBalanceParams https://core.telegram.org/bots/api#getbusinessaccountstarbalance +// See Telegram API docs: https://core.telegram.org/bots/api#getbusinessaccountstarbalance type GetBusinessAccountStarBalanceParams struct { BusinessConnectionID string `json:"business_connection_id"` } -// TransferBusinessAccountStarsParams https://core.telegram.org/bots/api#transferbusinessaccountstars +// See Telegram API docs: https://core.telegram.org/bots/api#transferbusinessaccountstars type TransferBusinessAccountStarsParams struct { BusinessConnectionID string `json:"business_connection_id"` StarCount int `json:"star_count"` } -// GetBusinessAccountGiftsParams https://core.telegram.org/bots/api#getbusinessaccountgifts +// See Telegram API docs: https://core.telegram.org/bots/api#getbusinessaccountgifts type GetBusinessAccountGiftsParams struct { BusinessConnectionID string `json:"business_connection_id"` ExcludeUnsaved bool `json:"exclude_unsaved,omitempty"` @@ -1216,13 +1216,13 @@ type GetBusinessAccountGiftsParams struct { Limit int `json:"limit,omitempty"` } -// ConvertGiftToStarsParams https://core.telegram.org/bots/api#convertgifttostars +// See Telegram API docs: https://core.telegram.org/bots/api#convertgifttostars type ConvertGiftToStarsParams struct { BusinessConnectionID string `json:"business_connection_id"` OwnedGiftID string `json:"owned_gift_id"` } -// UpgradeGiftParams https://core.telegram.org/bots/api#upgradegift +// See Telegram API docs: https://core.telegram.org/bots/api#upgradegift type UpgradeGiftParams struct { BusinessConnectionID string `json:"business_connection_id"` OwnedGiftID string `json:"owned_gift_id"` @@ -1230,7 +1230,7 @@ type UpgradeGiftParams struct { StarCount int `json:"star_count,omitempty"` } -// TransferGiftParams https://core.telegram.org/bots/api#transfergift +// See Telegram API docs: https://core.telegram.org/bots/api#transfergift type TransferGiftParams struct { BusinessConnectionID string `json:"business_connection_id"` OwnedGiftID string `json:"owned_gift_id"` @@ -1238,7 +1238,7 @@ type TransferGiftParams struct { StarCount int `json:"star_count"` } -// PostStoryParams https://core.telegram.org/bots/api#poststory +// See Telegram API docs: https://core.telegram.org/bots/api#poststory type PostStoryParams struct { BusinessConnectionID string `json:"business_connection_id"` Content models.InputStoryContent `json:"content"` @@ -1251,7 +1251,7 @@ type PostStoryParams struct { ProtectContent bool `json:"protect_content,omitempty"` } -// EditStoryParams https://core.telegram.org/bots/api#editstory +// See Telegram API docs: https://core.telegram.org/bots/api#editstory type EditStoryParams struct { BusinessConnectionID string `json:"business_connection_id"` StoryID int `json:"story_id"` @@ -1262,13 +1262,13 @@ type EditStoryParams struct { Areas []models.StoryArea `json:"areas,omitempty"` } -// DeleteStoryParams https://core.telegram.org/bots/api#deletestory +// See Telegram API docs: https://core.telegram.org/bots/api#deletestory type DeleteStoryParams struct { BusinessConnectionID string `json:"business_connection_id"` StoryID int `json:"story_id"` } -// GiftPremiumSubscriptionParams https://core.telegram.org/bots/api#giftpremiumsubscription +// See Telegram API docs: https://core.telegram.org/bots/api#giftpremiumsubscription type GiftPremiumSubscriptionParams struct { UserID int64 `json:"user_id"` MonthCount int `json:"month_count"` From 16b6c30ae4569717f56cf43e3af6089a467ee4e9 Mon Sep 17 00:00:00 2001 From: Ivan Kalashnikov Date: Thu, 30 Oct 2025 14:49:54 +0700 Subject: [PATCH 3/6] Enhance documentation for Bot struct and related functions. --- bot.go | 60 ++++++++++++++++++++++++++--------------------- common.go | 16 ++++++------- process_update.go | 3 ++- 3 files changed, 42 insertions(+), 37 deletions(-) diff --git a/bot.go b/bot.go index c9ae9daf..120ed050 100644 --- a/bot.go +++ b/bot.go @@ -30,36 +30,42 @@ type Middleware func(next HandlerFunc) HandlerFunc type HandlerFunc func(ctx context.Context, bot *Bot, update *models.Update) type MatchFunc func(update *models.Update) bool -// Bot represents Telegram Bot main object +// Bot represents the main Telegram Bot instance with configuration and state management. +// It handles updates processing, middleware execution, and provides methods for Telegram API calls. +// The bot supports both polling and webhook modes with configurable concurrency and error handling. type Bot struct { lastUpdateID int64 - url string - token string - pollTimeout time.Duration - skipGetMe bool - webhookSecretToken string - testEnvironment bool - workers int - notAsyncHandlers bool - - defaultHandlerFunc HandlerFunc - - errorsHandler ErrorsHandler - debugHandler DebugHandler - - middlewares []Middleware - - handlersMx sync.RWMutex - handlers []handler - - client HttpClient - isDebug bool - checkInitTimeout time.Duration - - allowedUpdates AllowedUpdates - - updates chan *models.Update + // Connection and authentication + url string // Telegram API server URL + token string // Bot token from BotFather + pollTimeout time.Duration // Timeout for long polling requests + skipGetMe bool // Skip getMe call during initialization + webhookSecretToken string // Secret token for webhook validation + testEnvironment bool // Use Telegram test environment + + // Concurrency and execution control + workers int // Number of worker goroutines for processing updates + notAsyncHandlers bool // Execute handlers synchronously instead of in goroutines + + // Handler management + defaultHandlerFunc HandlerFunc // Fallback handler when no specific handler matches + middlewares []Middleware // Middleware chain applied to all handlers + handlersMx sync.RWMutex // Mutex for thread-safe handler operations + handlers []handler // Registered update handlers + + // Error and debug handling + errorsHandler ErrorsHandler // Custom error handler + debugHandler DebugHandler // Custom debug handler + + // HTTP client and debugging + client HttpClient // HTTP client for API requests + isDebug bool // Enable debug logging + checkInitTimeout time.Duration // Timeout for bot initialization checks + + // Update filtering and processing + allowedUpdates AllowedUpdates // Filter which update types to receive + updates chan *models.Update // Channel for incoming updates processing } // New creates new Bot instance diff --git a/common.go b/common.go index c64c80d3..19a730a4 100644 --- a/common.go +++ b/common.go @@ -13,11 +13,11 @@ import ( "time" ) -// escape special symbols in text for MarkdownV2 parse mode +const shouldBeEscaped = "_*[]()~`>#+-=|{}.!" -var shouldBeEscaped = "_*[]()~`>#+-=|{}.!" - -// EscapeMarkdown escapes special symbols for Telegram MarkdownV2 syntax +// EscapeMarkdown escapes all special symbols for Telegram MarkdownV2 syntax. +// Use this function to safely display user input or dynamic content in MarkdownV2 messages. +// Example: EscapeMarkdown("Hello_world") returns "Hello\_world" func EscapeMarkdown(s string) string { var result []rune for _, r := range s { @@ -29,7 +29,9 @@ func EscapeMarkdown(s string) string { return string(result) } -// EscapeMarkdownUnescaped escapes unescaped special symbols for Telegram Markdown v2 syntax +// EscapeMarkdownUnescaped escapes only unescaped special symbols for Telegram MarkdownV2 syntax. +// This function preserves existing escaping and only adds backslashes where needed. +// Use when working with partially formatted MarkdownV2 text that may already contain escaped characters. func EscapeMarkdownUnescaped(s string) string { var result []rune var escaped bool @@ -48,10 +50,6 @@ func EscapeMarkdownUnescaped(s string) string { return string(result) } -// log functions - -// random string generator - const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" const ( diff --git a/process_update.go b/process_update.go index 88d56beb..8ea0a015 100644 --- a/process_update.go +++ b/process_update.go @@ -17,7 +17,8 @@ func applyMiddlewares(h HandlerFunc, m ...Middleware) HandlerFunc { return wrapped } -// ProcessUpdate allows you to process update +// ProcessUpdate processes incoming update by finding appropriate handler and applying middlewares. +// Handlers execute asynchronously by default unless WithNotAsyncHandlers option is used. func (b *Bot) ProcessUpdate(ctx context.Context, upd *models.Update) { h := b.findHandler(upd) From b1a38a2543681439a7fc41a8efad23d7427dc6fc Mon Sep 17 00:00:00 2001 From: Ivan Kalashnikov Date: Thu, 30 Oct 2025 15:55:27 +0700 Subject: [PATCH 4/6] Update documentation links in models to point to the Telegram API docs. --- get_updates.go | 2 +- models/animation.go | 2 +- models/audio.go | 2 +- models/boost.go | 20 +++++----- models/bot_command.go | 8 ++-- models/bot_commands_scope.go | 16 ++++---- models/business.go | 12 +++--- models/callback_query.go | 2 +- models/chat.go | 16 ++++---- models/chat_background.go | 18 ++++----- models/chat_member.go | 16 ++++---- models/checklist.go | 12 +++--- models/chosen_inline_result.go | 2 +- models/contact.go | 2 +- models/dice.go | 2 +- models/document.go | 2 +- models/file.go | 2 +- models/forum.go | 24 +++++------ models/game.go | 4 +- models/gift.go | 30 +++++++------- models/giveaway.go | 8 ++-- models/inline_query.go | 62 ++++++++++++++--------------- models/input_file.go | 2 +- models/input_media.go | 12 +++--- models/input_profile.go | 6 +-- models/invoice.go | 2 +- models/link_preview.go | 2 +- models/location.go | 2 +- models/menu_button.go | 8 ++-- models/message.go | 14 +++---- models/message_entity.go | 2 +- models/order_info.go | 2 +- models/paid.go | 20 +++++----- models/passport_data.go | 8 ++-- models/passport_element_error.go | 20 +++++----- models/photo_size.go | 2 +- models/poll.go | 8 ++-- models/pre_checkout_query.go | 2 +- models/proximity_alert_triggered.go | 2 +- models/reaction.go | 16 ++++---- models/reply.go | 18 ++++----- models/reply_markup.go | 26 ++++++------ models/shipping_query.go | 6 +-- models/star.go | 32 +++++++-------- models/sticker.go | 6 +-- models/sticker_set.go | 2 +- models/story.go | 22 +++++----- models/successful_payment.go | 4 +- models/suggested_post.go | 16 ++++---- models/update.go | 4 +- models/user.go | 4 +- models/venue.go | 2 +- models/video.go | 2 +- models/video_chat.go | 8 ++-- models/video_note.go | 2 +- models/voice.go | 2 +- models/voice_chat.go | 8 ++-- models/web_app.go | 6 +-- models/web_hook_info.go | 2 +- 59 files changed, 283 insertions(+), 283 deletions(-) diff --git a/get_updates.go b/get_updates.go index feb77046..d23e3922 100644 --- a/get_updates.go +++ b/get_updates.go @@ -23,7 +23,7 @@ type getUpdatesParams struct { type AllowedUpdates []string -// GetUpdates https://core.telegram.org/bots/api#getupdates +// See Telegram API docs: https://core.telegram.org/bots/api#getupdates func (b *Bot) getUpdates(ctx context.Context, wg *sync.WaitGroup) { defer wg.Done() diff --git a/models/animation.go b/models/animation.go index a9c7837e..9191a238 100644 --- a/models/animation.go +++ b/models/animation.go @@ -1,6 +1,6 @@ package models -// Animation https://core.telegram.org/bots/api#animation +// See Telegram API docs: https://core.telegram.org/bots/api#animation type Animation struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/audio.go b/models/audio.go index 1b0f81f1..eab51274 100644 --- a/models/audio.go +++ b/models/audio.go @@ -1,6 +1,6 @@ package models -// Audio https://core.telegram.org/bots/api#audio +// See Telegram API docs: https://core.telegram.org/bots/api#audio type Audio struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/boost.go b/models/boost.go index ac493999..c564cedf 100644 --- a/models/boost.go +++ b/models/boost.go @@ -5,18 +5,18 @@ import ( "fmt" ) -// ChatBoostAdded https://core.telegram.org/bots/api#chatboostadded +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostadded type ChatBoostAdded struct { BoostCount int `json:"boost_count"` } -// ChatBoostUpdated https://core.telegram.org/bots/api#chatboostupdated +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostupdated type ChatBoostUpdated struct { Chat Chat `json:"chat"` Boost ChatBoost `json:"boost"` } -// ChatBoostRemoved https://core.telegram.org/bots/api#chatboostremoved +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostremoved type ChatBoostRemoved struct { Chat Chat `json:"chat"` BoostID string `json:"boost_id"` @@ -24,12 +24,12 @@ type ChatBoostRemoved struct { Source ChatBoostSource `json:"source"` } -// UserChatBoosts https://core.telegram.org/bots/api#userchatboosts +// See Telegram API docs: https://core.telegram.org/bots/api#userchatboosts type UserChatBoosts struct { Boosts []ChatBoost `json:"boosts"` } -// ChatBoost https://core.telegram.org/bots/api#chatboost +// See Telegram API docs: https://core.telegram.org/bots/api#chatboost type ChatBoost struct { BoostID string `json:"boost_id"` AddDate int `json:"add_date"` @@ -37,7 +37,7 @@ type ChatBoost struct { Source ChatBoostSource `json:"source"` } -// ChatBoostSource https://core.telegram.org/bots/api#chatboostsource +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostsource type ChatBoostSource struct { Source ChatBoostSourceType @@ -89,7 +89,7 @@ func (cbs *ChatBoostSource) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported ChatBoostSource type") } -// ChatBoostSourceType https://core.telegram.org/bots/api#chatboostsource +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostsource type ChatBoostSourceType string const ( @@ -98,19 +98,19 @@ const ( ChatBoostSourceTypeGiveaway ChatBoostSourceType = "giveaway" ) -// ChatBoostSourcePremium https://core.telegram.org/bots/api#chatboostsourcepremium +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostsourcepremium type ChatBoostSourcePremium struct { Source ChatBoostSourceType `json:"source"` // always “premium” User User `json:"user"` } -// ChatBoostSourceGiftCode https://core.telegram.org/bots/api#chatboostsourcegiftcode +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostsourcegiftcode type ChatBoostSourceGiftCode struct { Source ChatBoostSourceType `json:"source"` // always “gift_code” User User `json:"user"` } -// ChatBoostSourceGiveaway https://core.telegram.org/bots/api#chatboostsourcegiveaway +// See Telegram API docs: https://core.telegram.org/bots/api#chatboostsourcegiveaway type ChatBoostSourceGiveaway struct { Source ChatBoostSourceType `json:"source"` // always “giveaway” GiveawayMessageID int `json:"giveaway_message_id"` diff --git a/models/bot_command.go b/models/bot_command.go index 54e1611c..b00d23dc 100644 --- a/models/bot_command.go +++ b/models/bot_command.go @@ -1,22 +1,22 @@ package models -// BotCommand https://core.telegram.org/bots/api#botcommand +// See Telegram API docs: https://core.telegram.org/bots/api#botcommand type BotCommand struct { Command string `json:"command" rules:"min:1,max:32"` Description string `json:"description" rules:"min:1,max:256"` } -// BotName https://core.telegram.org/bots/api#botname +// See Telegram API docs: https://core.telegram.org/bots/api#botname type BotName struct { Name string `json:"name"` } -// BotDescription https://core.telegram.org/bots/api#botdescription +// See Telegram API docs: https://core.telegram.org/bots/api#botdescription type BotDescription struct { Description string `json:"description"` } -// BotShortDescription https://core.telegram.org/bots/api#botshortdescription +// See Telegram API docs: https://core.telegram.org/bots/api#botshortdescription type BotShortDescription struct { ShortDescription string `json:"short_description"` } diff --git a/models/bot_commands_scope.go b/models/bot_commands_scope.go index 3c1d0193..98203ff3 100644 --- a/models/bot_commands_scope.go +++ b/models/bot_commands_scope.go @@ -4,12 +4,12 @@ import ( "encoding/json" ) -// BotCommandScope https://core.telegram.org/bots/api#botcommandscope +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscope type BotCommandScope interface { MarshalCustom() ([]byte, error) } -// BotCommandScopeDefault https://core.telegram.org/bots/api#botcommandscopedefault +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopedefault type BotCommandScopeDefault struct{} func (m *BotCommandScopeDefault) MarshalCustom() ([]byte, error) { @@ -24,7 +24,7 @@ func (m *BotCommandScopeDefault) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// BotCommandScopeAllPrivateChats https://core.telegram.org/bots/api#botcommandscopeallprivatechats +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopeallprivatechats type BotCommandScopeAllPrivateChats struct{} func (m *BotCommandScopeAllPrivateChats) MarshalCustom() ([]byte, error) { @@ -39,7 +39,7 @@ func (m *BotCommandScopeAllPrivateChats) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// BotCommandScopeAllGroupChats https://core.telegram.org/bots/api#botcommandscopeallgroupchats +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopeallgroupchats type BotCommandScopeAllGroupChats struct{} func (m *BotCommandScopeAllGroupChats) MarshalCustom() ([]byte, error) { @@ -54,7 +54,7 @@ func (m *BotCommandScopeAllGroupChats) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// BotCommandScopeAllChatAdministrators https://core.telegram.org/bots/api#botcommandscopeallchatadministrators +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopeallchatadministrators type BotCommandScopeAllChatAdministrators struct{} func (m *BotCommandScopeAllChatAdministrators) MarshalCustom() ([]byte, error) { @@ -69,7 +69,7 @@ func (m *BotCommandScopeAllChatAdministrators) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// BotCommandScopeChat https://core.telegram.org/bots/api#botcommandscopechat +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopechat type BotCommandScopeChat struct { ChatID any `json:"chat_id"` } @@ -86,7 +86,7 @@ func (m *BotCommandScopeChat) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// BotCommandScopeChatAdministrators https://core.telegram.org/bots/api#botcommandscopechatadministrators +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopechatadministrators type BotCommandScopeChatAdministrators struct { ChatID any `json:"chat_id"` } @@ -103,7 +103,7 @@ func (m *BotCommandScopeChatAdministrators) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// BotCommandScopeChatMember https://core.telegram.org/bots/api#botcommandscopechatmember +// See Telegram API docs: https://core.telegram.org/bots/api#botcommandscopechatmember type BotCommandScopeChatMember struct { ChatID any `json:"chat_id"` UserID int64 `json:"user_id"` diff --git a/models/business.go b/models/business.go index a6e9400c..4e583667 100644 --- a/models/business.go +++ b/models/business.go @@ -1,6 +1,6 @@ package models -// BusinessConnection https://core.telegram.org/bots/api#businessconnection +// See Telegram API docs: https://core.telegram.org/bots/api#businessconnection type BusinessConnection struct { ID string `json:"id"` User User `json:"user"` @@ -10,33 +10,33 @@ type BusinessConnection struct { IsEnabled bool `json:"is_enabled"` } -// BusinessMessagesDeleted https://core.telegram.org/bots/api#businessmessagesdeleted +// See Telegram API docs: https://core.telegram.org/bots/api#businessmessagesdeleted type BusinessMessagesDeleted struct { BusinessConnectionID string `json:"business_connection_id"` Chat Chat `json:"chat"` MessageIDs []int `json:"message_ids"` } -// BusinessIntro https://core.telegram.org/bots/api#businessintro +// See Telegram API docs: https://core.telegram.org/bots/api#businessintro type BusinessIntro struct { Title string `json:"title,omitempty"` Message string `json:"message,omitempty"` Sticker *Sticker `json:"sticker,omitempty"` } -// BusinessLocation https://core.telegram.org/bots/api#businesslocation +// See Telegram API docs: https://core.telegram.org/bots/api#businesslocation type BusinessLocation struct { Address string `json:"address"` Location *Location `json:"location,omitempty"` } -// BusinessOpeningHours https://core.telegram.org/bots/api#businessopeninghours +// See Telegram API docs: https://core.telegram.org/bots/api#businessopeninghours type BusinessOpeningHours struct { TimeZoneName string `json:"time_zone_name"` OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"` } -// BusinessOpeningHoursInterval https://core.telegram.org/bots/api#businessopeninghoursinterval +// See Telegram API docs: https://core.telegram.org/bots/api#businessopeninghoursinterval type BusinessOpeningHoursInterval struct { OpeningMinute int `json:"opening_minute"` ClosingMinute int `json:"closing_minute"` diff --git a/models/callback_query.go b/models/callback_query.go index 0a18ea50..21d94ce0 100644 --- a/models/callback_query.go +++ b/models/callback_query.go @@ -1,6 +1,6 @@ package models -// CallbackQuery https://core.telegram.org/bots/api#callbackquery +// See Telegram API docs: https://core.telegram.org/bots/api#callbackquery type CallbackQuery struct { ID string `json:"id"` From User `json:"from,omitempty"` diff --git a/models/chat.go b/models/chat.go index 755241e0..4d439c0a 100644 --- a/models/chat.go +++ b/models/chat.go @@ -1,6 +1,6 @@ package models -// ChatJoinRequest https://core.telegram.org/bots/api#chatjoinrequest +// See Telegram API docs: https://core.telegram.org/bots/api#chatjoinrequest type ChatJoinRequest struct { Chat Chat `json:"chat"` From User `json:"from"` @@ -10,7 +10,7 @@ type ChatJoinRequest struct { InviteLink *ChatInviteLink `json:"invite_link,omitempty"` } -// ChatPhoto https://core.telegram.org/bots/api#chatphoto +// See Telegram API docs: https://core.telegram.org/bots/api#chatphoto type ChatPhoto struct { SmallFileID string `json:"small_file_id"` SmallFileUniqueID string `json:"small_file_unique_id"` @@ -18,7 +18,7 @@ type ChatPhoto struct { BigFileUniqueID string `json:"big_file_unique_id"` } -// ChatInviteLink https://core.telegram.org/bots/api#chatinvitelink +// See Telegram API docs: https://core.telegram.org/bots/api#chatinvitelink type ChatInviteLink struct { InviteLink string `json:"invite_link"` Creator User `json:"creator"` @@ -31,7 +31,7 @@ type ChatInviteLink struct { PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"` } -// ChatAdministratorRights https://core.telegram.org/bots/api#chatadministratorrights +// See Telegram API docs: https://core.telegram.org/bots/api#chatadministratorrights type ChatAdministratorRights struct { IsAnonymous bool `json:"is_anonymous"` CanManageChat bool `json:"can_manage_chat"` @@ -51,7 +51,7 @@ type ChatAdministratorRights struct { CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"` } -// ChatPermissions https://core.telegram.org/bots/api#chatpermissions +// See Telegram API docs: https://core.telegram.org/bots/api#chatpermissions type ChatPermissions struct { CanSendMessages bool `json:"can_send_messages,omitempty"` CanSendAudios bool `json:"can_send_audios"` @@ -69,7 +69,7 @@ type ChatPermissions struct { CanManageTopics bool `json:"can_manage_topics,omitempty"` } -// ChatLocation https://core.telegram.org/bots/api#chatlocation +// See Telegram API docs: https://core.telegram.org/bots/api#chatlocation type ChatLocation struct { Location Location `json:"location"` Address string `json:"address"` @@ -90,7 +90,7 @@ const ( ChatTypeChannel ChatType = "channel" ) -// Chat https://core.telegram.org/bots/api#chat +// See Telegram API docs: https://core.telegram.org/bots/api#chat type Chat struct { ID int64 `json:"id"` Type ChatType `json:"type"` @@ -102,7 +102,7 @@ type Chat struct { IsDirectMessages bool `json:"is_direct_messages,omitempty"` } -// ChatFullInfo https://core.telegram.org/bots/api#chatfullinfo +// See Telegram API docs: https://core.telegram.org/bots/api#chatfullinfo type ChatFullInfo struct { ID int64 `json:"id"` Type ChatType `json:"type"` diff --git a/models/chat_background.go b/models/chat_background.go index 527a6361..633129a8 100644 --- a/models/chat_background.go +++ b/models/chat_background.go @@ -14,12 +14,12 @@ const ( ChatBackgroundTypeChatTheme BackgroundTypeType = "chat_theme" ) -// ChatBackground https://core.telegram.org/bots/api#chatbackground +// See Telegram API docs: https://core.telegram.org/bots/api#chatbackground type ChatBackground struct { Type BackgroundType `json:"type"` } -// BackgroundType https://core.telegram.org/bots/api#backgroundtype +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundtype type BackgroundType struct { Type BackgroundTypeType Fill *BackgroundTypeFill @@ -74,14 +74,14 @@ func (cb *BackgroundType) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported ChatBackground type") } -// BackgroundTypeFill https://core.telegram.org/bots/api#backgroundtypefill +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundtypefill type BackgroundTypeFill struct { Type BackgroundTypeType `json:"type"` Fill BackgroundFill `json:"fill"` DarkThemeDimming int `json:"dark_theme_dimming"` } -// BackgroundTypeWallpaper https://core.telegram.org/bots/api#backgroundtypewallpaper +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundtypewallpaper type BackgroundTypeWallpaper struct { Type BackgroundTypeType `json:"type"` Document Document `json:"document"` @@ -90,7 +90,7 @@ type BackgroundTypeWallpaper struct { IsMoving bool `json:"is_moving,omitempty"` } -// BackgroundTypePattern https://core.telegram.org/bots/api#backgroundtypepattern +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundtypepattern type BackgroundTypePattern struct { Type BackgroundTypeType `json:"type"` Document Document `json:"document"` @@ -100,7 +100,7 @@ type BackgroundTypePattern struct { IsMoving bool `json:"is_moving,omitempty"` } -// BackgroundTypeChatTheme https://core.telegram.org/bots/api#backgroundtypechattheme +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundtypechattheme type BackgroundTypeChatTheme struct { Type BackgroundTypeType `json:"type"` ThemeName string `json:"theme_name"` @@ -163,13 +163,13 @@ func (bf *BackgroundFill) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported BackgroundFill type") } -// BackgroundFillSolid https://core.telegram.org/bots/api#backgroundfillsolid +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundfillsolid type BackgroundFillSolid struct { Type BackgroundFillType `json:"type"` Color int `json:"color"` } -// BackgroundFillGradient https://core.telegram.org/bots/api#backgroundfillgradient +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundfillgradient type BackgroundFillGradient struct { Type BackgroundFillType `json:"type"` TopColor int `json:"top_color"` @@ -177,7 +177,7 @@ type BackgroundFillGradient struct { RotationAngle int `json:"rotation_angle"` } -// BackgroundFillFreeformGradient https://core.telegram.org/bots/api#backgroundfillfreeformgradient +// See Telegram API docs: https://core.telegram.org/bots/api#backgroundfillfreeformgradient type BackgroundFillFreeformGradient struct { Type BackgroundFillType `json:"type"` Colors []int `json:"colors"` diff --git a/models/chat_member.go b/models/chat_member.go index 264f5cf7..967349bf 100644 --- a/models/chat_member.go +++ b/models/chat_member.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// ChatMemberUpdated https://core.telegram.org/bots/api#chatmemberupdated +// See Telegram API docs: https://core.telegram.org/bots/api#chatmemberupdated type ChatMemberUpdated struct { Chat Chat `json:"chat"` From User `json:"from"` @@ -28,7 +28,7 @@ const ( ChatMemberTypeBanned ChatMemberType = "kicked" ) -// ChatMember https://core.telegram.org/bots/api#chatmember +// See Telegram API docs: https://core.telegram.org/bots/api#chatmember type ChatMember struct { Type ChatMemberType @@ -103,7 +103,7 @@ func (c *ChatMember) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported ChatMember type") } -// ChatMemberOwner https://core.telegram.org/bots/api#chatmemberowner +// See Telegram API docs: https://core.telegram.org/bots/api#chatmemberowner type ChatMemberOwner struct { Status ChatMemberType `json:"status"` // The member's status in the chat, always “creator” User *User `json:"user"` @@ -111,7 +111,7 @@ type ChatMemberOwner struct { CustomTitle string `json:"custom_title,omitempty"` } -// ChatMemberAdministrator https://core.telegram.org/bots/api#chatmemberadministrator +// See Telegram API docs: https://core.telegram.org/bots/api#chatmemberadministrator type ChatMemberAdministrator struct { Status ChatMemberType `json:"status"` // The member's status in the chat, always “administrator” User User `json:"user"` @@ -135,14 +135,14 @@ type ChatMemberAdministrator struct { CustomTitle string `json:"custom_title,omitempty"` } -// ChatMemberMember https://core.telegram.org/bots/api#chatmembermember +// See Telegram API docs: https://core.telegram.org/bots/api#chatmembermember type ChatMemberMember struct { Status ChatMemberType `json:"status"` // The member's status in the chat, always “member” User *User `json:"user"` UntilDate int `json:"until_date,omitempty"` } -// ChatMemberRestricted https://core.telegram.org/bots/api#chatmemberrestricted +// See Telegram API docs: https://core.telegram.org/bots/api#chatmemberrestricted type ChatMemberRestricted struct { Status ChatMemberType `json:"status"` // The member's status in the chat, always “restricted” User *User `json:"user"` @@ -164,13 +164,13 @@ type ChatMemberRestricted struct { UntilDate int `json:"until_date"` } -// ChatMemberLeft https://core.telegram.org/bots/api#chatmemberleft +// See Telegram API docs: https://core.telegram.org/bots/api#chatmemberleft type ChatMemberLeft struct { Status ChatMemberType `json:"status"` // The member's status in the chat, always “left” User *User `json:"user"` } -// ChatMemberBanned https://core.telegram.org/bots/api#chatmemberbanned +// See Telegram API docs: https://core.telegram.org/bots/api#chatmemberbanned type ChatMemberBanned struct { Status ChatMemberType `json:"status"` // The member's status in the chat, always “kicked” User *User `json:"user"` diff --git a/models/checklist.go b/models/checklist.go index 92bb541e..4273b8d3 100644 --- a/models/checklist.go +++ b/models/checklist.go @@ -1,6 +1,6 @@ package models -// ChecklistTask https://core.telegram.org/bots/api#checklisttask +// See Telegram API docs: https://core.telegram.org/bots/api#checklisttask type ChecklistTask struct { ID int `json:"id"` Text string `json:"text"` @@ -9,7 +9,7 @@ type ChecklistTask struct { CompletionDate int `json:"completion_date,omitempty"` } -// Checklist https://core.telegram.org/bots/api#checklist +// See Telegram API docs: https://core.telegram.org/bots/api#checklist type Checklist struct { Title string `json:"title"` TitleEntities []MessageEntity `json:"title_entities,omitempty"` @@ -18,7 +18,7 @@ type Checklist struct { OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"` } -// InputChecklistTask https://core.telegram.org/bots/api#inputchecklisttask +// See Telegram API docs: https://core.telegram.org/bots/api#inputchecklisttask type InputChecklistTask struct { ID int `json:"id"` Text string `json:"text"` @@ -26,7 +26,7 @@ type InputChecklistTask struct { TextEntities []MessageEntity `json:"text_entities,omitempty"` } -// InputChecklist https://core.telegram.org/bots/api#inputchecklist +// See Telegram API docs: https://core.telegram.org/bots/api#inputchecklist type InputChecklist struct { Title string `json:"title"` ParseMode ParseMode `json:"parse_mode,omitempty"` @@ -36,14 +36,14 @@ type InputChecklist struct { OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"` } -// ChecklistTasksDone https://core.telegram.org/bots/api#checklisttasksdone +// See Telegram API docs: https://core.telegram.org/bots/api#checklisttasksdone type ChecklistTasksDone struct { ChecklistMessage *Message `json:"checklist_message,omitempty"` MarkedAsDoneTaskIDs []int `json:"marked_as_done_task_ids,omitempty"` MarkedAsNotDoneTaskIDs []int `json:"marked_as_not_done_task_ids,omitempty"` } -// ChecklistTasksAdded https://core.telegram.org/bots/api#checklisttasksadded +// See Telegram API docs: https://core.telegram.org/bots/api#checklisttasksadded type ChecklistTasksAdded struct { ChecklistMessage *Message `json:"checklist_message,omitempty"` Tasks []ChecklistTask `json:"tasks"` diff --git a/models/chosen_inline_result.go b/models/chosen_inline_result.go index 13a4ac6b..e1cba72f 100644 --- a/models/chosen_inline_result.go +++ b/models/chosen_inline_result.go @@ -1,6 +1,6 @@ package models -// ChosenInlineResult https://core.telegram.org/bots/api#choseninlineresult +// See Telegram API docs: https://core.telegram.org/bots/api#choseninlineresult type ChosenInlineResult struct { ResultID string `json:"result_id"` From User `json:"from"` diff --git a/models/contact.go b/models/contact.go index ec153b73..abcae2ee 100644 --- a/models/contact.go +++ b/models/contact.go @@ -1,6 +1,6 @@ package models -// Contact https://core.telegram.org/bots/api#contact +// See Telegram API docs: https://core.telegram.org/bots/api#contact type Contact struct { PhoneNumber string `json:"phone_number"` FirstName string `json:"first_name"` diff --git a/models/dice.go b/models/dice.go index c8ad4303..8d6d9ea6 100644 --- a/models/dice.go +++ b/models/dice.go @@ -1,6 +1,6 @@ package models -// Dice https://core.telegram.org/bots/api#dice +// See Telegram API docs: https://core.telegram.org/bots/api#dice type Dice struct { Emoji string `json:"emoji"` Value int `json:"value"` diff --git a/models/document.go b/models/document.go index 53519bb6..62485e71 100644 --- a/models/document.go +++ b/models/document.go @@ -1,6 +1,6 @@ package models -// Document https://core.telegram.org/bots/api#document +// See Telegram API docs: https://core.telegram.org/bots/api#document type Document struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/file.go b/models/file.go index adda77bf..fb6b0182 100644 --- a/models/file.go +++ b/models/file.go @@ -1,6 +1,6 @@ package models -// File https://core.telegram.org/bots/api#file +// See Telegram API docs: https://core.telegram.org/bots/api#file type File struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/forum.go b/models/forum.go index 66841998..8730cca8 100644 --- a/models/forum.go +++ b/models/forum.go @@ -1,6 +1,6 @@ package models -// ForumTopic https://core.telegram.org/bots/api#forumtopic +// See Telegram API docs: https://core.telegram.org/bots/api#forumtopic type ForumTopic struct { MessageThreadID int `json:"message_thread_id"` Name string `json:"name"` @@ -8,42 +8,42 @@ type ForumTopic struct { IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` } -// ForumTopicCreated https://core.telegram.org/bots/api#forumtopiccreated +// See Telegram API docs: https://core.telegram.org/bots/api#forumtopiccreated type ForumTopicCreated struct { Name string `json:"name"` IconColor int `json:"icon_color"` IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` } -// ForumTopicClosed https://core.telegram.org/bots/api#forumtopicclosed +// See Telegram API docs: https://core.telegram.org/bots/api#forumtopicclosed type ForumTopicClosed struct { } -// ForumTopicEdited https://core.telegram.org/bots/api#forumtopicedited +// See Telegram API docs: https://core.telegram.org/bots/api#forumtopicedited type ForumTopicEdited struct { Name string `json:"name,omitempty"` IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"` } -// ForumTopicReopened https://core.telegram.org/bots/api#forumtopicreopened +// See Telegram API docs: https://core.telegram.org/bots/api#forumtopicreopened type ForumTopicReopened struct { } -// GeneralForumTopicHidden https://core.telegram.org/bots/api#generalforumtopichidden +// See Telegram API docs: https://core.telegram.org/bots/api#generalforumtopichidden type GeneralForumTopicHidden struct { } -// GeneralForumTopicUnhidden https://core.telegram.org/bots/api#generalforumtopicunhidden +// See Telegram API docs: https://core.telegram.org/bots/api#generalforumtopicunhidden type GeneralForumTopicUnhidden struct { } -// UserShared https://core.telegram.org/bots/api#usershared +// See Telegram API docs: https://core.telegram.org/bots/api#usershared type UserShared struct { RequestID int `json:"request_id"` UserID int64 `json:"user_id"` } -// SharedUser https://core.telegram.org/bots/api#shareduser +// See Telegram API docs: https://core.telegram.org/bots/api#shareduser type SharedUser struct { UserID int64 `json:"user_id"` FirstName string `json:"first_name,omitempty"` @@ -52,13 +52,13 @@ type SharedUser struct { Photo []PhotoSize `json:"photo,omitempty"` } -// UsersShared https://core.telegram.org/bots/api#usersshared +// See Telegram API docs: https://core.telegram.org/bots/api#usersshared type UsersShared struct { RequestID int `json:"request_id"` Users []SharedUser `json:"users"` } -// ChatShared https://core.telegram.org/bots/api#chatshared +// See Telegram API docs: https://core.telegram.org/bots/api#chatshared type ChatShared struct { RequestID int `json:"request_id"` ChatID int64 `json:"chat_id"` @@ -67,7 +67,7 @@ type ChatShared struct { Photo []PhotoSize `json:"photo,omitempty"` } -// WriteAccessAllowed https://core.telegram.org/bots/api#writeaccessallowed +// See Telegram API docs: https://core.telegram.org/bots/api#writeaccessallowed type WriteAccessAllowed struct { FromRequest bool `json:"from_request,omitempty"` WebAppName string `json:"web_app_name,omitempty"` diff --git a/models/game.go b/models/game.go index 23a360a9..3ff75111 100644 --- a/models/game.go +++ b/models/game.go @@ -1,6 +1,6 @@ package models -// Game https://core.telegram.org/bots/api#game +// See Telegram API docs: https://core.telegram.org/bots/api#game type Game struct { Title string `json:"title"` Description string `json:"description"` @@ -10,7 +10,7 @@ type Game struct { Animation *Animation `json:"animation,omitempty"` } -// GameHighScore https://core.telegram.org/bots/api#gamehighscore +// See Telegram API docs: https://core.telegram.org/bots/api#gamehighscore type GameHighScore struct { Position int `json:"position"` User User `json:"user"` diff --git a/models/gift.go b/models/gift.go index 55f79eb6..aff6cdd7 100644 --- a/models/gift.go +++ b/models/gift.go @@ -5,12 +5,12 @@ import ( "fmt" ) -// Gifts https://core.telegram.org/bots/api#gifts +// See Telegram API docs: https://core.telegram.org/bots/api#gifts type Gifts struct { Gifts []Gift `json:"gifts"` } -// Gift https://core.telegram.org/bots/api#gift +// See Telegram API docs: https://core.telegram.org/bots/api#gift type Gift struct { ID string `json:"id"` Sticker Sticker `json:"sticker"` @@ -21,14 +21,14 @@ type Gift struct { PublisherChat *Chat `json:"publisher_chat,omitempty"` } -// AcceptedGiftTypes https://core.telegram.org/bots/api#acceptedgifttypes +// See Telegram API docs: https://core.telegram.org/bots/api#acceptedgifttypes type AcceptedGiftTypes struct { UnlimitedGifts bool `json:"unlimited_gifts"` LimitedGifts bool `json:"limited_gifts"` UniqueGifts bool `json:"unique_gifts"` } -// OwnedGift https://core.telegram.org/bots/api#ownedgift +// See Telegram API docs: https://core.telegram.org/bots/api#ownedgift type OwnedGift struct { Type OwnedGiftType `json:"type"` @@ -62,7 +62,7 @@ func (g *OwnedGift) UnmarshalJSON(data []byte) error { return fmt.Errorf("unsupported OwnedGift type") } -// OwnedGiftType https://core.telegram.org/bots/api#ownedgift +// See Telegram API docs: https://core.telegram.org/bots/api#ownedgift type OwnedGiftType string const ( @@ -70,7 +70,7 @@ const ( OwnedGiftTypeUnique OwnedGiftType = "unique" ) -// OwnedGiftRegular https://core.telegram.org/bots/api#ownedgiftregular +// See Telegram API docs: https://core.telegram.org/bots/api#ownedgiftregular type OwnedGiftRegular struct { Type OwnedGiftType `json:"type"` Gift Gift `json:"gift"` @@ -82,7 +82,7 @@ type OwnedGiftRegular struct { TransferStarCount int `json:"transfer_star_count,omitempty"` } -// OwnedGiftUnique https://core.telegram.org/bots/api#ownedgiftunique +// See Telegram API docs: https://core.telegram.org/bots/api#ownedgiftunique type OwnedGiftUnique struct { Type OwnedGiftType `json:"type"` Gift UniqueGift `json:"gift"` @@ -95,14 +95,14 @@ type OwnedGiftUnique struct { NextTransferDate int `json:"next_transfer_date,omitempty"` } -// OwnedGifts https://core.telegram.org/bots/api#ownedgifts +// See Telegram API docs: https://core.telegram.org/bots/api#ownedgifts type OwnedGifts struct { TotalCount int `json:"total_count"` Gifts []OwnedGift `json:"gifts"` NextOffset string `json:"next_offset,omitempty"` } -// UniqueGift https://core.telegram.org/bots/api#uniquegift +// See Telegram API docs: https://core.telegram.org/bots/api#uniquegift type UniqueGift struct { BaseName string `json:"base_name"` Name string `json:"name"` @@ -113,21 +113,21 @@ type UniqueGift struct { PublisherChat *Chat `json:"publisher_chat,omitempty"` } -// UniqueGiftModel https://core.telegram.org/bots/api#uniquegiftmodel +// See Telegram API docs: https://core.telegram.org/bots/api#uniquegiftmodel type UniqueGiftModel struct { Name string `json:"name"` Sticker Sticker `json:"sticker"` RarityPerMille int `json:"rarity_per_mille"` } -// UniqueGiftSymbol https://core.telegram.org/bots/api#uniquegiftsymbol +// See Telegram API docs: https://core.telegram.org/bots/api#uniquegiftsymbol type UniqueGiftSymbol struct { Name string `json:"name"` Sticker Sticker `json:"sticker"` RarityPerMille int `json:"rarity_per_mille"` } -// UniqueGiftBackdropColors https://core.telegram.org/bots/api#uniquegiftbackdropcolors +// See Telegram API docs: https://core.telegram.org/bots/api#uniquegiftbackdropcolors type UniqueGiftBackdropColors struct { CenterColor int `json:"center_color"` EdgeColor int `json:"edge_color"` @@ -135,14 +135,14 @@ type UniqueGiftBackdropColors struct { TextColor int `json:"text_color"` } -// UniqueGiftBackdrop https://core.telegram.org/bots/api#uniquegiftbackdrop +// See Telegram API docs: https://core.telegram.org/bots/api#uniquegiftbackdrop type UniqueGiftBackdrop struct { Name string `json:"name"` Colors UniqueGiftBackdropColors `json:"colors"` RarityPerMille int `json:"rarity_per_mille"` } -// GiftInfo https://core.telegram.org/bots/api#giftinfo +// See Telegram API docs: https://core.telegram.org/bots/api#giftinfo type GiftInfo struct { Gift Gift `json:"gift"` OwnedGiftID string `json:"owned_gift_id,omitempty"` @@ -154,7 +154,7 @@ type GiftInfo struct { IsPrivate bool `json:"is_private,omitempty"` } -// UniqueGiftInfo https://core.telegram.org/bots/api#uniquegiftinfo +// See Telegram API docs: https://core.telegram.org/bots/api#uniquegiftinfo type UniqueGiftInfo struct { Gift UniqueGift `json:"gift"` Origin string `json:"origin"` diff --git a/models/giveaway.go b/models/giveaway.go index 37635ad0..aed4d0cb 100644 --- a/models/giveaway.go +++ b/models/giveaway.go @@ -1,6 +1,6 @@ package models -// Giveaway https://core.telegram.org/bots/api#giveaway +// See Telegram API docs: https://core.telegram.org/bots/api#giveaway type Giveaway struct { Chats []Chat `json:"chats"` WinnersSelectionDate int `json:"winners_selection_date"` @@ -13,12 +13,12 @@ type Giveaway struct { PremiumSubscriptionMonthCount int `json:"premium_subscription_month_count,omitempty"` } -// GiveawayCreated https://core.telegram.org/bots/api#giveawaycreated +// See Telegram API docs: https://core.telegram.org/bots/api#giveawaycreated type GiveawayCreated struct { PrizeStarCount int `json:"prize_star_count,omitempty"` } -// GiveawayWinners https://core.telegram.org/bots/api#giveawaywinners +// See Telegram API docs: https://core.telegram.org/bots/api#giveawaywinners type GiveawayWinners struct { Chat Chat `json:"chat"` GiveawayMessageID int `json:"giveaway_message_id"` @@ -34,7 +34,7 @@ type GiveawayWinners struct { PrizeDescription string `json:"prize_description,omitempty"` } -// GiveawayCompleted https://core.telegram.org/bots/api#giveawaycompleted +// See Telegram API docs: https://core.telegram.org/bots/api#giveawaycompleted type GiveawayCompleted struct { WinnerCount int `json:"winner_count"` UnclaimedPrizeCount int `json:"unclaimed_prize_count,omitempty"` diff --git a/models/inline_query.go b/models/inline_query.go index 8a889b69..764ae60a 100644 --- a/models/inline_query.go +++ b/models/inline_query.go @@ -4,7 +4,7 @@ import ( "encoding/json" ) -// InlineQuery https://core.telegram.org/bots/api#inlinequery +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequery type InlineQuery struct { ID string `json:"id"` From *User `json:"from"` @@ -14,7 +14,7 @@ type InlineQuery struct { Location *Location `json:"location,omitempty"` } -// AnswerInlineQuery https://core.telegram.org/bots/api#answerinlinequery +// See Telegram API docs: https://core.telegram.org/bots/api#answerinlinequery type AnswerInlineQuery struct { InlineQueryID string `json:"inline_query_id"` Results []InlineQueryResult `json:"results"` @@ -25,21 +25,21 @@ type AnswerInlineQuery struct { SwitchPmParameter string `json:"switch_pm_parameter,omitempty"` } -// InlineQueryResultsButton https://core.telegram.org/bots/api#inlinequeryresultsbutton +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultsbutton type InlineQueryResultsButton struct { Text string `json:"text"` WebApp *WebAppInfo `json:"web_app"` StartParameter string `json:"start_parameter,omitempty"` } -// InlineQueryResult https://core.telegram.org/bots/api#inlinequeryresult +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresult type InlineQueryResult interface { inlineQueryResultTag() MarshalCustom() ([]byte, error) } -// InlineQueryResultArticle https://core.telegram.org/bots/api#inlinequeryresultarticle +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultarticle type InlineQueryResultArticle struct { ID string `json:"id"` Title string `json:"title,omitempty"` @@ -66,7 +66,7 @@ func (m *InlineQueryResultArticle) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultPhoto https://core.telegram.org/bots/api#inlinequeryresultphoto +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultphoto type InlineQueryResultPhoto struct { ID string `json:"id"` PhotoURL string `json:"photo_url"` @@ -97,7 +97,7 @@ func (m *InlineQueryResultPhoto) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultGif https://core.telegram.org/bots/api#inlinequeryresultgif +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultgif type InlineQueryResultGif struct { ID string `json:"id"` GifURL string `json:"gif_url"` @@ -129,7 +129,7 @@ func (m *InlineQueryResultGif) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultMpeg4Gif https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif type InlineQueryResultMpeg4Gif struct { ID string `json:"id"` Mpeg4URL string `json:"mpeg4_url"` @@ -161,7 +161,7 @@ func (m *InlineQueryResultMpeg4Gif) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultVideo https://core.telegram.org/bots/api#inlinequeryresultvideo +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultvideo type InlineQueryResultVideo struct { ID string `json:"id"` VideoURL string `json:"video_url"` @@ -194,7 +194,7 @@ func (m *InlineQueryResultVideo) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultAudio https://core.telegram.org/bots/api#inlinequeryresultaudio +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultaudio type InlineQueryResultAudio struct { ID string `json:"id"` AudioURL string `json:"audio_url"` @@ -222,7 +222,7 @@ func (m *InlineQueryResultAudio) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultVoice https://core.telegram.org/bots/api#inlinequeryresultvoice +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultvoice type InlineQueryResultVoice struct { ID string `json:"id"` VoiceURL string `json:"voice_url"` @@ -249,7 +249,7 @@ func (m *InlineQueryResultVoice) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultDocument https://core.telegram.org/bots/api#inlinequeryresultdocument +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultdocument type InlineQueryResultDocument struct { ID string `json:"id"` Title string `json:"title,omitempty"` @@ -280,7 +280,7 @@ func (m *InlineQueryResultDocument) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultLocation https://core.telegram.org/bots/api#inlinequeryresultlocation +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultlocation type InlineQueryResultLocation struct { ID string `json:"id"` Latitude float64 `json:"latitude"` @@ -311,7 +311,7 @@ func (m *InlineQueryResultLocation) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultVenue https://core.telegram.org/bots/api#inlinequeryresultvenue +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultvenue type InlineQueryResultVenue struct { ID string `json:"id"` Latitude float64 `json:"latitude"` @@ -343,7 +343,7 @@ func (m *InlineQueryResultVenue) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultContact https://core.telegram.org/bots/api#inlinequeryresultcontact +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcontact type InlineQueryResultContact struct { ID string `json:"id"` PhoneNumber string `json:"phone_number"` @@ -371,7 +371,7 @@ func (m *InlineQueryResultContact) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultGame https://core.telegram.org/bots/api#inlinequeryresultgame +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultgame type InlineQueryResultGame struct { ID string `json:"id"` GameShortName string `json:"game_short_name"` @@ -392,7 +392,7 @@ func (m *InlineQueryResultGame) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedPhoto https://core.telegram.org/bots/api#inlinequeryresultcachedphoto +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedphoto type InlineQueryResultCachedPhoto struct { ID string `json:"id"` PhotoFileID string `json:"photo_file_id"` @@ -420,7 +420,7 @@ func (m *InlineQueryResultCachedPhoto) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedGif https://core.telegram.org/bots/api#inlinequeryresultcachedgif +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedgif type InlineQueryResultCachedGif struct { ID string `json:"id"` GifFileID string `json:"gif_file_id"` @@ -447,7 +447,7 @@ func (m *InlineQueryResultCachedGif) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedMpeg4Gif https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif type InlineQueryResultCachedMpeg4Gif struct { ID string `json:"id"` Mpeg4FileID string `json:"mpeg4_file_id"` @@ -474,7 +474,7 @@ func (m *InlineQueryResultCachedMpeg4Gif) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedSticker https://core.telegram.org/bots/api#inlinequeryresultcachedsticker +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedsticker type InlineQueryResultCachedSticker struct { ID string `json:"id"` StickerFileID string `json:"sticker_file_id"` @@ -496,7 +496,7 @@ func (m *InlineQueryResultCachedSticker) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedDocument https://core.telegram.org/bots/api#inlinequeryresultcacheddocument +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcacheddocument type InlineQueryResultCachedDocument struct { ID string `json:"id"` Title string `json:"title,omitempty"` @@ -523,7 +523,7 @@ func (m *InlineQueryResultCachedDocument) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedVideo https://core.telegram.org/bots/api#inlinequeryresultcachedvideo +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedvideo type InlineQueryResultCachedVideo struct { ID string `json:"id"` VideoFileID string `json:"video_file_id"` @@ -551,7 +551,7 @@ func (m *InlineQueryResultCachedVideo) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedVoice https://core.telegram.org/bots/api#inlinequeryresultcachedvoice +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedvoice type InlineQueryResultCachedVoice struct { ID string `json:"id"` VoiceFileID string `json:"voice_file_id"` @@ -577,7 +577,7 @@ func (m *InlineQueryResultCachedVoice) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InlineQueryResultCachedAudio https://core.telegram.org/bots/api#inlinequeryresultcachedaudio +// See Telegram API docs: https://core.telegram.org/bots/api#inlinequeryresultcachedaudio type InlineQueryResultCachedAudio struct { ID string `json:"id"` AudioFileID string `json:"audio_file_id"` @@ -602,12 +602,12 @@ func (m *InlineQueryResultCachedAudio) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// InputMessageContent https://core.telegram.org/bots/api#inputmessagecontent +// See Telegram API docs: https://core.telegram.org/bots/api#inputmessagecontent type InputMessageContent interface { inputMessageContentTag() } -// InputTextMessageContent https://core.telegram.org/bots/api#inputtextmessagecontent +// See Telegram API docs: https://core.telegram.org/bots/api#inputtextmessagecontent type InputTextMessageContent struct { MessageText string `json:"message_text"` ParseMode ParseMode `json:"parse_mode,omitempty"` @@ -617,7 +617,7 @@ type InputTextMessageContent struct { func (InputTextMessageContent) inputMessageContentTag() {} -// InputLocationMessageContent https://core.telegram.org/bots/api#inputlocationmessagecontent +// See Telegram API docs: https://core.telegram.org/bots/api#inputlocationmessagecontent type InputLocationMessageContent struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` @@ -629,7 +629,7 @@ type InputLocationMessageContent struct { func (InputLocationMessageContent) inputMessageContentTag() {} -// InputVenueMessageContent https://core.telegram.org/bots/api#inputvenuemessagecontent +// See Telegram API docs: https://core.telegram.org/bots/api#inputvenuemessagecontent type InputVenueMessageContent struct { Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` @@ -643,7 +643,7 @@ type InputVenueMessageContent struct { func (InputVenueMessageContent) inputMessageContentTag() {} -// InputContactMessageContent https://core.telegram.org/bots/api#inputcontactmessagecontent +// See Telegram API docs: https://core.telegram.org/bots/api#inputcontactmessagecontent type InputContactMessageContent struct { PhoneNumber string `json:"phone_number"` FirstName string `json:"first_name"` @@ -653,13 +653,13 @@ type InputContactMessageContent struct { func (InputContactMessageContent) inputMessageContentTag() {} -// LabeledPrice https://core.telegram.org/bots/api#labeledprice +// See Telegram API docs: https://core.telegram.org/bots/api#labeledprice type LabeledPrice struct { Label string `json:"label"` Amount int `json:"amount"` } -// InputInvoiceMessageContent https://core.telegram.org/bots/api#inputinvoicemessagecontent +// See Telegram API docs: https://core.telegram.org/bots/api#inputinvoicemessagecontent type InputInvoiceMessageContent struct { Title string `json:"title"` Description string `json:"description"` diff --git a/models/input_file.go b/models/input_file.go index 2c492531..89c4970d 100644 --- a/models/input_file.go +++ b/models/input_file.go @@ -7,7 +7,7 @@ import ( type InputFileType int -// InputFile https://core.telegram.org/bots/api#inputfile +// See Telegram API docs: https://core.telegram.org/bots/api#inputfile type InputFile interface { inputFileTag() } diff --git a/models/input_media.go b/models/input_media.go index 0f50e38e..42c194f4 100644 --- a/models/input_media.go +++ b/models/input_media.go @@ -5,7 +5,7 @@ import ( "io" ) -// InputMedia https://core.telegram.org/bots/api#inputmedia +// See Telegram API docs: https://core.telegram.org/bots/api#inputmedia type InputMedia interface { inputMediaTag() @@ -14,7 +14,7 @@ type InputMedia interface { GetMedia() string } -// InputMediaPhoto https://core.telegram.org/bots/api#inputmediaphoto +// See Telegram API docs: https://core.telegram.org/bots/api#inputmediaphoto type InputMediaPhoto struct { Media string `json:"media"` Caption string `json:"caption,omitempty"` @@ -48,7 +48,7 @@ func (m *InputMediaPhoto) MarshalInputMedia() ([]byte, error) { func (InputMediaPhoto) inputMediaTag() {} -// InputMediaVideo https://core.telegram.org/bots/api#inputmediavideo +// See Telegram API docs: https://core.telegram.org/bots/api#inputmediavideo type InputMediaVideo struct { Media string `json:"media"` Thumbnail InputFile `json:"thumbnail,omitempty"` @@ -87,7 +87,7 @@ func (m InputMediaVideo) MarshalInputMedia() ([]byte, error) { func (InputMediaVideo) inputMediaTag() {} -// InputMediaAnimation https://core.telegram.org/bots/api#inputmediaanimation +// See Telegram API docs: https://core.telegram.org/bots/api#inputmediaanimation type InputMediaAnimation struct { Media string `json:"media"` Thumbnail InputFile `json:"thumbnail,omitempty"` @@ -123,7 +123,7 @@ func (m InputMediaAnimation) MarshalInputMedia() ([]byte, error) { func (InputMediaAnimation) inputMediaTag() {} -// InputMediaAudio https://core.telegram.org/bots/api#inputmediaaudio +// See Telegram API docs: https://core.telegram.org/bots/api#inputmediaaudio type InputMediaAudio struct { Media string `json:"media"` Thumbnail InputFile `json:"thumbnail,omitempty"` @@ -157,7 +157,7 @@ func (m InputMediaAudio) MarshalInputMedia() ([]byte, error) { func (InputMediaAudio) inputMediaTag() {} -// InputMediaDocument https://core.telegram.org/bots/api#inputmediadocument +// See Telegram API docs: https://core.telegram.org/bots/api#inputmediadocument type InputMediaDocument struct { Media string `json:"media"` Thumbnail InputFile `json:"thumbnail,omitempty"` diff --git a/models/input_profile.go b/models/input_profile.go index dde0bc8f..320f77a2 100644 --- a/models/input_profile.go +++ b/models/input_profile.go @@ -5,12 +5,12 @@ import ( "io" ) -// InputProfilePhoto https://core.telegram.org/bots/api#inputprofilephoto +// See Telegram API docs: https://core.telegram.org/bots/api#inputprofilephoto type InputProfilePhoto interface { inputProfilePhotoTag() } -// InputProfilePhotoStatic https://core.telegram.org/bots/api#inputprofilephotostatic +// See Telegram API docs: https://core.telegram.org/bots/api#inputprofilephotostatic type InputProfilePhotoStatic struct { Photo string `json:"photo"` @@ -33,7 +33,7 @@ func (i InputProfilePhotoStatic) MarshalInputMedia() ([]byte, error) { return json.Marshal(&ret) } -// InputProfilePhotoAnimated https://core.telegram.org/bots/api#inputprofilephotoanimated +// See Telegram API docs: https://core.telegram.org/bots/api#inputprofilephotoanimated type InputProfilePhotoAnimated struct { Animation string `json:"animation"` MainFrameTimestamp float64 `json:"main_frame_timestamp,omitempty"` diff --git a/models/invoice.go b/models/invoice.go index ce32871d..2651001c 100644 --- a/models/invoice.go +++ b/models/invoice.go @@ -1,6 +1,6 @@ package models -// Invoice https://core.telegram.org/bots/api#invoice +// See Telegram API docs: https://core.telegram.org/bots/api#invoice type Invoice struct { Title string `json:"title"` Description string `json:"description"` diff --git a/models/link_preview.go b/models/link_preview.go index c3e05f13..2ccc6674 100644 --- a/models/link_preview.go +++ b/models/link_preview.go @@ -1,6 +1,6 @@ package models -// LinkPreviewOptions https://core.telegram.org/bots/api#linkpreviewoptions +// See Telegram API docs: https://core.telegram.org/bots/api#linkpreviewoptions type LinkPreviewOptions struct { IsDisabled *bool `json:"is_disabled,omitempty"` URL *string `json:"url,omitempty"` diff --git a/models/location.go b/models/location.go index 885c79e4..52e54e83 100644 --- a/models/location.go +++ b/models/location.go @@ -1,6 +1,6 @@ package models -// Location https://core.telegram.org/bots/api#location +// See Telegram API docs: https://core.telegram.org/bots/api#location type Location struct { Longitude float64 `json:"longitude"` Latitude float64 `json:"latitude"` diff --git a/models/menu_button.go b/models/menu_button.go index 1cb2c448..b23a46cc 100644 --- a/models/menu_button.go +++ b/models/menu_button.go @@ -17,7 +17,7 @@ type InputMenuButton interface { menuButtonTag() } -// MenuButton https://core.telegram.org/bots/api#menubutton +// See Telegram API docs: https://core.telegram.org/bots/api#menubutton type MenuButton struct { Type MenuButtonType @@ -68,14 +68,14 @@ func (c *MenuButton) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported MenuButton type") } -// MenuButtonCommands https://core.telegram.org/bots/api#menubuttoncommands +// See Telegram API docs: https://core.telegram.org/bots/api#menubuttoncommands type MenuButtonCommands struct { Type MenuButtonType `json:"type" rules:"required,equals:commands"` } func (MenuButtonCommands) menuButtonTag() {} -// MenuButtonWebApp https://core.telegram.org/bots/api#menubuttonwebapp +// See Telegram API docs: https://core.telegram.org/bots/api#menubuttonwebapp type MenuButtonWebApp struct { Type MenuButtonType `json:"type" rules:"required,equals:web_app"` Text string `json:"text" rules:"required"` @@ -84,7 +84,7 @@ type MenuButtonWebApp struct { func (MenuButtonWebApp) menuButtonTag() {} -// MenuButtonDefault https://core.telegram.org/bots/api#menubuttondefault +// See Telegram API docs: https://core.telegram.org/bots/api#menubuttondefault type MenuButtonDefault struct { Type MenuButtonType `json:"type" rules:"required,equals:default"` } diff --git a/models/message.go b/models/message.go index 3dd138c7..a3e9dc9a 100644 --- a/models/message.go +++ b/models/message.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// MaybeInaccessibleMessageType https://core.telegram.org/bots/api#maybeinaccessiblemessage +// See Telegram API docs: https://core.telegram.org/bots/api#maybeinaccessiblemessage type MaybeInaccessibleMessageType int const ( @@ -13,7 +13,7 @@ const ( MaybeInaccessibleMessageTypeInaccessibleMessage ) -// MaybeInaccessibleMessage https://core.telegram.org/bots/api#maybeinaccessiblemessage +// See Telegram API docs: https://core.telegram.org/bots/api#maybeinaccessiblemessage type MaybeInaccessibleMessage struct { Type MaybeInaccessibleMessageType @@ -52,7 +52,7 @@ func (mim *MaybeInaccessibleMessage) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported MaybeInaccessibleMessage type") } -// InaccessibleMessage https://core.telegram.org/bots/api#inaccessiblemessage +// See Telegram API docs: https://core.telegram.org/bots/api#inaccessiblemessage type InaccessibleMessage struct { Chat Chat `json:"chat"` MessageID int `json:"message_id"` @@ -63,12 +63,12 @@ type MessageID struct { ID int `json:"message_id"` } -// MessageAutoDeleteTimerChanged https://core.telegram.org/bots/api#messageautodeletetimerchanged +// See Telegram API docs: https://core.telegram.org/bots/api#messageautodeletetimerchanged type MessageAutoDeleteTimerChanged struct { MessageAutoDeleteTime int `json:"message_auto_delete_time"` } -// Message https://core.telegram.org/bots/api#message +// See Telegram API docs: https://core.telegram.org/bots/api#message type Message struct { ID int `json:"message_id"` MessageThreadID int `json:"message_thread_id,omitempty"` @@ -174,13 +174,13 @@ type Message struct { ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` } -// PreparedInlineMessage https://core.telegram.org/bots/api#preparedinlinemessage +// See Telegram API docs: https://core.telegram.org/bots/api#preparedinlinemessage type PreparedInlineMessage struct { ID string `json:"id"` ExpirationDate int `json:"expiration_date"` } -// DirectMessagesTopic https://core.telegram.org/bots/api#directmessagestopic +// See Telegram API docs: https://core.telegram.org/bots/api#directmessagestopic type DirectMessagesTopic struct { TopicID int `json:"topic_id"` User *User `json:"user,omitempty"` diff --git a/models/message_entity.go b/models/message_entity.go index 16f10b3b..fc9d5f2d 100644 --- a/models/message_entity.go +++ b/models/message_entity.go @@ -24,7 +24,7 @@ const ( MessageEntityTypeCustomEmoji MessageEntityType = "custom_emoji" ) -// MessageEntity https://core.telegram.org/bots/api#messageentity +// See Telegram API docs: https://core.telegram.org/bots/api#messageentity type MessageEntity struct { Type MessageEntityType `json:"type"` Offset int `json:"offset"` diff --git a/models/order_info.go b/models/order_info.go index eb3c77a3..e25521bd 100644 --- a/models/order_info.go +++ b/models/order_info.go @@ -1,6 +1,6 @@ package models -// OrderInfo https://core.telegram.org/bots/api#orderinfo +// See Telegram API docs: https://core.telegram.org/bots/api#orderinfo type OrderInfo struct { Name string `json:"name,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` diff --git a/models/paid.go b/models/paid.go index 46a59d3a..58483f1c 100644 --- a/models/paid.go +++ b/models/paid.go @@ -14,7 +14,7 @@ type InputPaidMedia interface { GetMedia() string } -// InputPaidMediaPhoto https://core.telegram.org/bots/api#inputpaidmediaphoto +// See Telegram API docs: https://core.telegram.org/bots/api#inputpaidmediaphoto type InputPaidMediaPhoto struct { Media string `json:"media"` @@ -43,7 +43,7 @@ func (m *InputPaidMediaPhoto) MarshalInputMedia() ([]byte, error) { return json.Marshal(&ret) } -// InputPaidMediaVideo https://core.telegram.org/bots/api#inputpaidmediavideo +// See Telegram API docs: https://core.telegram.org/bots/api#inputpaidmediavideo type InputPaidMediaVideo struct { Media string `json:"media"` Thumbnail InputFile `json:"thumbnail,omitempty"` @@ -87,7 +87,7 @@ const ( PaidMediaTypeVideo PaidMediaType = "video" ) -// PaidMedia https://core.telegram.org/bots/api#paidmedia +// See Telegram API docs: https://core.telegram.org/bots/api#paidmedia type PaidMedia struct { Type PaidMediaType @@ -122,7 +122,7 @@ func (p *PaidMedia) UnmarshalJSON(data []byte) error { } } -// PaidMediaPreview https://core.telegram.org/bots/api#paidmediapreview +// See Telegram API docs: https://core.telegram.org/bots/api#paidmediapreview type PaidMediaPreview struct { Type PaidMediaType @@ -131,38 +131,38 @@ type PaidMediaPreview struct { Duration int `json:"duration,omitempty"` } -// PaidMediaPhoto https://core.telegram.org/bots/api#paidmediaphoto +// See Telegram API docs: https://core.telegram.org/bots/api#paidmediaphoto type PaidMediaPhoto struct { Type PaidMediaType Photo []PhotoSize `json:"photo"` } -// PaidMediaVideo https://core.telegram.org/bots/api#paidmediavideo +// See Telegram API docs: https://core.telegram.org/bots/api#paidmediavideo type PaidMediaVideo struct { Type PaidMediaType Video Video `json:"video"` } -// PaidMediaInfo https://core.telegram.org/bots/api#paidmediainfo +// See Telegram API docs: https://core.telegram.org/bots/api#paidmediainfo type PaidMediaInfo struct { StarCount int `json:"star_count"` PaidMedia []PaidMedia `json:"paid_media"` } -// PaidMediaPurchased https://core.telegram.org/bots/api#paidmediapurchased +// See Telegram API docs: https://core.telegram.org/bots/api#paidmediapurchased type PaidMediaPurchased struct { From User `json:"from"` PaidMediaPayload string `json:"paid_media_payload"` } -// PaidMessagePriceChanged https://core.telegram.org/bots/api#paidmessagepricechanged +// See Telegram API docs: https://core.telegram.org/bots/api#paidmessagepricechanged type PaidMessagePriceChanged struct { PaidMessageStarCount int `json:"paid_message_star_count"` } -// DirectMessagePriceChanged https://core.telegram.org/bots/api#directmessagepricechanged +// See Telegram API docs: https://core.telegram.org/bots/api#directmessagepricechanged type DirectMessagePriceChanged struct { AreDirectMessagesEnabled bool `json:"are_direct_messages_enabled"` DirectMessageStarCount int `json:"direct_message_star_count,omitempty"` diff --git a/models/passport_data.go b/models/passport_data.go index e2e0a480..865bc310 100644 --- a/models/passport_data.go +++ b/models/passport_data.go @@ -1,6 +1,6 @@ package models -// PassportFile https://core.telegram.org/bots/api#passportfile +// See Telegram API docs: https://core.telegram.org/bots/api#passportfile type PassportFile struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` @@ -8,7 +8,7 @@ type PassportFile struct { FileDate int `json:"file_date"` } -// EncryptedPassportElement https://core.telegram.org/bots/api#encryptedpassportelement +// See Telegram API docs: https://core.telegram.org/bots/api#encryptedpassportelement type EncryptedPassportElement struct { Type string `json:"type"` Data string `json:"data,omitempty"` @@ -22,14 +22,14 @@ type EncryptedPassportElement struct { Hash string `json:"hash"` } -// EncryptedCredentials https://core.telegram.org/bots/api#encryptedcredentials +// See Telegram API docs: https://core.telegram.org/bots/api#encryptedcredentials type EncryptedCredentials struct { Data string `json:"data"` Hash string `json:"hash"` Secret string `json:"secret"` } -// PassportData https://core.telegram.org/bots/api#passportdata +// See Telegram API docs: https://core.telegram.org/bots/api#passportdata type PassportData struct { Data []EncryptedPassportElement `json:"data"` Credentials EncryptedCredentials `json:"credentials"` diff --git a/models/passport_element_error.go b/models/passport_element_error.go index 400888e4..3d546ba5 100644 --- a/models/passport_element_error.go +++ b/models/passport_element_error.go @@ -4,14 +4,14 @@ import ( "encoding/json" ) -// PassportElementError https://core.telegram.org/bots/api#passportelementerror +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerror type PassportElementError interface { passportElementErrorTag() MarshalCustom() ([]byte, error) } -// PassportElementErrorDataField https://core.telegram.org/bots/api#passportelementerrordatafield +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrordatafield type PassportElementErrorDataField struct { Type string `json:"type"` FieldName string `json:"field_name"` @@ -33,7 +33,7 @@ func (m *PassportElementErrorDataField) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorFrontSide https://core.telegram.org/bots/api#passportelementerrorfrontside +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrorfrontside type PassportElementErrorFrontSide struct { Type string `json:"type"` FileHash string `json:"file_hash"` @@ -54,7 +54,7 @@ func (m *PassportElementErrorFrontSide) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorReverseSide https://core.telegram.org/bots/api#passportelementerrorreverseside +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrorreverseside type PassportElementErrorReverseSide struct { Type string `json:"type"` FileHash string `json:"file_hash"` @@ -75,7 +75,7 @@ func (m *PassportElementErrorReverseSide) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorSelfie https://core.telegram.org/bots/api#passportelementerrorselfie +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrorselfie type PassportElementErrorSelfie struct { Type string `json:"type"` FileHash string `json:"file_hash"` @@ -96,7 +96,7 @@ func (m *PassportElementErrorSelfie) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorFile https://core.telegram.org/bots/api#passportelementerrorfile +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrorfile type PassportElementErrorFile struct { Type string `json:"type"` FileHash string `json:"file_hash"` @@ -117,7 +117,7 @@ func (m *PassportElementErrorFile) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorFiles https://core.telegram.org/bots/api#passportelementerrorfiles +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrorfiles type PassportElementErrorFiles struct { Type string `json:"type"` FileHashes []string `json:"file_hashes"` @@ -138,7 +138,7 @@ func (m *PassportElementErrorFiles) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorTranslationFile https://core.telegram.org/bots/api#passportelementerrortranslationfile +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrortranslationfile type PassportElementErrorTranslationFile struct { Type string `json:"type"` FileHash string `json:"file_hash"` @@ -159,7 +159,7 @@ func (m *PassportElementErrorTranslationFile) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorTranslationFiles https://core.telegram.org/bots/api#passportelementerrortranslationfiles +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrortranslationfiles type PassportElementErrorTranslationFiles struct { Type string `json:"type"` FileHashes []string `json:"file_hashes"` @@ -180,7 +180,7 @@ func (m *PassportElementErrorTranslationFiles) MarshalCustom() ([]byte, error) { return json.Marshal(&ret) } -// PassportElementErrorUnspecified https://core.telegram.org/bots/api#passportelementerrorunspecified +// See Telegram API docs: https://core.telegram.org/bots/api#passportelementerrorunspecified type PassportElementErrorUnspecified struct { Type string `json:"type"` ElementHash string `json:"element_hash"` diff --git a/models/photo_size.go b/models/photo_size.go index 08d479de..de50d968 100644 --- a/models/photo_size.go +++ b/models/photo_size.go @@ -1,6 +1,6 @@ package models -// PhotoSize https://core.telegram.org/bots/api#photosize +// See Telegram API docs: https://core.telegram.org/bots/api#photosize type PhotoSize struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/poll.go b/models/poll.go index b1c91045..5db55e52 100644 --- a/models/poll.go +++ b/models/poll.go @@ -1,6 +1,6 @@ package models -// PollAnswer https://core.telegram.org/bots/api#pollanswer +// See Telegram API docs: https://core.telegram.org/bots/api#pollanswer type PollAnswer struct { PollID string `json:"poll_id"` VoterChat *Chat `json:"voter_chat,omitempty"` @@ -8,21 +8,21 @@ type PollAnswer struct { OptionIDs []int `json:"option_ids,omitempty"` } -// InputPollOption https://core.telegram.org/bots/api#inputpolloption +// See Telegram API docs: https://core.telegram.org/bots/api#inputpolloption type InputPollOption struct { Text string `json:"text"` TextParseMode ParseMode `json:"text_parse_mode,omitempty"` TextEntities []MessageEntity `json:"text_entities,omitempty"` } -// PollOption https://core.telegram.org/bots/api#polloption +// See Telegram API docs: https://core.telegram.org/bots/api#polloption type PollOption struct { Text string `json:"text"` TextEntities []MessageEntity `json:"text_entities,omitempty"` VoterCount int `json:"voter_count"` } -// Poll https://core.telegram.org/bots/api#poll +// See Telegram API docs: https://core.telegram.org/bots/api#poll type Poll struct { ID string `json:"id"` Question string `json:"question"` diff --git a/models/pre_checkout_query.go b/models/pre_checkout_query.go index 17509407..0e3d6463 100644 --- a/models/pre_checkout_query.go +++ b/models/pre_checkout_query.go @@ -1,6 +1,6 @@ package models -// PreCheckoutQuery https://core.telegram.org/bots/api#precheckoutquery +// See Telegram API docs: https://core.telegram.org/bots/api#precheckoutquery type PreCheckoutQuery struct { ID string `json:"id"` From *User `json:"from"` diff --git a/models/proximity_alert_triggered.go b/models/proximity_alert_triggered.go index 30a1ae78..92d5380f 100644 --- a/models/proximity_alert_triggered.go +++ b/models/proximity_alert_triggered.go @@ -1,6 +1,6 @@ package models -// ProximityAlertTriggered https://core.telegram.org/bots/api#proximityalerttriggered +// See Telegram API docs: https://core.telegram.org/bots/api#proximityalerttriggered type ProximityAlertTriggered struct { Traveler User `json:"traveler"` Watcher User `json:"watcher"` diff --git a/models/reaction.go b/models/reaction.go index b7d0d6bd..00f08235 100644 --- a/models/reaction.go +++ b/models/reaction.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// ReactionTypeType https://core.telegram.org/bots/api#reactiontype +// See Telegram API docs: https://core.telegram.org/bots/api#reactiontype type ReactionTypeType string const ( @@ -14,7 +14,7 @@ const ( ReactionTypeTypePaid ReactionTypeType = "paid" ) -// ReactionType https://core.telegram.org/bots/api#reactiontype +// See Telegram API docs: https://core.telegram.org/bots/api#reactiontype type ReactionType struct { Type ReactionTypeType @@ -63,24 +63,24 @@ func (rt *ReactionType) UnmarshalJSON(data []byte) error { return fmt.Errorf("unsupported ReactionType type") } -// ReactionTypeEmoji https://core.telegram.org/bots/api#reactiontypeemoji +// See Telegram API docs: https://core.telegram.org/bots/api#reactiontypeemoji type ReactionTypeEmoji struct { Type ReactionTypeType `json:"type"` Emoji string `json:"emoji"` } -// ReactionTypeCustomEmoji https://core.telegram.org/bots/api#reactiontypecustomemoji +// See Telegram API docs: https://core.telegram.org/bots/api#reactiontypecustomemoji type ReactionTypeCustomEmoji struct { Type ReactionTypeType `json:"type"` CustomEmojiID string `json:"custom_emoji_id"` } -// ReactionTypePaid https://core.telegram.org/bots/api#reactiontypepaid +// See Telegram API docs: https://core.telegram.org/bots/api#reactiontypepaid type ReactionTypePaid struct { Type string `json:"type"` } -// MessageReactionUpdated https://core.telegram.org/bots/api#messagereactionupdated +// See Telegram API docs: https://core.telegram.org/bots/api#messagereactionupdated type MessageReactionUpdated struct { Chat Chat `json:"chat"` MessageID int `json:"message_id"` @@ -91,13 +91,13 @@ type MessageReactionUpdated struct { NewReaction []ReactionType `json:"new_reaction"` } -// ReactionCount https://core.telegram.org/bots/api#reactioncount +// See Telegram API docs: https://core.telegram.org/bots/api#reactioncount type ReactionCount struct { Type ReactionType `json:"type"` TotalCount int `json:"total_count"` } -// MessageReactionCountUpdated https://core.telegram.org/bots/api#messagereactioncountupdated +// See Telegram API docs: https://core.telegram.org/bots/api#messagereactioncountupdated type MessageReactionCountUpdated struct { Chat Chat `json:"chat"` MessageID int `json:"message_id"` diff --git a/models/reply.go b/models/reply.go index 5eb14bb4..3f4a54b4 100644 --- a/models/reply.go +++ b/models/reply.go @@ -5,7 +5,7 @@ import ( "fmt" ) -// TextQuote https://core.telegram.org/bots/api#textquote +// See Telegram API docs: https://core.telegram.org/bots/api#textquote type TextQuote struct { Text string `json:"text"` Entities []MessageEntity `json:"entities,omitempty"` @@ -13,7 +13,7 @@ type TextQuote struct { IsManual bool `json:"is_manual,omitempty"` } -// ExternalReplyInfo https://core.telegram.org/bots/api#externalreplyinfo +// See Telegram API docs: https://core.telegram.org/bots/api#externalreplyinfo type ExternalReplyInfo struct { Origin MessageOrigin `json:"origin"` Chat *Chat `json:"chat,omitempty"` @@ -42,7 +42,7 @@ type ExternalReplyInfo struct { Venue *Venue `json:"venue,omitempty"` } -// ReplyParameters https://core.telegram.org/bots/api#replyparameters +// See Telegram API docs: https://core.telegram.org/bots/api#replyparameters type ReplyParameters struct { MessageID int `json:"message_id"` ChatID any `json:"chat_id,omitempty"` @@ -54,7 +54,7 @@ type ReplyParameters struct { ChecklistTaskID int `json:"checklist_task_id,omitempty"` } -// MessageOriginType https://core.telegram.org/bots/api#messageorigin +// See Telegram API docs: https://core.telegram.org/bots/api#messageorigin type MessageOriginType string const ( @@ -64,7 +64,7 @@ const ( MessageOriginTypeChannel MessageOriginType = "channel" ) -// MessageOrigin https://core.telegram.org/bots/api#messageorigin +// See Telegram API docs: https://core.telegram.org/bots/api#messageorigin type MessageOrigin struct { Type MessageOriginType @@ -123,21 +123,21 @@ func (mo *MessageOrigin) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unsupported MessageOrigin type") } -// MessageOriginUser https://core.telegram.org/bots/api#messageoriginuser +// See Telegram API docs: https://core.telegram.org/bots/api#messageoriginuser type MessageOriginUser struct { Type MessageOriginType `json:"type"` // always “user” Date int `json:"date"` SenderUser User `json:"sender_user"` } -// MessageOriginHiddenUser https://core.telegram.org/bots/api#messageoriginhiddenuser +// See Telegram API docs: https://core.telegram.org/bots/api#messageoriginhiddenuser type MessageOriginHiddenUser struct { Type MessageOriginType `json:"type"` // always “hidden_user” Date int `json:"date"` SenderUserName string `json:"sender_user_name"` } -// MessageOriginChat https://core.telegram.org/bots/api#messageoriginchat +// See Telegram API docs: https://core.telegram.org/bots/api#messageoriginchat type MessageOriginChat struct { Type MessageOriginType `json:"type"` // always “chat” Date int `json:"date"` @@ -145,7 +145,7 @@ type MessageOriginChat struct { AuthorSignature *string `json:"author_signature,omitempty"` } -// MessageOriginChannel https://core.telegram.org/bots/api#messageoriginchannel +// See Telegram API docs: https://core.telegram.org/bots/api#messageoriginchannel type MessageOriginChannel struct { Type MessageOriginType `json:"type"` // always “channel” Date int `json:"date"` diff --git a/models/reply_markup.go b/models/reply_markup.go index cd0d3edc..dc024053 100644 --- a/models/reply_markup.go +++ b/models/reply_markup.go @@ -2,12 +2,12 @@ package models type ReplyMarkup any -// InlineKeyboardMarkup https://core.telegram.org/bots/api#inlinekeyboardmarkup +// See Telegram API docs: https://core.telegram.org/bots/api#inlinekeyboardmarkup type InlineKeyboardMarkup struct { InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"` } -// LoginURL https://core.telegram.org/bots/api#loginurl +// See Telegram API docs: https://core.telegram.org/bots/api#loginurl type LoginURL struct { URL string `json:"url"` ForwardText string `json:"forward_text,omitempty"` @@ -15,7 +15,7 @@ type LoginURL struct { RequestWriteAccess bool `json:"request_write_access,omitempty"` } -// SwitchInlineQueryChosenChat https://core.telegram.org/bots/api#switchinlinequerychosenchat +// See Telegram API docs: https://core.telegram.org/bots/api#switchinlinequerychosenchat type SwitchInlineQueryChosenChat struct { Query string `json:"query,omitempty"` AllowUserChats bool `json:"allow_user_chats,omitempty"` @@ -24,12 +24,12 @@ type SwitchInlineQueryChosenChat struct { AllowChannelChats bool `json:"allow_channel_chats,omitempty"` } -// CopyTextButton https://core.telegram.org/bots/api#copytextbutton +// See Telegram API docs: https://core.telegram.org/bots/api#copytextbutton type CopyTextButton struct { Text string `json:"text"` } -// InlineKeyboardButton https://core.telegram.org/bots/api#inlinekeyboardbutton +// See Telegram API docs: https://core.telegram.org/bots/api#inlinekeyboardbutton type InlineKeyboardButton struct { Text string `json:"text"` URL string `json:"url,omitempty"` @@ -44,7 +44,7 @@ type InlineKeyboardButton struct { Pay bool `json:"pay,omitempty"` } -// ReplyKeyboardMarkup https://core.telegram.org/bots/api#replykeyboardmarkup +// See Telegram API docs: https://core.telegram.org/bots/api#replykeyboardmarkup type ReplyKeyboardMarkup struct { Keyboard [][]KeyboardButton `json:"keyboard"` IsPersistent bool `json:"is_persistent,omitempty"` @@ -54,7 +54,7 @@ type ReplyKeyboardMarkup struct { Selective bool `json:"selective,omitempty"` } -// KeyboardButton https://core.telegram.org/bots/api#keyboardbutton +// See Telegram API docs: https://core.telegram.org/bots/api#keyboardbutton type KeyboardButton struct { Text string `json:"text"` RequestUser *KeyboardButtonRequestUsers `json:"request_user,omitempty"` @@ -66,14 +66,14 @@ type KeyboardButton struct { WebApp *WebAppInfo `json:"web_app,omitempty"` } -// KeyboardButtonRequestUser https://core.telegram.org/bots/api#keyboardbuttonrequestuser +// See Telegram API docs: https://core.telegram.org/bots/api#keyboardbuttonrequestuser type KeyboardButtonRequestUser struct { RequestID int32 `json:"request_id"` UserIsBot bool `json:"user_is_bot,omitempty"` UserIsPremium bool `json:"user_is_premium,omitempty"` } -// KeyboardButtonRequestUsers https://core.telegram.org/bots/api#keyboardbuttonrequestusers +// See Telegram API docs: https://core.telegram.org/bots/api#keyboardbuttonrequestusers type KeyboardButtonRequestUsers struct { RequestID int32 `json:"request_id"` UserIsBot bool `json:"user_is_bot,omitempty"` @@ -84,7 +84,7 @@ type KeyboardButtonRequestUsers struct { RequestPhoto bool `json:"request_photo,omitempty"` } -// KeyboardButtonRequestChat https://core.telegram.org/bots/api#keyboardbuttonrequestchat +// See Telegram API docs: https://core.telegram.org/bots/api#keyboardbuttonrequestchat type KeyboardButtonRequestChat struct { RequestID int32 `json:"request_id"` ChatIsChannel bool `json:"chat_is_channel"` @@ -99,7 +99,7 @@ type KeyboardButtonRequestChat struct { RequestPhoto bool `json:"request_photo,omitempty"` } -// KeyboardButtonPollType https://core.telegram.org/bots/api#keyboardbuttonpolltype +// See Telegram API docs: https://core.telegram.org/bots/api#keyboardbuttonpolltype type KeyboardButtonPollType struct { Type string `json:"type,omitempty"` } @@ -114,13 +114,13 @@ type CallbackGame struct { InlineMessageID int `json:"inline_message_id,omitempty"` } -// ReplyKeyboardRemove https://core.telegram.org/bots/api#replykeyboardremove +// See Telegram API docs: https://core.telegram.org/bots/api#replykeyboardremove type ReplyKeyboardRemove struct { RemoveKeyboard bool `json:"remove_keyboard"` Selective bool `json:"selective,omitempty"` } -// ForceReply https://core.telegram.org/bots/api#forcereply +// See Telegram API docs: https://core.telegram.org/bots/api#forcereply type ForceReply struct { ForceReply bool `json:"force_reply"` InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"` diff --git a/models/shipping_query.go b/models/shipping_query.go index 30569c91..d99f6c21 100644 --- a/models/shipping_query.go +++ b/models/shipping_query.go @@ -1,6 +1,6 @@ package models -// ShippingAddress https://core.telegram.org/bots/api#shippingaddress +// See Telegram API docs: https://core.telegram.org/bots/api#shippingaddress type ShippingAddress struct { CountryCode string `json:"country_code"` State string `json:"state"` @@ -10,7 +10,7 @@ type ShippingAddress struct { PostCode string `json:"post_code"` } -// ShippingQuery https://core.telegram.org/bots/api#shippingquery +// See Telegram API docs: https://core.telegram.org/bots/api#shippingquery type ShippingQuery struct { ID string `json:"id"` From *User `json:"from"` @@ -18,7 +18,7 @@ type ShippingQuery struct { ShippingAddress ShippingAddress `json:"shipping_address"` } -// ShippingOption https://core.telegram.org/bots/api#shippingoption +// See Telegram API docs: https://core.telegram.org/bots/api#shippingoption type ShippingOption struct { ID string `json:"id"` Title string `json:"title"` diff --git a/models/star.go b/models/star.go index e181f18d..35bfdad1 100644 --- a/models/star.go +++ b/models/star.go @@ -17,7 +17,7 @@ const ( TransactionPartnerTypeOther TransactionPartnerType = "other" ) -// TransactionPartner https://core.telegram.org/bots/api#transactionpartner +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartner type TransactionPartner struct { Type TransactionPartnerType @@ -73,7 +73,7 @@ func (m *TransactionPartner) UnmarshalJSON(data []byte) error { return fmt.Errorf("unsupported TransactionPartner type") } -// AffiliateInfo https://core.telegram.org/bots/api#affiliateinfo +// See Telegram API docs: https://core.telegram.org/bots/api#affiliateinfo type AffiliateInfo struct { AffiliateUser *User `json:"affiliate_user,omitempty"` AffiliateChat *Chat `json:"affiliate_chat,omitempty"` @@ -82,7 +82,7 @@ type AffiliateInfo struct { NanostarAmount int `json:"nanostar_amount"` } -// TransactionPartnerUser https://core.telegram.org/bots/api#transactionpartneruser +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartneruser type TransactionPartnerUser struct { Type TransactionPartnerType `json:"type"` TransactionType string `json:"transaction_type"` @@ -96,38 +96,38 @@ type TransactionPartnerUser struct { PremiumSubscriptionDuration int `json:"premium_subscription_duration,omitempty"` } -// TransactionPartnerChat https://core.telegram.org/bots/api#transactionpartnerchat +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartnerchat type TransactionPartnerChat struct { Type TransactionPartnerType `json:"type"` Chat Chat `json:"chat"` Gift *Gift `json:"gift,omitempty"` } -// TransactionPartnerAffiliateProgram https://core.telegram.org/bots/api#transactionpartneraffiliateprogram +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartneraffiliateprogram type TransactionPartnerAffiliateProgram struct { Type TransactionPartnerType `json:"type"` SponsorUser *User `json:"sponsor_user,omitempty"` CommissionPerMille int `json:"commission_per_mille"` } -// TransactionPartnerFragment https://core.telegram.org/bots/api#transactionpartnerfragment +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartnerfragment type TransactionPartnerFragment struct { Type TransactionPartnerType `json:"type"` WithdrawalState *RevenueWithdrawalState `json:"withdrawal_state,omitempty"` } -// TransactionPartnerTelegramAds https://core.telegram.org/bots/api#transactionpartnertelegramads +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartnertelegramads type TransactionPartnerTelegramAds struct { Type TransactionPartnerType `json:"type"` } -// TransactionPartnerTelegramApi https://core.telegram.org/bots/api#transactionpartnertelegramapi +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartnertelegramapi type TransactionPartnerTelegramApi struct { Type TransactionPartnerType `json:"type"` RequestCount int `json:"request_count"` } -// TransactionPartnerOther https://core.telegram.org/bots/api#transactionpartnerother +// See Telegram API docs: https://core.telegram.org/bots/api#transactionpartnerother type TransactionPartnerOther struct { Type TransactionPartnerType `json:"type"` } @@ -140,7 +140,7 @@ const ( RevenueWithdrawalStateTypeFailed RevenueWithdrawalStateType = "failed" ) -// RevenueWithdrawalState https://core.telegram.org/bots/api#revenuewithdrawalstate +// See Telegram API docs: https://core.telegram.org/bots/api#revenuewithdrawalstate type RevenueWithdrawalState struct { Type RevenueWithdrawalStateType `json:"type"` @@ -176,24 +176,24 @@ func (m *RevenueWithdrawalState) UnmarshalJSON(data []byte) error { return fmt.Errorf("unsupported RevenueWithdrawalState type") } -// RevenueWithdrawalStatePending https://core.telegram.org/bots/api#revenuewithdrawalstatepending +// See Telegram API docs: https://core.telegram.org/bots/api#revenuewithdrawalstatepending type RevenueWithdrawalStatePending struct { Type RevenueWithdrawalStateType `json:"type"` } -// RevenueWithdrawalStateSucceeded https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded +// See Telegram API docs: https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded type RevenueWithdrawalStateSucceeded struct { Type RevenueWithdrawalStateType `json:"type"` Date int `json:"date"` URL string `json:"url"` } -// RevenueWithdrawalStateFailed https://core.telegram.org/bots/api#revenuewithdrawalstatefailed +// See Telegram API docs: https://core.telegram.org/bots/api#revenuewithdrawalstatefailed type RevenueWithdrawalStateFailed struct { Type RevenueWithdrawalStateType `json:"type"` } -// StarTransaction https://core.telegram.org/bots/api#startransaction +// See Telegram API docs: https://core.telegram.org/bots/api#startransaction type StarTransaction struct { ID string `json:"id"` Amount int `json:"amount"` @@ -203,12 +203,12 @@ type StarTransaction struct { Receiver *TransactionPartner `json:"receiver,omitempty"` } -// StarTransactions https://core.telegram.org/bots/api#startransactions +// See Telegram API docs: https://core.telegram.org/bots/api#startransactions type StarTransactions struct { Transactions []StarTransaction `json:"transactions"` } -// StarAmount https://core.telegram.org/bots/api#staramount +// See Telegram API docs: https://core.telegram.org/bots/api#staramount type StarAmount struct { Amount int `json:"amount"` NanostarAmount int `json:"nanostar_amount,omitempty"` diff --git a/models/sticker.go b/models/sticker.go index b5eab265..d26add44 100644 --- a/models/sticker.go +++ b/models/sticker.go @@ -2,7 +2,7 @@ package models import "io" -// MaskPosition https://core.telegram.org/bots/api#maskposition +// See Telegram API docs: https://core.telegram.org/bots/api#maskposition type MaskPosition struct { Point string `json:"point"` XShift float64 `json:"x_shift"` @@ -10,7 +10,7 @@ type MaskPosition struct { Scale float64 `json:"scale"` } -// Sticker https://core.telegram.org/bots/api#sticker +// See Telegram API docs: https://core.telegram.org/bots/api#sticker type Sticker struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` @@ -29,7 +29,7 @@ type Sticker struct { FileSize int `json:"file_size,omitempty"` } -// InputSticker https://core.telegram.org/bots/api#inputsticker +// See Telegram API docs: https://core.telegram.org/bots/api#inputsticker type InputSticker struct { Sticker string `json:"sticker"` Format string `json:"format"` diff --git a/models/sticker_set.go b/models/sticker_set.go index 93206c78..67894ee9 100644 --- a/models/sticker_set.go +++ b/models/sticker_set.go @@ -1,6 +1,6 @@ package models -// StickerSet https://core.telegram.org/bots/api#stickerset +// See Telegram API docs: https://core.telegram.org/bots/api#stickerset type StickerSet struct { Name string `json:"name"` Title string `json:"title"` diff --git a/models/story.go b/models/story.go index 4e3f6241..5c86bd82 100644 --- a/models/story.go +++ b/models/story.go @@ -15,7 +15,7 @@ type InputStoryContent interface { inputStoryContentTag() } -// InputStoryContentPhoto https://core.telegram.org/bots/api#inputstorycontentphoto +// See Telegram API docs: https://core.telegram.org/bots/api#inputstorycontentphoto type InputStoryContentPhoto struct { Photo string `json:"photo"` MediaAttachment io.Reader `json:"-"` @@ -36,7 +36,7 @@ func (i InputStoryContentPhoto) MarshalInputMedia() ([]byte, error) { return json.Marshal(&ret) } -// InputStoryContentVideo https://core.telegram.org/bots/api#inputstorycontentvideo +// See Telegram API docs: https://core.telegram.org/bots/api#inputstorycontentvideo type InputStoryContentVideo struct { Video string `json:"video"` Duration float64 `json:"duration,omitempty"` @@ -60,13 +60,13 @@ func (i InputStoryContentVideo) MarshalInputMedia() ([]byte, error) { return json.Marshal(&ret) } -// StoryArea https://core.telegram.org/bots/api#storyarea +// See Telegram API docs: https://core.telegram.org/bots/api#storyarea type StoryArea struct { Position StoryAreaPosition `json:"position"` Type StoryAreaType `json:"type"` } -// StoryAreaPosition https://core.telegram.org/bots/api#storyareaposition +// See Telegram API docs: https://core.telegram.org/bots/api#storyareaposition type StoryAreaPosition struct { XPercentage float64 `json:"x_percentage"` YPercentage float64 `json:"y_percentage"` @@ -76,7 +76,7 @@ type StoryAreaPosition struct { CornerRadiusPercentage float64 `json:"corner_radius_percentage"` } -// LocationAddress https://core.telegram.org/bots/api#locationaddress +// See Telegram API docs: https://core.telegram.org/bots/api#locationaddress type LocationAddress struct { CountryCode string `json:"country_code"` State string `json:"state,omitempty"` @@ -94,7 +94,7 @@ var ( StoryAreaTypeTypeUniqueGift StoryAreaTypeType = "unique_gift" ) -// StoryAreaType https://core.telegram.org/bots/api#storyareatype +// See Telegram API docs: https://core.telegram.org/bots/api#storyareatype type StoryAreaType struct { Type StoryAreaTypeType @@ -148,7 +148,7 @@ func (s *StoryAreaType) UnmarshalJSON(data []byte) error { return fmt.Errorf("unsupported StoryAreaType type") } -// StoryAreaTypeLocation https://core.telegram.org/bots/api#storyareatypelocation +// See Telegram API docs: https://core.telegram.org/bots/api#storyareatypelocation type StoryAreaTypeLocation struct { Type StoryAreaTypeType `json:"type"` Latitude float64 `json:"latitude"` @@ -156,7 +156,7 @@ type StoryAreaTypeLocation struct { Address *LocationAddress `json:"address,omitempty"` } -// StoryAreaTypeSuggestedReaction https://core.telegram.org/bots/api#storyareatypesuggestedreaction +// See Telegram API docs: https://core.telegram.org/bots/api#storyareatypesuggestedreaction type StoryAreaTypeSuggestedReaction struct { Type StoryAreaTypeType `json:"type"` ReactionType ReactionType `json:"reaction_type"` @@ -164,13 +164,13 @@ type StoryAreaTypeSuggestedReaction struct { IsFlipped bool `json:"is_flipped,omitempty"` } -// StoryAreaTypeLink https://core.telegram.org/bots/api#storyareatypelink +// See Telegram API docs: https://core.telegram.org/bots/api#storyareatypelink type StoryAreaTypeLink struct { Type StoryAreaTypeType `json:"type"` URL string `json:"url"` } -// StoryAreaTypeWeather https://core.telegram.org/bots/api#storyareatypeweather +// See Telegram API docs: https://core.telegram.org/bots/api#storyareatypeweather type StoryAreaTypeWeather struct { Type StoryAreaTypeType `json:"type"` Temperature float64 `json:"temperature"` @@ -178,7 +178,7 @@ type StoryAreaTypeWeather struct { BackgroundColor int `json:"background_color"` } -// StoryAreaTypeUniqueGift https://core.telegram.org/bots/api#storyareatypeuniquegift +// See Telegram API docs: https://core.telegram.org/bots/api#storyareatypeuniquegift type StoryAreaTypeUniqueGift struct { Type StoryAreaTypeType `json:"type"` Name string `json:"name"` diff --git a/models/successful_payment.go b/models/successful_payment.go index f6f59aa3..fa45e074 100644 --- a/models/successful_payment.go +++ b/models/successful_payment.go @@ -1,6 +1,6 @@ package models -// SuccessfulPayment https://core.telegram.org/bots/api#successfulpayment +// See Telegram API docs: https://core.telegram.org/bots/api#successfulpayment type SuccessfulPayment struct { Currency string `json:"currency"` TotalAmount int `json:"total_amount"` @@ -14,7 +14,7 @@ type SuccessfulPayment struct { ProviderPaymentChargeID string `json:"provider_payment_charge_id"` } -// RefundedPayment https://core.telegram.org/bots/api#refundedpayment +// See Telegram API docs: https://core.telegram.org/bots/api#refundedpayment type RefundedPayment struct { Currency string `json:"currency"` TotalAmount int `json:"total_amount"` diff --git a/models/suggested_post.go b/models/suggested_post.go index 58d6bbd2..a8a56ade 100644 --- a/models/suggested_post.go +++ b/models/suggested_post.go @@ -1,44 +1,44 @@ package models -// SuggestedPostParameters https://core.telegram.org/bots/api#suggestedpostparameters +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostparameters type SuggestedPostParameters struct { Price *SuggestedPostPrice `json:"price,omitempty"` SendDate int `json:"send_date,omitempty"` } -// SuggestedPostPrice https://core.telegram.org/bots/api#suggestedpostprice +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostprice type SuggestedPostPrice struct { Currency string `json:"currency"` Amount int `json:"amount"` } -// SuggestedPostInfo https://core.telegram.org/bots/api#suggestedpostinfo +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostinfo type SuggestedPostInfo struct { State string `json:"state"` Price *SuggestedPostPrice `json:"price,omitempty"` SendDate int `json:"send_date,omitempty"` } -// SuggestedPostApproved https://core.telegram.org/bots/api#suggestedpostapproved +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostapproved type SuggestedPostApproved struct { SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` Price *SuggestedPostPrice `json:"price,omitempty"` SendDate int `json:"send_date,omitempty"` } -// SuggestedPostApprovalFailed https://core.telegram.org/bots/api#suggestedpostapprovalfailed +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostapprovalfailed type SuggestedPostApprovalFailed struct { SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` Price *SuggestedPostPrice `json:"price,omitempty"` } -// SuggestedPostDeclined https://core.telegram.org/bots/api#suggestedpostdeclined +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostdeclined type SuggestedPostDeclined struct { SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` Comment string `json:"comment,omitempty"` } -// SuggestedPostPaid https://core.telegram.org/bots/api#suggestedpostpaid +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostpaid type SuggestedPostPaid struct { SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` Currency string `json:"currency"` @@ -46,7 +46,7 @@ type SuggestedPostPaid struct { StarAmount *StarAmount `json:"star_amount,omitempty"` } -// SuggestedPostRefunded https://core.telegram.org/bots/api#suggestedpostrefunded +// See Telegram API docs: https://core.telegram.org/bots/api#suggestedpostrefunded type SuggestedPostRefunded struct { SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` Reason string `json:"reason"` diff --git a/models/update.go b/models/update.go index d98b65bf..3076dac3 100644 --- a/models/update.go +++ b/models/update.go @@ -1,6 +1,6 @@ package models -// Update https://core.telegram.org/bots/api#update +// See Telegram API docs: https://core.telegram.org/bots/api#update type Update struct { ID int64 `json:"update_id"` Message *Message `json:"message,omitempty"` @@ -28,7 +28,7 @@ type Update struct { RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` } -// allowed_updates https://core.telegram.org/bots/api#update +// See Telegram API docs: https://core.telegram.org/bots/api#update const ( AllowedUpdateMessage string = "message" AllowedUpdateEditedMessage string = "edited_message" diff --git a/models/user.go b/models/user.go index d7b44544..fbaf7987 100644 --- a/models/user.go +++ b/models/user.go @@ -1,12 +1,12 @@ package models -// UserProfilePhotos https://core.telegram.org/bots/api#userprofilephotos +// See Telegram API docs: https://core.telegram.org/bots/api#userprofilephotos type UserProfilePhotos struct { TotalCount int `json:"total_count"` Photos [][]PhotoSize `json:"photos"` } -// User https://core.telegram.org/bots/api#user +// See Telegram API docs: https://core.telegram.org/bots/api#user type User struct { ID int64 `json:"id"` IsBot bool `json:"is_bot"` diff --git a/models/venue.go b/models/venue.go index 7dede34b..bea48406 100644 --- a/models/venue.go +++ b/models/venue.go @@ -1,6 +1,6 @@ package models -// Venue https://core.telegram.org/bots/api#venue +// See Telegram API docs: https://core.telegram.org/bots/api#venue type Venue struct { Location Location `json:"location"` Title string `json:"title"` diff --git a/models/video.go b/models/video.go index 0f00a56f..635b5645 100644 --- a/models/video.go +++ b/models/video.go @@ -1,6 +1,6 @@ package models -// Video https://core.telegram.org/bots/api#video +// See Telegram API docs: https://core.telegram.org/bots/api#video type Video struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/video_chat.go b/models/video_chat.go index 2038ff4f..b4a58a86 100644 --- a/models/video_chat.go +++ b/models/video_chat.go @@ -1,21 +1,21 @@ package models -// VideoChatScheduled https://core.telegram.org/bots/api#videochatscheduled +// See Telegram API docs: https://core.telegram.org/bots/api#videochatscheduled type VideoChatScheduled struct { StartDate int `json:"start_date"` } -// VideoChatStarted https://core.telegram.org/bots/api#videochatstarted +// See Telegram API docs: https://core.telegram.org/bots/api#videochatstarted type VideoChatStarted struct { Duration int `json:"duration"` } -// VideoChatEnded https://core.telegram.org/bots/api#videochatended +// See Telegram API docs: https://core.telegram.org/bots/api#videochatended type VideoChatEnded struct { Duration int `json:"duration"` } -// VideoChatParticipantsInvited https://core.telegram.org/bots/api#videochatparticipantsinvited +// See Telegram API docs: https://core.telegram.org/bots/api#videochatparticipantsinvited type VideoChatParticipantsInvited struct { Users []User `json:"users"` } diff --git a/models/video_note.go b/models/video_note.go index c8153785..d554e252 100644 --- a/models/video_note.go +++ b/models/video_note.go @@ -1,6 +1,6 @@ package models -// VideoNote https://core.telegram.org/bots/api#videonote +// See Telegram API docs: https://core.telegram.org/bots/api#videonote type VideoNote struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/voice.go b/models/voice.go index c392ac97..b5bd635b 100644 --- a/models/voice.go +++ b/models/voice.go @@ -1,6 +1,6 @@ package models -// Voice https://core.telegram.org/bots/api#voice +// See Telegram API docs: https://core.telegram.org/bots/api#voice type Voice struct { FileID string `json:"file_id"` FileUniqueID string `json:"file_unique_id"` diff --git a/models/voice_chat.go b/models/voice_chat.go index 76192d75..2b6897d4 100644 --- a/models/voice_chat.go +++ b/models/voice_chat.go @@ -1,21 +1,21 @@ package models -// VoiceChatScheduled https://core.telegram.org/bots/api#videochatscheduled +// See Telegram API docs: https://core.telegram.org/bots/api#videochatscheduled type VoiceChatScheduled struct { StartDate int `json:"start_date"` } -// VoiceChatStarted https://core.telegram.org/bots/api#videochatstarted +// See Telegram API docs: https://core.telegram.org/bots/api#videochatstarted type VoiceChatStarted struct { Duration int `json:"duration"` } -// VoiceChatEnded https://core.telegram.org/bots/api#videochatended +// See Telegram API docs: https://core.telegram.org/bots/api#videochatended type VoiceChatEnded struct { Duration int `json:"duration"` } -// VoiceChatParticipantsInvited https://core.telegram.org/bots/api#videochatparticipantsinvited +// See Telegram API docs: https://core.telegram.org/bots/api#videochatparticipantsinvited type VoiceChatParticipantsInvited struct { Users []User `json:"users"` } diff --git a/models/web_app.go b/models/web_app.go index 007e5b3e..45a517d1 100644 --- a/models/web_app.go +++ b/models/web_app.go @@ -1,17 +1,17 @@ package models -// WebAppData https://core.telegram.org/bots/api#webappdata +// See Telegram API docs: https://core.telegram.org/bots/api#webappdata type WebAppData struct { Data string `json:"data"` ButtonText string `json:"button_text"` } -// WebAppInfo https://core.telegram.org/bots/api#webappinfo +// See Telegram API docs: https://core.telegram.org/bots/api#webappinfo type WebAppInfo struct { URL string `json:"url"` } -// SentWebAppMessage https://core.telegram.org/bots/api#sentwebappmessage +// See Telegram API docs: https://core.telegram.org/bots/api#sentwebappmessage type SentWebAppMessage struct { InlineMessageID string `json:"inline_message_id"` } diff --git a/models/web_hook_info.go b/models/web_hook_info.go index 5f5e6391..074c90ee 100644 --- a/models/web_hook_info.go +++ b/models/web_hook_info.go @@ -1,6 +1,6 @@ package models -// WebhookInfo https://core.telegram.org/bots/api#webhookinfo +// See Telegram API docs: https://core.telegram.org/bots/api#webhookinfo type WebhookInfo struct { URL string `json:"url"` HasCustomCertificate bool `json:"has_custom_certificate"` From 4efd84496ddd3fee592c0aa53dec5bc3ee88ecd4 Mon Sep 17 00:00:00 2001 From: Ivan Kalashnikov Date: Thu, 30 Oct 2025 18:59:28 +0700 Subject: [PATCH 5/6] Enhance handler type and match type documentation. --- handlers.go | 59 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/handlers.go b/handlers.go index 85457810..1df3b65a 100644 --- a/handlers.go +++ b/handlers.go @@ -7,37 +7,45 @@ import ( "github.com/go-telegram/bot/models" ) +// HandlerType defines the type of Telegram update content that handler should process. +// Each type corresponds to different data sources within update structure. type HandlerType int const ( - HandlerTypeMessageText HandlerType = iota - HandlerTypeCallbackQueryData - HandlerTypeCallbackQueryGameShortName - HandlerTypePhotoCaption + HandlerTypeMessageText HandlerType = iota // Handles text content of regular messages + HandlerTypeCallbackQueryData // Handles callback data from inline keyboard buttons + HandlerTypeCallbackQueryGameShortName // Handles game short names from game callback queries + HandlerTypePhotoCaption // Handles caption text of photo messages ) +// MatchType defines how the handler pattern should be matched against incoming content. +// Different match types provide various levels of flexibility for content filtering. type MatchType int const ( - MatchTypeExact MatchType = iota - MatchTypePrefix - MatchTypeContains - MatchTypeCommand - MatchTypeCommandStartOnly - - matchTypeRegexp - matchTypeFunc + MatchTypeExact MatchType = iota // Exact string match (content == pattern) + MatchTypePrefix // Prefix match (content starts with pattern) + MatchTypeContains // Contains match (pattern found anywhere in content) + MatchTypeCommand // Bot command match (finds /pattern as bot command) + MatchTypeCommandStartOnly // Bot command at message start only (strict command matching) + + // Internal match types (not for public use) + matchTypeRegexp // Regular expression matching (use RegisterHandlerRegexp) + matchTypeFunc // Custom function matching (use RegisterHandlerMatchFunc) ) +// handler represents internal handler configuration with matching logic and execution function. +// Contains all necessary data for determining if update should be processed by this handler. type handler struct { - id string - handlerType HandlerType - matchType MatchType - handler HandlerFunc - - pattern string - re *regexp.Regexp - matchFunc MatchFunc + id string // Unique handler identifier for registration/unregistration + handlerType HandlerType // Type of content to extract from update + matchType MatchType // How to match extracted content against pattern + handler HandlerFunc // Function to execute when match is found + + // Pattern matching fields (used based on matchType) + pattern string // String pattern for basic matching + re *regexp.Regexp // Compiled regex for regexp matching + matchFunc MatchFunc // Custom function for function-based matching } func (h handler) match(update *models.Update) bool { @@ -106,6 +114,9 @@ func (h handler) match(update *models.Update) bool { return false } +// RegisterHandlerMatchFunc registers a handler with custom matching function. +// This provides maximum flexibility for complex matching logic that cannot be expressed with standard match types. +// Returns handler ID that can be used to unregister the handler later. func (b *Bot) RegisterHandlerMatchFunc(matchFunc MatchFunc, f HandlerFunc, m ...Middleware) string { b.handlersMx.Lock() defer b.handlersMx.Unlock() @@ -124,6 +135,9 @@ func (b *Bot) RegisterHandlerMatchFunc(matchFunc MatchFunc, f HandlerFunc, m ... return id } +// RegisterHandlerRegexp registers a handler with regular expression pattern matching. +// The regex will be applied to content extracted based on handlerType. +// Returns handler ID that can be used to unregister the handler later. func (b *Bot) RegisterHandlerRegexp(handlerType HandlerType, re *regexp.Regexp, f HandlerFunc, m ...Middleware) string { b.handlersMx.Lock() defer b.handlersMx.Unlock() @@ -143,6 +157,9 @@ func (b *Bot) RegisterHandlerRegexp(handlerType HandlerType, re *regexp.Regexp, return id } +// RegisterHandler registers a handler with specified pattern and match type. +// This is the most commonly used method for registering handlers with standard matching logic. +// Returns handler ID that can be used to unregister the handler later. func (b *Bot) RegisterHandler(handlerType HandlerType, pattern string, matchType MatchType, f HandlerFunc, m ...Middleware) string { b.handlersMx.Lock() defer b.handlersMx.Unlock() @@ -162,6 +179,8 @@ func (b *Bot) RegisterHandler(handlerType HandlerType, pattern string, matchType return id } +// UnregisterHandler removes a previously registered handler by its ID. +// The ID is returned when registering handlers with any of the Register* methods. func (b *Bot) UnregisterHandler(id string) { b.handlersMx.Lock() defer b.handlersMx.Unlock() From 84f2c7fc074c0d8363f5953fe2940902d474be25 Mon Sep 17 00:00:00 2001 From: Ivan Kalashnikov Date: Mon, 3 Nov 2025 17:23:54 +0700 Subject: [PATCH 6/6] Enhance command match type documentation for clarity on registration format. --- handlers.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/handlers.go b/handlers.go index 1df3b65a..a07420df 100644 --- a/handlers.go +++ b/handlers.go @@ -23,11 +23,15 @@ const ( type MatchType int const ( - MatchTypeExact MatchType = iota // Exact string match (content == pattern) - MatchTypePrefix // Prefix match (content starts with pattern) - MatchTypeContains // Contains match (pattern found anywhere in content) - MatchTypeCommand // Bot command match (finds /pattern as bot command) - MatchTypeCommandStartOnly // Bot command at message start only (strict command matching) + MatchTypeExact MatchType = iota // Exact string match (content == pattern) + MatchTypePrefix // Prefix match (content starts with pattern) + MatchTypeContains // Contains match (pattern found anywhere in content) + // Bot command match (finds /pattern as bot command). + // When registering, command is specified without /. Example: "start", "help", etc. + MatchTypeCommand + // Bot command at message start only (strict command matching). + // When registering, command is specified without /. Example: "start", "help", etc. + MatchTypeCommandStartOnly // Internal match types (not for public use) matchTypeRegexp // Regular expression matching (use RegisterHandlerRegexp)