Crates.io | rocketchat |
lib.rs | rocketchat |
version | 0.4.1 |
source | src |
created_at | 2022-10-17 18:48:23.24903 |
updated_at | 2022-11-01 20:02:35.054727 |
description | Rocket.Chat API Implemented in Rust |
homepage | https://github.com/karpa4o4/rocketchat |
repository | https://github.com/karpa4o4/rocketchat |
max_upload_size | |
id | 690307 |
size | 14,346 |
The library uses asynchronous HTTP client reqwest, so your Cargo.toml could look like this:
rocketchat = "0.4.0"
tokio = { version = "1", features = ["full"] }
use rocketchat::{LoginSettings, Settings};
let settings = Settings::Login(LoginSettings {
username: "chuck_norris".to_string(),
password: "supersecret".to_string(),
domain: "https://mydomain.com".to_string(),
});
use rocketchat::{AuthSettings, Settings};
let settings = Settings::Auth(AuthSettings {
auth_token: "some_auth_token".to_string(),
user_id: "some_user_id".to_string(),
domain: "https://mydomain.com".to_string(),
});
use rocketchat::methods::PostMessageMethod;
let result = PostMessageMethod {
settings: &settings,
room_id: "#channel".to_string(),
text: Some("Some message with star emoji :star:".to_string()),
..Default::default()
}.call().await;
use rocketchat::methods::ChannelCreateMethod;
let result = ChannelCreateMethod {
settings: &settings,
name: "some-channel".to_string(),
members: Some(vec!["rocket.cat".to_string()]),
..Default::default()
}.call().await;
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)