Closed denzen84 closed 5 years ago
Full source code of the bot available: https://github.com/denzen84/sstgb
Does it fail only with sending document? Or everything else (message, video)?
It fails only with sending documents. I tried different types (text, pdf, jpg, mp4 ...). Sending text messages, images and videos works fine.
So, I found and fix this bug:
telebot-core.c: line 456:
return telebot_core_curl_perform(core_h, TELEBOT_METHOD_SEND_DOCUMENT, post);
there was method _TELEBOT_METHOD_SENDPHOTO instead of _TELEBOT_METHOD_SENDDOCUMENT.
Please update master branch :)
Thanks for the bug fix. You may also pull request.
ret = telebot_send_document(handle, sstgbconf.user_id, sstgbconf.docfile, true, false, 0, NULL); if (ret != TELEBOT_ERROR_NONE) { printf("Failed to send document: %d \n", ret); }
The result is:
[ERROR][telebot_core_curl_perform:95]Wrong HTTP response received, response: 400 Failed to send document: -1
Possibly changes in Telegram API ?