node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

Too few answers to callback queries. Conversion is 0%

Open aorfevre opened this issue 7 years ago • 7 comments

Dear all,

I received that message from botFather. So far; when I test my bot; everything seems to be working fine.

Do you guys have experienced that kind of message ? What do you understand ? Some users do not receive callback ? How do you recommand to investigate that ?

Best regards

⚠️ The bot @XXXX seems to be having issues! Here is what we see from our side as of 11:35-11:40 UTC:

  • Too few answers to callback queries. Conversion is 0%

Please check your bot and fix the problem to keep your users happy. Read more about Status Alerts »

This feature is still in beta, please let us know if we are wrong and the bot works OK for all your users.

aorfevre avatar Jun 26 '18 11:06 aorfevre

I think that you use inline_query that are not ended with answerInlineQuery. Every time you receive a query you must end with a response, for all of possibile cases.

Easy example:

bot.on("inline_query", function (query) {
	// code...
	if (yourVar === true){
		bot.answerInlineQuery(query.id, [{
			id: '0',
			type: 'article',
			title: "Question",
			description: "OK!",
			message_text: "Function returned with 'true'
		}]);
	}else{
		bot.answerInlineQuery(query.id, [{
			id: '0',
			type: 'article',
			title: "Question",
			description: "ERROR!",
			message_text: "Function returned with 'false'
		}]);
	}
});

sidelux avatar Jun 26 '18 14:06 sidelux

First of all, Thank you @saeedhei for your return.

Is inline_keyboard considered as an inlineQuery ? Shall I do some answerInlineQuery ?

I do have only sendMessage with inline_keyboard and reply_markup

Of course I have bot.on("callback_query", function(callbackQuery) {

Shall I have an answerInlineQuery in that block too?

aorfevre avatar Jun 27 '18 14:06 aorfevre

I think that inline_keyboard is not considered InlineQuery, but to catch inline_keyboard response you use callback_query SO you should put an answerInlineQuery for all path (if, else, etc.)

sidelux avatar Jun 27 '18 14:06 sidelux

@sidelux within a on("callback_query" I do need to do a answerInlineQuery ?

I feel like I have still a lot of work ;)

aorfevre avatar Jun 29 '18 01:06 aorfevre

Yes but in every case where the function can terminate. In few words you must put an answer for every callback query (also in error branch).

sidelux avatar Jun 29 '18 06:06 sidelux

Thank you @sidelux I will !

aorfevre avatar Jun 29 '18 11:06 aorfevre

@sidelux, beleive it or not, i Still Did not have implémented theses answerinlinequeries. I Still do not understand what is The effect of Answering it ?

Can you paste me an example of how you manage That for a bot.on("callback_query ????

Did you know if not doing That May lead tô memory leaks ? I have one.... And it is définitly a pain in....

aorfevre avatar Jul 24 '18 23:07 aorfevre