Skip to content

Commit

Permalink
Merge pull request #13 from LukasKalbertodt/dev
Browse files Browse the repository at this point in the history
Version 0.1.2
  • Loading branch information
LukasKalbertodt committed Jul 29, 2015
2 parents 075e382 + e9d0474 commit 878a112
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "telegram-bot"
version = "0.1.1"
version = "0.1.2"
authors = ["Lukas Kalbertodt <[email protected]>"]

description = "A library for creating Telegram bots."
Expand Down
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,19 @@ impl Bot {
/// the same update twice.
/// The `timeout` parameter influences how long (in seconds) each poll may
/// last. Defaults to 30.
/// The handler gets a mutable reference to the bot since borrowing it
/// from the outer scope won't work. When the handler returns an `Err`
/// value the bot will stop listening for updates and `long_poll` will
/// return the Error. If you want to stop listening you can just return
/// `Error::UserInterrupt`.
///
/// **Note:**
/// If the bot is restarted, but the last received updates are not yet
/// confirmed (the last poll was not empty), there will be some duplicate
/// updates.
pub fn long_poll<H>(&mut self, timeout: Option<Integer>, handler: H)
pub fn long_poll<H>(&mut self, timeout: Option<Integer>, mut handler: H)
-> Result<()>
where H: Fn(&mut Bot, Update) -> Result<()> {
where H: FnMut(&mut Bot, Update) -> Result<()> {
// Calculate final timeout: Given or default (30s)
let timeout = timeout.or(Some(30));

Expand Down

0 comments on commit 878a112

Please sign in to comment.