A Rust interface for Cleverbot.io.
This crate works with Cargo and can be found on crates.io with a Cargo.toml
like:
toml
[dependencies]
cleverbot_io = "*"
```rust extern crate cleverbot_io;
use cleverbot_io::{Cleverbot};
fn main() { // Use an automatically generated reference nick by using None for the third parameter. let mut bot = Cleverbot::new(String::from("YOURAPIKEY"), String::from("YOURAPIUSER"), None); // Print the bot's response to a greeting. println!("{}", bot.say(&"Hello."));
// Or, set a nick using Some for the third parameter.
let mut bot1 = Cleverbot::new(String::from("YOUR_API_KEY"), String::from("YOUR_API_USER"), Some(String::from("Carlos")));
println!("{}", bot1.say(&"Why am I still talking to you?"));
}
```