Skip to main content

messages.setBotCallbackAnswer

Set the callback answer to a user button press (bots only)

func (c *Client) MessagesSetBotCallbackAnswer(ctx context.Context, request *MessagesSetBotCallbackAnswerRequest) (bool, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesSetBotCallbackAnswer(ctx, &tg.MessagesSetBotCallbackAnswerRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
AlertboolWhether to show the message as a popup instead of a toast notification
QueryIDint64yesQuery ID
MessagestringPopup to show
URLstringURL to open
CacheTimeintyesCache validity

Returns

bool

Possible errors

CodeTypeDescription
400MESSAGE_TOO_LONGThe provided message is too long.
400QUERY_ID_INVALIDThe query ID is invalid.
400URL_INVALIDInvalid URL provided.
400USER_BOT_REQUIREDThis method can only be called by a bot.

References