rocketchat 0.3.1

Rocket.Chat API Implemented in Rust
Documentation

rocketchat

Rust API wrapper for the RocketChat API

crates.io MIT/Apache-2 licensed

Example

Initialize the client with a username and password.

use rocketchat::{LoginSettings, RocketChatAPI, Settings};

let settings = Settings::Login(LoginSettings {
    username: String::from("chuck_norris"),
    password: String::from("supersecret"),
    domain: String::from("https://mydomain.com"),
});
let client = RocketChatAPI::new(settings);

Initialize the client with an auth token and user ID.

use rocketchat::{AuthSettings, RocketChatAPI, Settings};

let settings = Settings::Auth(AuthSettings {
    auth_token: String::from("some_auth_token"),
    user_id: String::from("some_user_id"),
    domain: String::from("https://mydomain.com"),
});
let client = RocketChatAPI::new(settings);

Available API methods

Post Message

let result = client.send_message("Some message with star emoji :star:", "#channel");

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.