Skip to content

Commit 7d5efae

Browse files
Fix examples
1 parent 0b621c1 commit 7d5efae

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

examples/features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn main() {
7676
}
7777

7878
}
79-
Ok(HandlerResult::Continue)
79+
Ok(ListeningAction::Continue)
8080
});
8181

8282
if let Err(e) = res {

examples/simple.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121
println!("<{}> {}", name, t);
2222

2323
if t == "/exit" {
24-
return Ok(HandlerResult::Stop);
24+
return Ok(ListeningAction::Stop);
2525
}
2626

2727
// Answer message with "Hi"
@@ -35,7 +35,7 @@ fn main() {
3535
}
3636

3737
// If none of the "try!" statements returned an error: It's Ok!
38-
Ok(HandlerResult::Continue)
38+
Ok(ListeningAction::Continue)
3939
});
4040

4141
// When the method `long_poll` returns, its due to an error. Check it here.

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
//! This crate helps writing bots for the messenger Telegram. Here is a
22
//! minimalistic example:
33
//!
4-
//! ```
4+
//! ```no_run
5+
//! use telegram_bot::*;
6+
//!
57
//! // Create the Api from a bot token saved in a environment variable and
68
//! // test an Api-call
79
//! let mut api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
@@ -13,8 +15,6 @@
1315
//! listener.listen(|u| {
1416
//! // If the received update contains a message...
1517
//! if let Some(m) = u.message {
16-
//! let name = m.from.first_name;
17-
//!
1818
//! // ... and it was a text message:
1919
//! if let MessageType::Text(_) = m.msg {
2020
//! // Answer message with "Hi"
@@ -27,7 +27,7 @@
2727
//! }
2828
//!
2929
//! // If none of the "try!" statements returned an error: It's Ok!
30-
//! Ok(HandlerResult::Continue)
30+
//! Ok(ListeningAction::Continue)
3131
//! });
3232
//! ```
3333
//!

0 commit comments

Comments
 (0)