smartnode/telebot

Telebot does not provide API result to user

Closed this issue · 5 comments

Telebot does not provide API result to user
ozbek commented

Hi!

Can you elaborate more, please? An example would also be great.

I'm not sure if it's the same thing, but debugging my own bots I noticed Telebot didn't give me the error feedbacks Telegram was providing.

To overcome this, I modified my local Telebot library at several points. For instance, in file telebot-core.c to show the info if there is any, it becomes:

if (resp->data)
    ERR("Wrong HTTP response received, response: %ld; error: %s", resp_code, resp->data /* This was not in the original */);
else /* Original line */

For example, the forward request in API returns forwarded message id. And this info is very important for my application.

I'm not sure if it's the same thing, but debugging my own bots I noticed Telebot didn't give me the error feedbacks Telegram was providing.

To overcome this, I modified my local Telebot library at several points. For instance, in file telebot-core.c to show the info if there is any, it becomes:

if (resp->data)
    ERR("Wrong HTTP response received, response: %ld; error: %s", resp_code, resp->data /* This was not in the original */);
else /* Original line */

@gaboflowers
You are welcome to create pull request for the patch you created.

@pavel-the-best
Indeed, telebot does NOT provide response, but only error codes.
I've not considered those case, and maybe I will update in the future.
If you have ready patch you are welcome to create PR.