Open robertpauson opened 1 year ago
Are you using an async tokio::main main as an entry point?
yes of course same as in example
#[tokio::main]
async fn main() -> Result<(), Error> {
Same problem for me, here's my Cargo.toml
:
[package]
name = "telegram-bot-sample"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1.0"
tokio = { version = "1.2", features = ["full"] }
futures = "0.3"
telegram-bot = "0.8"
I run cargo tree and see that latest version(0.8) on crates.io is published about 2 years ago and depends on hyper=0.13
, which depends on tokio=0.2.25
. Here's trimmed output of cargo tree
command:
├── anyhow v1.0.68
├── futures v0.3.25
...
├── telegram-bot v0.8.0
│ ├── bytes v0.5.6
│ ├── futures v0.3.25 (*)
│ ├── hyper v0.13.10
│ │ ├── bytes v0.5.6
│ │ ├── futures-channel v0.3.25 (*)
│ │ ├── futures-core v0.3.25
│ │ ├── futures-util v0.3.25 (*)
│ │ ├── h2 v0.2.7
│ │ │ ├── bytes v0.5.6
...
│ │ │ ├── tokio v0.2.25
...
│ │ ├── tokio v0.2.25 (*)
│ │ ├── tower-service v0.3.2
│ │ ├── tracing v0.1.37 (*)
│ │ └── want v0.3.0
│ │ ├── log v0.4.17 (*)
│ │ └── try-lock v0.2.3
│ ├── hyper-tls v0.4.3
...
│ │ ├── tokio v0.2.25 (*)
│ │ └── tokio-tls v0.3.1
│ │ ├── native-tls v0.2.11 (*)
│ │ └── tokio v0.2.25 (*)
...
│ │ └── serde v1.0.152 (*)
│ ├── tokio v0.2.25 (*)
│ ├── tracing v0.1.37 (*)
│ └── tracing-futures v0.2.5 (*)
└── tokio v1.23.0
telegram-bot = { git = "https://github.com/telegram-rs/telegram-bot.git", rev = "65ad5cf" }
I can confirm that second option worked for me. I hope @robertpauson or @gugahoa can publish new version.
Same issue for me Using this toml
[dependencies]
telegram-bot = "0.8.0"
tokio = { version = "1.26.0", features = ["fs", "rt", "macros", "rt-multi-thread"]}
futures = { version = "0.3.26", default-features = false }
dotenv = "0.15.0"
My Cargo.toml: