Skip to main content

bots.sendCustomRequest

Sends a custom request; for bots only

func (c *Client) BotsSendCustomRequest(ctx context.Context, request *BotsSendCustomRequestRequest) (*DataJSON, error)

Calling this method

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

res, err := api.BotsSendCustomRequest(ctx, &tg.BotsSendCustomRequestRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *DataJSON
return nil
})

Parameters

NameTypeRequiredDescription
CustomMethodstringyesThe method name
ParamsDataJSONyesJSON-serialized method parameters

Returns

*DataJSON

Possible errors

CodeTypeDescription
400DATA_JSON_INVALIDThe provided JSON data is invalid.
400METHOD_INVALIDThe specified method is invalid.
400USER_BOT_REQUIREDThis method can only be called by a bot.

References