bots.invokeWebViewCustomMethod
Send a custom request from a mini bot app, triggered by a web_app_invoke_custom_method event ». The response should be sent using a custom_method_invoked event, see here » for more info on the flow.
func (c *Client) BotsInvokeWebViewCustomMethod(ctx context.Context, request *BotsInvokeWebViewCustomMethodRequest) (*DataJSON, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.BotsInvokeWebViewCustomMethod(ctx, &tg.BotsInvokeWebViewCustomMethodRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *DataJSON
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Bot | InputUserClass | yes | Identifier of the bot associated to the mini bot app |
CustomMethod | string | yes | Identifier of the custom method to invoke |
Params | DataJSON | yes | Method parameters |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BOT_INVALID | This is not a valid bot. |
| 400 | DATA_JSON_INVALID | The provided JSON data is invalid. |
| 400 | METHOD_INVALID | The specified method is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.invokeWebViewCustomMethod#87fc5e7