Skip to content

Commit

Permalink
Merge pull request #17 from LukasKalbertodt/dev
Browse files Browse the repository at this point in the history
Version 0.3.0
  • Loading branch information
LukasKalbertodt committed Aug 29, 2015
2 parents 4bf0389 + 025895b commit a868ec2
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 73 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "telegram-bot"
version = "0.2.0"
version = "0.3.0"
authors = ["Lukas Kalbertodt <[email protected]>"]

description = "A library for creating Telegram bots."
Expand All @@ -18,3 +18,4 @@ exclude = ["deploy.sh"]
hyper = "*"
rustc-serialize = "*"
url = "*"
multipart = "*"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use telegram_bot::*;

fn main() {
// Create bot, test simple API call and print bot information
let mut api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
let api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
println!("getMe: {:?}", api.get_me());
let mut listener = api.listener(ListeningMethod::LongPoll(None));

Expand Down Expand Up @@ -83,6 +83,6 @@ Please submit pull request against the `dev` branch, unless all changes are just
- [x] "getUserProfilePhotos"
- [x] "getUpdates" and `long_poll`
- [ ] "setWebhook" and `listen`
- [ ] sending files ("sendAudio", "sendDocument", ...)
- [x] sending files ("sendAudio", "sendDocument", ...)
- [x] More good documentation and examples
- [x] Maybe think about multithreading stuff
2 changes: 1 addition & 1 deletion examples/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_serialize::json;

fn main() {
// Create bot, test simple API call and print bot information
let mut api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
let api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
println!("getMe: {:?}", api.get_me());
let mut listener = api.listener(ListeningMethod::LongPoll(None));

Expand Down
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use telegram_bot::*;

fn main() {
// Create bot, test simple API call and print bot information
let mut api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
let api = Api::from_env("TELEGRAM_BOT_TOKEN").unwrap();
println!("getMe: {:?}", api.get_me());
let mut listener = api.listener(ListeningMethod::LongPoll(None));

Expand Down
4 changes: 4 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub enum Error {
InvalidTokenFormat(::url::ParseError),
/// The given environment variable could not be fetched.
InvalidEnvironmentVar(env::VarError),
/// The given path is not valid.
InvalidPath(String),
}

impl ::std::error::Error for Error {
Expand All @@ -38,6 +40,7 @@ impl ::std::error::Error for Error {
Error::InvalidState(ref s) => &s,
Error::InvalidTokenFormat(ref e) => e.description(),
Error::InvalidEnvironmentVar(ref e) => e.description(),
Error::InvalidPath(ref s) => &s,
}
}
}
Expand All @@ -53,6 +56,7 @@ impl fmt::Display for Error {
Error::InvalidState(ref s) => s.fmt(f),
Error::InvalidTokenFormat(ref e) => e.fmt(f),
Error::InvalidEnvironmentVar(ref e) => e.fmt(f),
Error::InvalidPath(ref s) => s.fmt(f),
}
}
}
Expand Down
Loading

0 comments on commit a868ec2

Please sign in to comment.