Skip to content
A minimal Rust MatterMost API library
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
src
.gitignore
Cargo.toml
LICENSE
README.md

README.md

mmrs

MatterMost Rust: a very simple MatterMost interface library written in Rust

Example:

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);
        }
    }
} 
You can’t perform that action at this time.