Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deg4uss3r/mmrs
A minimal Rust MatterMost API library
https://github.com/deg4uss3r/mmrs
Last synced: 26 days ago
JSON representation
A minimal Rust MatterMost API library
- Host: GitHub
- URL: https://github.com/deg4uss3r/mmrs
- Owner: deg4uss3r
- License: apache-2.0
- Created: 2020-01-07T17:15:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-17T19:51:46.000Z (almost 5 years ago)
- Last Synced: 2024-11-15T19:49:12.729Z (about 1 month ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mmrs
MatterMost Rust: a very simple MatterMost interface library written in Rust
Example:
```rust
use mmrs;fn main() {
let your_handle = "Degausser".to_string();
let your_name = "Ricky".to_string();
let mut message: mmrs::MMBody = mmrs::MMBody::new();message.username = Some("mmrsBOT".to_string());
message.channel = Some("Town Square".to_string());message.text = Some(format!(
"{} is known as {}",
&user,
&your_name
));let body = message.to_json().expect("Error converting to json");
let response = mmrs::send_message("https://localhost:9009/post", body);
match response {
Ok(code) => {
if code == 200 {
println!("{}: Sucess!", code);
} else {
println!("Error bad response code: {}\n\n", code);
}
}
Err(e) => {
println!("Error: {}\n\n", e);
}
}
}
```