messages.sendWebViewData
Used by the user to relay data from an opened reply keyboard bot mini app to the bot that owns it.
func (c *Client) MessagesSendWebViewData(ctx context.Context, request *MessagesSendWebViewDataRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesSendWebViewData(ctx, &tg.MessagesSendWebViewDataRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Bot | InputUserClass | yes | Bot that owns the web app |
RandomID | int64 | yes | Unique client message ID to prevent duplicate sending of the same event |
ButtonText | string | yes | Text of the keyboardButtonSimpleWebView that was pressed to open the web app. |
Data | string | yes | Data to relay to the bot, obtained from a web_app_data_send JS event. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_INVALID | This is not a valid bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.sendWebViewData#dc0242c8