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
| Name | Type | Required | Description |
|---|---|---|---|
CustomMethod | string | yes | The method name |
Params | DataJSON | yes | JSON-serialized method parameters |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | DATA_JSON_INVALID | The provided JSON data is invalid. |
| 400 | METHOD_INVALID | The specified method is invalid. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.sendCustomRequest#aa2769ed