Desiders / telers

An asynchronous framework for Telegram Bot API written in Rust
https://docs.rs/telers
36 stars 3 forks source link

Including a None in a bincode deserialization will throw an Error despite being contained in an Option variable #27

Closed Nnenty closed 1 month ago

Nnenty commented 1 month ago

If you use telers types like Sticker with states you can get error.

An deserialization error will occur in the code below:

    // error code
    fsm.set_value("your_state", message.sticker)
        .await
        .map_err(Into::into)?;

    let _: Sticker = fsm
        .get_value("your_state")
        .await
        .map_err(Into::into)?
        .unwrap();

Issue in Stack Overflow

Desiders commented 1 month ago

I think we need just replace bincode to serde_json, because it has many limitations