Closed andrew-sol closed 1 day ago
Can you reproduce the error if you call ctx.api.answerPreCheckoutQuery
manually and specify the right value for pre_checkout_query_id
?
Yep, it's the same when I use
bot.on('pre_checkout_query', async (ctx) => {
const query = ctx.update.pre_checkout_query;
// some validation logic here...
return await ctx.api.answerPreCheckoutQuery(query.id, true);
});
I'm sorry. The issue occurred because I accidentally put return await ctx.answerPreCheckoutQuery(true);
at the end of the next handler - message:successful_payment
. That's why everything worked well but the log appeared.
Thanks for your attention anyway, @KnorpelSenf
Here's my code:
I see the following error in the logs:
The interesting part is that regardless of the error everything works fine, the bot receives the successful payment message after this one. Why do I get this error? Is this a bug in the library or am I doing something wrong?