mast / telegram-bot-api

First Telegram Bot API node.js library
http://mast.github.io/telegram-bot-api/
MIT License
246 stars 64 forks source link

Bug: inline query #25

Closed AliMD closed 8 years ago

AliMD commented 8 years ago

Bot closed at inlineQuery

[TelegramBot]: Failed to get updates from Telegram servers

Error sent from .catch of internalGetUpdates

jkantr commented 8 years ago

This is unlikely to be a bug. Change the console.err of that catch to actually output the err param and see what the cause if the error is.

AliMD commented 8 years ago

I don't understand how to prevent bot closed! How can skip this error ? I removed console.error but bot still closed on any inlineQuery !

AliMD commented 8 years ago

@jkantr error object is empty !!!

jkantr commented 8 years ago

There is something wrong with your code. Removing the log of the error does not remove the error, friend.

Instead change it to console.error(err) so you can tell me what the actual error is. Please. On Apr 15, 2016 10:14 PM, "Ali Mihandoost" notifications@github.com wrote:

I don't understand how to prevent bot closed! How can skip this error ? I removed console.error but bot still closed on any inlineQuery !

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/mast/telegram-bot-api/issues/25#issuecomment-210715142

jkantr commented 8 years ago

If this is related to receiving an inline_query update?, I don't think the original lib here supports it. Is mast around? There was no response to the pull request. HelloWorld017's fork added the inlineQuery as well as approved the upstream request for my fork with support for callback_query updates as well as the new answerCallbackQuery and editMessageText request methods. So my suggestion would be to use one of our forks until we can get this all merged back pretty with the more visible of them (this one)

AliMD commented 8 years ago

There is something wrong with your code.

No its not!
I'm not a noob in javascript

Removing the log of the error does not remove the error, friend.

I know that friend, i just want to say i don't know why program closed! i think it must just log the error not closed

Instead change it to console.error(err) so you can tell me what the actual error is. Please.

I said error object is empty but you don't listening

There is not my codes issue I merged #23 and problem fixed! Thank you.

AliMD commented 8 years ago

I don't understand how to prevent bot closed!

I found it, app closed because there is no timeout for check new post not for that error. You must add new timeout for internalGetUpdates after error!

setTimeout(internalGetUpdates, _settings.updates.get_interval);