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
| Name | Type | Required | Description |
|---|---|---|---|
Alert | bool | — | Whether to show the message as a popup instead of a toast notification |
QueryID | int64 | yes | Query ID |
Message | string | — | Popup to show |
URL | string | — | URL to open |
CacheTime | int | yes | Cache validity |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | MESSAGE_TOO_LONG | The provided message is too long. |
| 400 | QUERY_ID_INVALID | The query ID is invalid. |
| 400 | URL_INVALID | Invalid URL provided. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.setBotCallbackAnswer#d58f130a