File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ fn main() {
76
76
}
77
77
78
78
}
79
- Ok ( HandlerResult :: Continue )
79
+ Ok ( ListeningAction :: Continue )
80
80
} ) ;
81
81
82
82
if let Err ( e) = res {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ fn main() {
21
21
println ! ( "<{}> {}" , name, t) ;
22
22
23
23
if t == "/exit" {
24
- return Ok ( HandlerResult :: Stop ) ;
24
+ return Ok ( ListeningAction :: Stop ) ;
25
25
}
26
26
27
27
// Answer message with "Hi"
@@ -35,7 +35,7 @@ fn main() {
35
35
}
36
36
37
37
// If none of the "try!" statements returned an error: It's Ok!
38
- Ok ( HandlerResult :: Continue )
38
+ Ok ( ListeningAction :: Continue )
39
39
} ) ;
40
40
41
41
// When the method `long_poll` returns, its due to an error. Check it here.
Original file line number Diff line number Diff line change 1
1
//! This crate helps writing bots for the messenger Telegram. Here is a
2
2
//! minimalistic example:
3
3
//!
4
- //! ```
4
+ //! ```no_run
5
+ //! use telegram_bot::*;
6
+ //!
5
7
//! // Create the Api from a bot token saved in a environment variable and
6
8
//! // test an Api-call
7
9
//! let mut api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
13
15
//! listener.listen(|u| {
14
16
//! // If the received update contains a message...
15
17
//! if let Some(m) = u.message {
16
- //! let name = m.from.first_name;
17
- //!
18
18
//! // ... and it was a text message:
19
19
//! if let MessageType::Text(_) = m.msg {
20
20
//! // Answer message with "Hi"
27
27
//! }
28
28
//!
29
29
//! // If none of the "try!" statements returned an error: It's Ok!
30
- //! Ok(HandlerResult ::Continue)
30
+ //! Ok(ListeningAction ::Continue)
31
31
//! });
32
32
//! ```
33
33
//!
You can’t perform that action at this time.
0 commit comments