bots.answerWebhookJSONQuery
Answers a custom query; for bots only
func (c *Client) BotsAnswerWebhookJSONQuery(ctx context.Context, request *BotsAnswerWebhookJSONQueryRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.BotsAnswerWebhookJSONQuery(ctx, &tg.BotsAnswerWebhookJSONQueryRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
QueryID | int64 | yes | Identifier of a custom query |
Data | DataJSON | yes | JSON-serialized answer to the query |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | DATA_JSON_INVALID | The provided JSON data is invalid. |
| 400 | QUERY_ID_INVALID | The query ID is invalid. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.answerWebhookJSONQuery#e6213f4d