Skip to main content

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

NameTypeRequiredDescription
QueryIDint64yesIdentifier of a custom query
DataDataJSONyesJSON-serialized answer to the query

Returns

bool

Possible errors

CodeTypeDescription
400DATA_JSON_INVALIDThe provided JSON data is invalid.
400QUERY_ID_INVALIDThe query ID is invalid.
400USER_BOT_REQUIREDThis method can only be called by a bot.

References