mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-14 11:44:04 +01:00
Merge branch 'dev' into Hirrolot-patch-1
This commit is contained in:
commit
87b621e018
13 changed files with 21 additions and 21 deletions
|
@ -25,7 +25,7 @@ authors = [
|
|||
maintenance = { status = "actively-developed" }
|
||||
|
||||
[features]
|
||||
default = ["native-tls", "ctrlc_handler", "teloxide-core/default"]
|
||||
default = ["native-tls", "ctrlc_handler", "teloxide-core/default", "auto-send"]
|
||||
|
||||
sqlite-storage = ["sqlx"]
|
||||
redis-storage = ["redis"]
|
||||
|
|
|
@ -72,7 +72,7 @@ $ rustup override set nightly
|
|||
5. Run `cargo new my_bot`, enter the directory and put these lines into your `Cargo.toml`:
|
||||
```toml
|
||||
[dependencies]
|
||||
teloxide = { version = "0.5", features = ["auto-send", "macros"] }
|
||||
teloxide = { version = "0.5", features = ["macros"] }
|
||||
log = "0.4"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.8", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["macros", "auto-send"] }
|
||||
teloxide = { path = "../../", features = ["macros"] }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["frunk", "macros", "auto-send"] }
|
||||
teloxide = { path = "../../", features = ["frunk", "macros"] }
|
||||
|
||||
futures = "0.3.5"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["auto-send"] }
|
||||
teloxide = { path = "../../" }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["auto-send"] }
|
||||
teloxide = { path = "../../" }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["macros", "auto-send"] }
|
||||
teloxide = { path = "../../", features = ["macros"] }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["auto-send"] }
|
||||
teloxide = { path = "../../" }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -6,7 +6,7 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
# You can also choose "cbor-serializer" or built-in JSON serializer
|
||||
teloxide = { path = "../../", features = ["redis-storage", "bincode-serializer", "macros", "auto-send"] }
|
||||
teloxide = { path = "../../", features = ["redis-storage", "bincode-serializer", "macros"] }
|
||||
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["auto-send"] }
|
||||
teloxide = { path = "../../" }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2018"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
teloxide = { path = "../../", features = ["macros", "auto-send"] }
|
||||
teloxide = { path = "../../", features = ["macros"] }
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
tokio = { version = "1.3.0", features = ["rt-multi-thread", "macros"] }
|
||||
|
|
|
@ -6,7 +6,7 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
# You can also choose "cbor-serializer" or built-in JSON serializer
|
||||
teloxide = { path = "../../", features = ["sqlite-storage", "bincode-serializer", "redis-storage", "macros", "auto-send"] }
|
||||
teloxide = { path = "../../", features = ["sqlite-storage", "bincode-serializer", "redis-storage", "macros"] }
|
||||
|
||||
log = "0.4.8"
|
||||
pretty_env_logger = "0.4.0"
|
||||
|
|
|
@ -156,15 +156,17 @@ where
|
|||
match this.senders.pin().get(&chat_id) {
|
||||
// An old dialogue
|
||||
Some(tx) => {
|
||||
if tx.send(cx).is_err() {
|
||||
panic!("We are not dropping a receiver or call .close() on it",);
|
||||
}
|
||||
assert!(
|
||||
tx.send(cx).is_ok(),
|
||||
"We are not dropping a receiver or call .close() on it"
|
||||
);
|
||||
}
|
||||
None => {
|
||||
let tx = this.new_tx();
|
||||
if tx.send(cx).is_err() {
|
||||
panic!("We are not dropping a receiver or call .close() on it",);
|
||||
}
|
||||
assert!(
|
||||
tx.send(cx).is_ok(),
|
||||
"We are not dropping a receiver or call .close() on it"
|
||||
);
|
||||
this.senders.pin().insert(chat_id, tx);
|
||||
}
|
||||
}
|
||||
|
@ -271,9 +273,7 @@ mod tests {
|
|||
let tx = tx.clone();
|
||||
|
||||
async move {
|
||||
if tx.send(update).is_err() {
|
||||
panic!("tx.send(update) failed");
|
||||
}
|
||||
assert!(tx.send(update).is_ok(), "tx.send(update) failed");
|
||||
}
|
||||
})
|
||||
.await;
|
||||
|
|
Loading…
Add table
Reference in a new issue