(fix): finalize v2 contracts (tests): cover v2 migration (doc): prepare release guidance
This commit is contained in:
+112
-116
@@ -18,10 +18,8 @@ type SendMessage struct {
|
||||
// DirectMessagesTopicID Optional. Identifier of the direct messages topic to which the message will be
|
||||
// sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
|
||||
// ReceiverUserID identifies the user who can see the ephemeral message.
|
||||
ReceiverUserID int64 `json:"receiver_user_id,omitempty"` // Since: Bot API 10.2
|
||||
// CallbackQueryID identifies the callback query that triggered an ephemeral response.
|
||||
CallbackQueryID string `json:"callback_query_id,omitempty"` // Since: Bot API 10.2
|
||||
|
||||
EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Since: Bot API 10.3
|
||||
|
||||
// Text Required. Text of the message to be sent, 1-4096 characters after entities parsing
|
||||
Text string `json:"text"`
|
||||
@@ -62,7 +60,7 @@ type SendMessage struct {
|
||||
// See https://core.telegram.org/bots/api#sendmessage
|
||||
func (api *API) SendMessage(params SendMessage) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendMessage", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendMessageWithContext is the context-aware variant of SendMessage.
|
||||
@@ -71,7 +69,7 @@ func (api *API) SendMessage(params SendMessage) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendmessage
|
||||
func (api *API) SendMessageWithContext(ctx context.Context, params SendMessage) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendMessage", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// ForwardMessage holds parameters for the forwardMessage method.
|
||||
@@ -114,7 +112,7 @@ type ForwardMessage struct {
|
||||
// See https://core.telegram.org/bots/api#forwardmessage
|
||||
func (api *API) ForwardMessage(params ForwardMessage) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("forwardMessage", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// ForwardMessageWithContext is the context-aware variant of ForwardMessage.
|
||||
@@ -123,7 +121,7 @@ func (api *API) ForwardMessage(params ForwardMessage) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#forwardmessage
|
||||
func (api *API) ForwardMessageWithContext(ctx context.Context, params ForwardMessage) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("forwardMessage", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// ForwardMessages holds parameters for the forwardMessages method.
|
||||
@@ -159,7 +157,7 @@ type ForwardMessages struct {
|
||||
// See https://core.telegram.org/bots/api#forwardmessages
|
||||
func (api *API) ForwardMessages(params ForwardMessages) ([]MessageID, error) {
|
||||
req := NewRequestWithChatID[[]MessageID]("forwardMessages", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// ForwardMessagesWithContext is the context-aware variant of ForwardMessages.
|
||||
@@ -168,7 +166,7 @@ func (api *API) ForwardMessages(params ForwardMessages) ([]MessageID, error) {
|
||||
// See https://core.telegram.org/bots/api#forwardmessages
|
||||
func (api *API) ForwardMessagesWithContext(ctx context.Context, params ForwardMessages) ([]MessageID, error) {
|
||||
req := NewRequestWithChatID[[]MessageID]("forwardMessages", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// CopyMessage holds parameters for the copyMessage method.
|
||||
@@ -234,7 +232,7 @@ type CopyMessage struct {
|
||||
// Returns the MessageID of the sent copy.
|
||||
// See https://core.telegram.org/bots/api#copymessage
|
||||
func (api *API) CopyMessage(params CopyMessage) (int, error) {
|
||||
msgID, err := NewRequestWithChatID[MessageID]("copyMessage", params, params.ChatID).Do(api)
|
||||
msgID, err := api.Do(NewRequestWithChatID[MessageID]("copyMessage", params, params.ChatID))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -246,7 +244,7 @@ func (api *API) CopyMessage(params CopyMessage) (int, error) {
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#copymessage
|
||||
func (api *API) CopyMessageWithContext(ctx context.Context, params CopyMessage) (int, error) {
|
||||
msgID, err := NewRequestWithChatID[MessageID]("copyMessage", params, params.ChatID).DoWithContext(ctx, api)
|
||||
msgID, err := api.DoWithContext(ctx, NewRequestWithChatID[MessageID]("copyMessage", params, params.ChatID))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -288,7 +286,7 @@ type CopyMessages struct {
|
||||
// See https://core.telegram.org/bots/api#copymessages
|
||||
func (api *API) CopyMessages(params CopyMessages) ([]MessageID, error) {
|
||||
req := NewRequestWithChatID[[]MessageID]("copyMessages", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// CopyMessagesWithContext is the context-aware variant of CopyMessages.
|
||||
@@ -297,7 +295,7 @@ func (api *API) CopyMessages(params CopyMessages) ([]MessageID, error) {
|
||||
// See https://core.telegram.org/bots/api#copymessages
|
||||
func (api *API) CopyMessagesWithContext(ctx context.Context, params CopyMessages) ([]MessageID, error) {
|
||||
req := NewRequestWithChatID[[]MessageID]("copyMessages", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendLocation holds parameters for the sendLocation method.
|
||||
@@ -316,10 +314,8 @@ type SendLocation struct {
|
||||
// DirectMessagesTopicID Optional. Identifier of the direct messages topic to which the message will be
|
||||
// sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
||||
// ReceiverUserID identifies the user who can see the ephemeral message.
|
||||
ReceiverUserID int64 `json:"receiver_user_id,omitempty"` // Since: Bot API 10.2
|
||||
// CallbackQueryID identifies the callback query that triggered an ephemeral response.
|
||||
CallbackQueryID string `json:"callback_query_id,omitempty"` // Since: Bot API 10.2
|
||||
|
||||
EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Since: Bot API 10.3
|
||||
|
||||
// Latitude Required. Latitude of the location
|
||||
Latitude float64 `json:"latitude"`
|
||||
@@ -367,7 +363,7 @@ type SendLocation struct {
|
||||
// See https://core.telegram.org/bots/api#sendlocation
|
||||
func (api *API) SendLocation(params SendLocation) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendLocation", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendLocationWithContext is the context-aware variant of SendLocation.
|
||||
@@ -376,7 +372,7 @@ func (api *API) SendLocation(params SendLocation) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendlocation
|
||||
func (api *API) SendLocationWithContext(ctx context.Context, params SendLocation) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendLocation", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendVenue holds parameters for the sendVenue method.
|
||||
@@ -395,10 +391,8 @@ type SendVenue struct {
|
||||
// DirectMessagesTopicID Optional. Identifier of the direct messages topic to which the message will be
|
||||
// sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
||||
// ReceiverUserID identifies the user who can see the ephemeral message.
|
||||
ReceiverUserID int64 `json:"receiver_user_id,omitempty"` // Since: Bot API 10.2
|
||||
// CallbackQueryID identifies the callback query that triggered an ephemeral response.
|
||||
CallbackQueryID string `json:"callback_query_id,omitempty"` // Since: Bot API 10.2
|
||||
|
||||
EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Since: Bot API 10.3
|
||||
|
||||
// Latitude Required. Latitude of the venue
|
||||
Latitude float64 `json:"latitude"`
|
||||
@@ -447,7 +441,7 @@ type SendVenue struct {
|
||||
// See https://core.telegram.org/bots/api#sendvenue
|
||||
func (api *API) SendVenue(params SendVenue) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendVenue", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendVenueWithContext is the context-aware variant of SendVenue.
|
||||
@@ -456,7 +450,7 @@ func (api *API) SendVenue(params SendVenue) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendvenue
|
||||
func (api *API) SendVenueWithContext(ctx context.Context, params SendVenue) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendVenue", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendContact holds parameters for the sendContact method.
|
||||
@@ -475,10 +469,8 @@ type SendContact struct {
|
||||
// DirectMessagesTopicID Optional. Identifier of the direct messages topic to which the message will be
|
||||
// sent; required if the message is sent to a direct messages chat
|
||||
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
||||
// ReceiverUserID identifies the user who can see the ephemeral message.
|
||||
ReceiverUserID int64 `json:"receiver_user_id,omitempty"` // Since: Bot API 10.2
|
||||
// CallbackQueryID identifies the callback query that triggered an ephemeral response.
|
||||
CallbackQueryID string `json:"callback_query_id,omitempty"` // Since: Bot API 10.2
|
||||
|
||||
EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Since: Bot API 10.3
|
||||
|
||||
// PhoneNumber Required. Contact's phone number
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
@@ -518,7 +510,7 @@ type SendContact struct {
|
||||
// See https://core.telegram.org/bots/api#sendcontact
|
||||
func (api *API) SendContact(params SendContact) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendContact", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendContactWithContext is the context-aware variant of SendContact.
|
||||
@@ -527,7 +519,7 @@ func (api *API) SendContact(params SendContact) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendcontact
|
||||
func (api *API) SendContactWithContext(ctx context.Context, params SendContact) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendContact", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendPoll holds parameters for the sendPoll method.
|
||||
@@ -638,7 +630,7 @@ type SendPoll struct {
|
||||
// See https://core.telegram.org/bots/api#sendpoll
|
||||
func (api *API) SendPoll(params SendPoll) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendPoll", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendPollWithContext is the context-aware variant of SendPoll.
|
||||
@@ -647,7 +639,7 @@ func (api *API) SendPoll(params SendPoll) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendpoll
|
||||
func (api *API) SendPollWithContext(ctx context.Context, params SendPoll) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendPoll", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendChecklist holds parameters for the sendChecklist method.
|
||||
@@ -682,7 +674,7 @@ type SendChecklist struct {
|
||||
// See https://core.telegram.org/bots/api#sendchecklist
|
||||
func (api *API) SendChecklist(params SendChecklist) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendChecklist", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendChecklistWithContext is the context-aware variant of SendChecklist.
|
||||
@@ -691,7 +683,7 @@ func (api *API) SendChecklist(params SendChecklist) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendchecklist
|
||||
func (api *API) SendChecklistWithContext(ctx context.Context, params SendChecklist) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendChecklist", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendDice holds parameters for the sendDice method.
|
||||
@@ -745,7 +737,7 @@ type SendDice struct {
|
||||
// See https://core.telegram.org/bots/api#senddice
|
||||
func (api *API) SendDice(params SendDice) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendDice", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendDiceWithContext is the context-aware variant of SendDice.
|
||||
@@ -754,7 +746,7 @@ func (api *API) SendDice(params SendDice) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#senddice
|
||||
func (api *API) SendDiceWithContext(ctx context.Context, params SendDice) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendDice", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendMessageDraft holds parameters for the sendMessageDraft method.
|
||||
@@ -777,6 +769,11 @@ type SendMessageDraft struct {
|
||||
// Entities Optional. A JSON-serialized list of special entities that appear in message text, which can be
|
||||
// specified instead of parse_mode
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
|
||||
// CanStop allows the user to stop message generation while the draft is shown.
|
||||
CanStop bool `json:"can_stop,omitempty"` // Since: Bot API 10.3
|
||||
// KeepOnStop preserves the draft as an ephemeral message when generation is stopped.
|
||||
KeepOnStop bool `json:"keep_on_stop,omitempty"` // Since: Bot API 10.3
|
||||
}
|
||||
|
||||
// SendMessageDraft sends or updates a draft message in the target chat.
|
||||
@@ -785,7 +782,7 @@ type SendMessageDraft struct {
|
||||
// See https://core.telegram.org/bots/api#sendmessagedraft
|
||||
func (api *API) SendMessageDraft(params SendMessageDraft) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("sendMessageDraft", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendMessageDraftWithContext is the context-aware variant of SendMessageDraft.
|
||||
@@ -794,7 +791,7 @@ func (api *API) SendMessageDraft(params SendMessageDraft) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#sendmessagedraft
|
||||
func (api *API) SendMessageDraftWithContext(ctx context.Context, params SendMessageDraft) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("sendMessageDraft", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendChatAction holds parameters for the sendChatAction method.
|
||||
@@ -823,7 +820,7 @@ type SendChatAction struct {
|
||||
// See https://core.telegram.org/bots/api#sendchataction
|
||||
func (api *API) SendChatAction(params SendChatAction) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("sendChatAction", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendChatActionWithContext is the context-aware variant of SendChatAction.
|
||||
@@ -832,7 +829,7 @@ func (api *API) SendChatAction(params SendChatAction) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#sendchataction
|
||||
func (api *API) SendChatActionWithContext(ctx context.Context, params SendChatAction) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("sendChatAction", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SetMessageReaction holds parameters for the setMessageReaction method.
|
||||
@@ -860,7 +857,7 @@ type SetMessageReaction struct {
|
||||
// See https://core.telegram.org/bots/api#setmessagereaction
|
||||
func (api *API) SetMessageReaction(params SetMessageReaction) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("setMessageReaction", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SetMessageReactionWithContext is the context-aware variant of SetMessageReaction.
|
||||
@@ -869,7 +866,7 @@ func (api *API) SetMessageReaction(params SetMessageReaction) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#setmessagereaction
|
||||
func (api *API) SetMessageReactionWithContext(ctx context.Context, params SetMessageReaction) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("setMessageReaction", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditMessageText holds parameters for the editMessageText method.
|
||||
@@ -913,11 +910,11 @@ func (api *API) EditMessageText(params EditMessageText) (Message, bool, error) {
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageText", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageText", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -929,11 +926,11 @@ func (api *API) EditMessageTextWithContext(ctx context.Context, params EditMessa
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageText", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageText", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -976,11 +973,11 @@ func (api *API) EditMessageCaption(params EditMessageCaption) (Message, bool, er
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageCaption", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageCaption", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -992,11 +989,11 @@ func (api *API) EditMessageCaptionWithContext(ctx context.Context, params EditMe
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageCaption", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageCaption", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1030,11 +1027,11 @@ func (api *API) EditMessageMedia(params EditMessageMedia) (Message, bool, error)
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageMedia", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageMedia", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1046,11 +1043,11 @@ func (api *API) EditMessageMediaWithContext(ctx context.Context, params EditMess
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageMedia", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageMedia", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1100,11 +1097,11 @@ func (api *API) EditMessageLiveLocation(params EditMessageLiveLocation) (Message
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1116,11 +1113,11 @@ func (api *API) EditMessageLiveLocationWithContext(ctx context.Context, params E
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1153,11 +1150,11 @@ func (api *API) StopMessageLiveLocation(params StopMessageLiveLocation) (Message
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("stopMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("stopMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1169,11 +1166,11 @@ func (api *API) StopMessageLiveLocationWithContext(ctx context.Context, params S
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("stopMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("stopMessageLiveLocation", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1200,7 +1197,7 @@ type EditMessageChecklist struct {
|
||||
// See https://core.telegram.org/bots/api#editmessagechecklist
|
||||
func (api *API) EditMessageChecklist(params EditMessageChecklist) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("editMessageChecklist", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditMessageChecklistWithContext is the context-aware variant of EditMessageChecklist.
|
||||
@@ -1209,7 +1206,7 @@ func (api *API) EditMessageChecklist(params EditMessageChecklist) (Message, erro
|
||||
// See https://core.telegram.org/bots/api#editmessagechecklist
|
||||
func (api *API) EditMessageChecklistWithContext(ctx context.Context, params EditMessageChecklist) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("editMessageChecklist", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditMessageReplyMarkup holds parameters for the editMessageReplyMarkup method.
|
||||
@@ -1240,11 +1237,11 @@ func (api *API) EditMessageReplyMarkup(params EditMessageReplyMarkup) (Message,
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageReplyMarkup", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageReplyMarkup", params, params.ChatID)
|
||||
res, err := req.Do(api)
|
||||
res, err := api.Do(req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1256,11 +1253,11 @@ func (api *API) EditMessageReplyMarkupWithContext(ctx context.Context, params Ed
|
||||
var zero Message
|
||||
if params.InlineMessageID != "" {
|
||||
req := NewRequestWithChatID[bool]("editMessageReplyMarkup", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return zero, res, err
|
||||
}
|
||||
req := NewRequestWithChatID[Message]("editMessageReplyMarkup", params, params.ChatID)
|
||||
res, err := req.DoWithContext(ctx, api)
|
||||
res, err := api.DoWithContext(ctx, req)
|
||||
return res, false, err
|
||||
}
|
||||
|
||||
@@ -1286,7 +1283,7 @@ type StopPoll struct {
|
||||
// See https://core.telegram.org/bots/api#stoppoll
|
||||
func (api *API) StopPoll(params StopPoll) (Poll, error) {
|
||||
req := NewRequestWithChatID[Poll]("stopPoll", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// StopPollWithContext is the context-aware variant of StopPoll.
|
||||
@@ -1295,7 +1292,7 @@ func (api *API) StopPoll(params StopPoll) (Poll, error) {
|
||||
// See https://core.telegram.org/bots/api#stoppoll
|
||||
func (api *API) StopPollWithContext(ctx context.Context, params StopPoll) (Poll, error) {
|
||||
req := NewRequestWithChatID[Poll]("stopPoll", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// ApproveSuggestedPost holds parameters for the approveSuggestedPost method.
|
||||
@@ -1318,7 +1315,7 @@ type ApproveSuggestedPost struct {
|
||||
// See https://core.telegram.org/bots/api#approvesuggestedpost
|
||||
func (api *API) ApproveSuggestedPost(params ApproveSuggestedPost) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("approveSuggestedPost", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// ApproveSuggestedPostWithContext is the context-aware variant of ApproveSuggestedPost.
|
||||
@@ -1327,7 +1324,7 @@ func (api *API) ApproveSuggestedPost(params ApproveSuggestedPost) (bool, error)
|
||||
// See https://core.telegram.org/bots/api#approvesuggestedpost
|
||||
func (api *API) ApproveSuggestedPostWithContext(ctx context.Context, params ApproveSuggestedPost) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("approveSuggestedPost", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeclineSuggestedPost holds parameters for the declineSuggestedPost method.
|
||||
@@ -1348,7 +1345,7 @@ type DeclineSuggestedPost struct {
|
||||
// See https://core.telegram.org/bots/api#declinesuggestedpost
|
||||
func (api *API) DeclineSuggestedPost(params DeclineSuggestedPost) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("declineSuggestedPost", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeclineSuggestedPostWithContext is the context-aware variant of DeclineSuggestedPost.
|
||||
@@ -1357,7 +1354,7 @@ func (api *API) DeclineSuggestedPost(params DeclineSuggestedPost) (bool, error)
|
||||
// See https://core.telegram.org/bots/api#declinesuggestedpost
|
||||
func (api *API) DeclineSuggestedPostWithContext(ctx context.Context, params DeclineSuggestedPost) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("declineSuggestedPost", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteMessage holds parameters for the deleteMessage method.
|
||||
@@ -1377,7 +1374,7 @@ type DeleteMessage struct {
|
||||
// See https://core.telegram.org/bots/api#deletemessage
|
||||
func (api *API) DeleteMessage(params DeleteMessage) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteMessage", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeleteMessageWithContext is the context-aware variant of DeleteMessage.
|
||||
@@ -1386,7 +1383,7 @@ func (api *API) DeleteMessage(params DeleteMessage) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#deletemessage
|
||||
func (api *API) DeleteMessageWithContext(ctx context.Context, params DeleteMessage) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteMessage", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteMessages holds parameters for the deleteMessages method.
|
||||
@@ -1407,7 +1404,7 @@ type DeleteMessages struct {
|
||||
// See https://core.telegram.org/bots/api#deletemessages
|
||||
func (api *API) DeleteMessages(params DeleteMessages) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteMessages", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeleteMessagesWithContext is the context-aware variant of DeleteMessages.
|
||||
@@ -1416,7 +1413,7 @@ func (api *API) DeleteMessages(params DeleteMessages) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#deletemessages
|
||||
func (api *API) DeleteMessagesWithContext(ctx context.Context, params DeleteMessages) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteMessages", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// AnswerCallbackQuery holds parameters for the answerCallbackQuery method.
|
||||
@@ -1447,7 +1444,7 @@ type AnswerCallbackQuery struct {
|
||||
// See https://core.telegram.org/bots/api#answercallbackquery
|
||||
func (api *API) AnswerCallbackQuery(params AnswerCallbackQuery) (bool, error) {
|
||||
req := NewRequest[bool]("answerCallbackQuery", params)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// AnswerCallbackQueryWithContext is the context-aware variant of AnswerCallbackQuery.
|
||||
@@ -1456,7 +1453,7 @@ func (api *API) AnswerCallbackQuery(params AnswerCallbackQuery) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#answercallbackquery
|
||||
func (api *API) AnswerCallbackQueryWithContext(ctx context.Context, params AnswerCallbackQuery) (bool, error) {
|
||||
req := NewRequest[bool]("answerCallbackQuery", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// AnswerGuestQuery holds parameters for the answerGuestQuery method.
|
||||
@@ -1474,7 +1471,7 @@ type AnswerGuestQuery struct {
|
||||
// See https://core.telegram.org/bots/api#answerguestquery
|
||||
func (api *API) AnswerGuestQuery(params AnswerGuestQuery) (SentGuestMessage, error) {
|
||||
req := NewRequest[SentGuestMessage]("answerGuestQuery", params)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// AnswerGuestQueryWithContext is the context-aware variant of AnswerGuestQuery.
|
||||
@@ -1483,7 +1480,7 @@ func (api *API) AnswerGuestQuery(params AnswerGuestQuery) (SentGuestMessage, err
|
||||
// See https://core.telegram.org/bots/api#answerguestquery
|
||||
func (api *API) AnswerGuestQueryWithContext(ctx context.Context, params AnswerGuestQuery) (SentGuestMessage, error) {
|
||||
req := NewRequest[SentGuestMessage]("answerGuestQuery", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteAllMessageReactions holds parameters for the deleteAllMessageReactions method.
|
||||
@@ -1507,18 +1504,7 @@ type DeleteAllMessageReactions struct {
|
||||
// See https://core.telegram.org/bots/api#deleteallmessagereactions
|
||||
func (api *API) DeleteAllMessageReactions(params DeleteAllMessageReactions) (bool, error) {
|
||||
req := NewRequest[bool]("deleteAllMessageReactions", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
|
||||
// DeleteAllMessageReactionWithContext is the context-aware variant of DeleteAllMessageReactions.
|
||||
//
|
||||
// Deprecated: use DeleteAllMessageReactionsWithContext. The misspelled alias is
|
||||
// retained for v1 compatibility and is subject to removal in v2.
|
||||
// Since: Bot API 10.0
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#deleteallmessagereactions
|
||||
func (api *API) DeleteAllMessageReactionWithContext(ctx context.Context, params DeleteAllMessageReactions) (bool, error) {
|
||||
return api.DeleteAllMessageReactionsWithContext(ctx, params)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeleteAllMessageReactionsWithContext is the context-aware variant of DeleteAllMessageReactions.
|
||||
@@ -1527,7 +1513,7 @@ func (api *API) DeleteAllMessageReactionWithContext(ctx context.Context, params
|
||||
// See https://core.telegram.org/bots/api#deleteallmessagereactions
|
||||
func (api *API) DeleteAllMessageReactionsWithContext(ctx context.Context, params DeleteAllMessageReactions) (bool, error) {
|
||||
req := NewRequest[bool]("deleteAllMessageReactions", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteMessageReaction holds parameters for the deleteMessageReaction method.
|
||||
@@ -1553,7 +1539,7 @@ type DeleteMessageReaction struct {
|
||||
// See https://core.telegram.org/bots/api#deletemessagereaction
|
||||
func (api *API) DeleteMessageReaction(params DeleteMessageReaction) (bool, error) {
|
||||
req := NewRequest[bool]("deleteMessageReaction", params)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeleteMessageReactionWithContext is the context-aware variant of DeleteMessageReaction.
|
||||
@@ -1562,7 +1548,7 @@ func (api *API) DeleteMessageReaction(params DeleteMessageReaction) (bool, error
|
||||
// See https://core.telegram.org/bots/api#deletemessagereaction
|
||||
func (api *API) DeleteMessageReactionWithContext(ctx context.Context, params DeleteMessageReaction) (bool, error) {
|
||||
req := NewRequest[bool]("deleteMessageReaction", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendRichMessage holds parameters for the sendRichMessage method.
|
||||
@@ -1578,6 +1564,8 @@ type SendRichMessage struct {
|
||||
// DirectMessagesTopicID identifies the target direct-messages topic.
|
||||
DirectMessagesTopicID int64 `json:"direct_messages_topic_id,omitempty"`
|
||||
|
||||
EphemeralMessageParameters *EphemeralMessageParameters `json:"ephemeral_message_parameters,omitempty"` // Since: Bot API 10.3
|
||||
|
||||
// RichMessage contains structured rich-message content.
|
||||
RichMessage InputRichMessage `json:"rich_message"`
|
||||
// DisableNotification requests delivery without a notification sound.
|
||||
@@ -1601,7 +1589,7 @@ type SendRichMessage struct {
|
||||
// See https://core.telegram.org/bots/api#sendrichmessage
|
||||
func (api *API) SendRichMessage(params SendRichMessage) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendRichMessage", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendRichMessageWithContext is the context-aware variant of SendRichMessage.
|
||||
@@ -1610,7 +1598,7 @@ func (api *API) SendRichMessage(params SendRichMessage) (Message, error) {
|
||||
// See https://core.telegram.org/bots/api#sendrichmessage
|
||||
func (api *API) SendRichMessageWithContext(ctx context.Context, params SendRichMessage) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendRichMessage", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// SendRichMessageDraft holds parameters for the sendRichMessageDraft method.
|
||||
@@ -1626,6 +1614,11 @@ type SendRichMessageDraft struct {
|
||||
DraftID int64 `json:"draft_id"`
|
||||
// RichMessage contains structured rich-message content.
|
||||
RichMessage InputRichMessage `json:"rich_message"`
|
||||
|
||||
// CanStop allows the user to stop message generation while the draft is shown.
|
||||
CanStop bool `json:"can_stop,omitempty"` // Since: Bot API 10.3
|
||||
// KeepOnStop preserves the draft as an ephemeral message when generation is stopped.
|
||||
KeepOnStop bool `json:"keep_on_stop,omitempty"` // Since: Bot API 10.3
|
||||
}
|
||||
|
||||
// SendRichMessageDraft streams a partial rich message to a private chat while
|
||||
@@ -1636,7 +1629,7 @@ type SendRichMessageDraft struct {
|
||||
// See https://core.telegram.org/bots/api#sendrichmessagedraft
|
||||
func (api *API) SendRichMessageDraft(params SendRichMessageDraft) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("sendRichMessageDraft", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// SendRichMessageDraftWithContext is the context-aware variant of SendRichMessageDraft.
|
||||
@@ -1645,7 +1638,7 @@ func (api *API) SendRichMessageDraft(params SendRichMessageDraft) (bool, error)
|
||||
// See https://core.telegram.org/bots/api#sendrichmessagedraft
|
||||
func (api *API) SendRichMessageDraftWithContext(ctx context.Context, params SendRichMessageDraft) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("sendRichMessageDraft", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageText holds parameters for editing an ephemeral text message.
|
||||
@@ -1659,12 +1652,13 @@ type EditEphemeralMessageText struct {
|
||||
// EphemeralMessageID identifies the ephemeral message.
|
||||
EphemeralMessageID int64 `json:"ephemeral_message_id"`
|
||||
// Text contains the formatted or plain text content.
|
||||
Text string `json:"text"`
|
||||
Text string `json:"text,omitempty"`
|
||||
|
||||
// ParseMode selects the formatting syntax used by the text or caption.
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
// Entities describes explicit formatting entities in Text.
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
Entities []MessageEntity `json:"entities,omitempty"`
|
||||
RichMessage *InputRichMessage `json:"rich_message,omitempty"` // Since: Bot API 10.3
|
||||
// LinkPreviewOptions controls link preview generation for Text.
|
||||
LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"`
|
||||
// ReplyMarkup defines the message's inline keyboard.
|
||||
@@ -1676,7 +1670,7 @@ type EditEphemeralMessageText struct {
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageText(params EditEphemeralMessageText) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageText", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageTextWithContext is the context-aware variant of EditEphemeralMessageText.
|
||||
@@ -1684,11 +1678,11 @@ func (api *API) EditEphemeralMessageText(params EditEphemeralMessageText) (bool,
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageTextWithContext(ctx context.Context, params EditEphemeralMessageText) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageText", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageMedia holds parameters for editing ephemeral message media.
|
||||
// New files cannot be uploaded; use a file ID or URL.
|
||||
// Use Uploader.EditEphemeralMessageMedia to upload files referenced through attach:// names.
|
||||
//
|
||||
// Since: Bot API 10.2
|
||||
type EditEphemeralMessageMedia struct {
|
||||
@@ -1709,7 +1703,7 @@ type EditEphemeralMessageMedia struct {
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageMedia(params EditEphemeralMessageMedia) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageMedia", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageMediaWithContext is the context-aware variant of EditEphemeralMessageMedia.
|
||||
@@ -1717,7 +1711,7 @@ func (api *API) EditEphemeralMessageMedia(params EditEphemeralMessageMedia) (boo
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageMediaWithContext(ctx context.Context, params EditEphemeralMessageMedia) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageMedia", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageCaption holds parameters for editing an ephemeral message caption.
|
||||
@@ -1733,6 +1727,8 @@ type EditEphemeralMessageCaption struct {
|
||||
|
||||
// Caption contains the media or block caption.
|
||||
Caption string `json:"caption,omitempty"`
|
||||
// ShowCaptionAboveMedia places the caption above the media.
|
||||
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` // Since: Bot API 10.3
|
||||
// ParseMode selects the formatting syntax used by the text or caption.
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
// CaptionEntities describes formatting entities in Caption.
|
||||
@@ -1746,7 +1742,7 @@ type EditEphemeralMessageCaption struct {
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageCaption(params EditEphemeralMessageCaption) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageCaption", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageCaptionWithContext is the context-aware variant of EditEphemeralMessageCaption.
|
||||
@@ -1754,7 +1750,7 @@ func (api *API) EditEphemeralMessageCaption(params EditEphemeralMessageCaption)
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageCaptionWithContext(ctx context.Context, params EditEphemeralMessageCaption) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageCaption", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageReplyMarkup holds parameters for editing an ephemeral message's inline keyboard.
|
||||
@@ -1776,7 +1772,7 @@ type EditEphemeralMessageReplyMarkup struct {
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageReplyMarkup(params EditEphemeralMessageReplyMarkup) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageReplyMarkup", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditEphemeralMessageReplyMarkupWithContext is the context-aware variant of EditEphemeralMessageReplyMarkup.
|
||||
@@ -1784,7 +1780,7 @@ func (api *API) EditEphemeralMessageReplyMarkup(params EditEphemeralMessageReply
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) EditEphemeralMessageReplyMarkupWithContext(ctx context.Context, params EditEphemeralMessageReplyMarkup) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editEphemeralMessageReplyMarkup", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteEphemeralMessage holds parameters for deleting an ephemeral message.
|
||||
@@ -1804,7 +1800,7 @@ type DeleteEphemeralMessage struct {
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) DeleteEphemeralMessage(params DeleteEphemeralMessage) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteEphemeralMessage", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeleteEphemeralMessageWithContext is the context-aware variant of DeleteEphemeralMessage.
|
||||
@@ -1812,5 +1808,5 @@ func (api *API) DeleteEphemeralMessage(params DeleteEphemeralMessage) (bool, err
|
||||
// Since: Bot API 10.2
|
||||
func (api *API) DeleteEphemeralMessageWithContext(ctx context.Context, params DeleteEphemeralMessage) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteEphemeralMessage", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user