You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to send a file with a caption it is surrounded by " and if it contain the character " it is send as \".
Here a minimal example:
use telbot_ureq::types::message::SendDocument;use telbot_ureq::types::chat::ChatId;use telbot_ureq::types::file::InputFile;use telbot_ureq::Api;fnmain(){let data:Vec<u8> = "exemple".to_string().into_bytes();let caption = "exemple \" exemple";let api = Api::new("...".to_string());let chat_id:ChatId = 123456789i64.into();let file = InputFile{name:"test.txt".to_string(),data: data,mime:"text/plain".to_string(),};
api
.send_file(&SendDocument::new(chat_id, file).with_caption(caption)).expect("Error while sending document to Telegram");}
And here what I get in Telegram:
From what I can see the problem is that the send_file method use serde_json::to_value but the body is not send as json (but as multipart) so the text is json escaped but Telegram do not decode it.
PS: I'm using the main version from git telbot-ureq = { git = "https://github.com/kiwiyou/telbot" }
The text was updated successfully, but these errors were encountered:
Hello,
When I try to send a file with a caption it is surrounded by
"
and if it contain the character"
it is send as\"
.Here a minimal example:
And here what I get in Telegram:
From what I can see the problem is that the
send_file
method use serde_json::to_value but the body is not send as json (but as multipart) so the text is json escaped but Telegram do not decode it.PS: I'm using the main version from git
telbot-ureq = { git = "https://github.com/kiwiyou/telbot" }
The text was updated successfully, but these errors were encountered: