Skip to main content

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

NameTypeRequiredDescription
BotInputUserClassyesIdentifier of the bot associated to the mini bot app
CustomMethodstringyesIdentifier of the custom method to invoke
ParamsDataJSONyesMethod parameters

Returns

*DataJSON

Possible errors

CodeTypeDescription
400BOT_INVALIDThis is not a valid bot.
400DATA_JSON_INVALIDThe provided JSON data is invalid.
400METHOD_INVALIDThe specified method is invalid.

References