skip to Main Content

After sending sendInvoice to user(user get this pay form correctly) my bot is not receive preCheckoutQuery for payment confirmation.
Im trying to receiving Updates (specifically preCheckoutQuery) from Telegram Bot via webhook, but here :

dev.botframework.com -> My bots -> Telegram -> Health column -> Issue -> “There was an error sending this message to your bot: HTTP status code BadRequest”.

Also, when i trying to set webhook on dev.botframework.com for my own bot and checking getWebhookInfo i get specific url like this :

{"ok":true,"result":{"url":"https://telegram.botframework.com/api/telegram/XXX/XXX","has_custom_certificate":false,"pending_update_count":0,"max_connections":40}}

With this webhook my bot messaging with user correctly

Some info how to receive correctly preCheckoutQuery?

Additional info :

/getWebhookInfo return me sometimes pending_update_count”:1

Library : Telegram.Bot (https://github.com/TelegramBots/telegram.bot)

My bot support TLS 1.2 :

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

My controller receving nothing

[Route("api/[controller]")]
public class UpdateController : Controller
{
    private readonly IBotFrameworkHttpAdapter Adapter;
    private readonly IBot Bot;

    public UpdateController(IBotFrameworkHttpAdapter adapter, IBot bot)
    {
        Adapter = adapter;
        Bot = bot;
    }
    [HttpPost]
    public async Task<IActionResult> Post([FromBody]Update _update)
    { 
        ...
        await Consts.BotClient.SendTextMessageAsync(chatId, string.Format("Update receivednP: {0} M: {1} H: {2}", a.Path, a.Method, a.Host.Value));
        ...
    }
}

2

Answers


  1. From the linked GitHub issue:

    I’ve just received confirmation that the Azure Bot Service does not support the Telegram payment system. If you want access to all Telegram events, you’ll have to connect your bot to Telegram on your own.

    This means your bot cannot use ABS endpoints if you want preCheckoutQuery to work.

    Login or Signup to reply.
  2. To get "preCheckoutQuery" I did the following:

    It turns out something like "web hook proxy"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search