teloxide icon indicating copy to clipboard operation
teloxide copied to clipboard

It would be really nice to have `serde_multipart/serializers` implemented

Open IriaSomobu opened this issue 8 months ago • 3 comments

... or at least not panicing.

I tried this code:

let attach_iter = msg_attaches.iter().map(|a| {
    let tg_attach = InputFile::file(a.cdn_path()).file_name(
        a.name.as_ref().unwrap_or(&"unknown".to_string()).clone(),
    );

    InputMedia::Photo(InputMediaPhoto::new(tg_attach))
});

match &mut media[0] {
    InputMedia::Photo(input) => {
        input.caption = Some(text);
        input.parse_mode = Some(teloxide::types::ParseMode::Html);
    }
    _ => {}
}

let mut send_rq = bot.send_media_group(chat_id, media);
send_rq.message_thread_id = thread_id;
send_rq.reply_parameters = reply_params;

let msgs = send_rq.await;

I expected to see this happen: msgs var be either Ok(...) or Err(...)

Instead, this happened:

thread 'main' panicked at /.../teloxide-core-0.10.1/src/serde_multipart/serializers.rs:402:9:
not implemented

Meta

  • teloxide version: ~~0.13.1~~ 0.13 (my bad)

IriaSomobu avatar Apr 02 '25 10:04 IriaSomobu

There is no 0.13.1 version Also, yes, i was able to recreate it with 0.13.0, but recently released 0.14.1 is fine, the code that triggers the issue in 0.13.0 doesn't in 0.14.1

LasterAlex avatar Apr 02 '25 11:04 LasterAlex

0.14.1 works even worse: it fails to connect to TG and blocks the entire coroutine:

[2025-04-02T11:09:32Z ERROR teloxide::error_handlers] An error from the update listener: Network(reqwest::Error { kind: Request, url: "https://api.telegram.org/token:redacted/GetUpdates", source: TimedOut })

IriaSomobu avatar Apr 02 '25 11:04 IriaSomobu

Oh, damn Ok, I'll try to make a pr today

LasterAlex avatar Apr 02 '25 11:04 LasterAlex