smartnode / telebot

Telegram Bot API in C
https://elmurod.net/telebot
Apache License 2.0
159 stars 35 forks source link

Error on file send #57

Open Mrestof opened 1 year ago

Mrestof commented 1 year ago

Hello, I get an error, when I try to send a file. There is no problem with text messages.

The code:

...
int someid = 0;
char str[4096];

snprintf(str, SIZE_OF_ARRAY(str), "/path/to/a/document.extension");
ret = telebot_send_document(handle, someid, str, true, "", "aaa", "", false,0,"");

if (ret != TELEBOT_ERROR_NONE) {
    printf("Failed to send message: %d \n", ret);
}
...

The error message:

[ERROR][telebot_core_curl_perform:129]Failed to curl_easy_perform
Error: Failed to open/read local data from file/application (26)
Failed to send message: -1 
smartnode commented 4 months ago

Make sure your tool/app has proper access right to the document you are sending.