mmrs

Crates.iommrs
lib.rsmmrs
version0.1.2
sourcesrc
created_at2020-01-16 14:17:07.861401
updated_at2020-01-17 17:57:06.162536
descriptionSmall library to send POST requests to MatterMost Server
homepagehttps://github.com/deg4uss3r/mmrs
repositoryhttps://github.com/deg4uss3r/mmrs
max_upload_size
id199105
size19,642
Ricky Hosfelt (deg4uss3r)

documentation

README

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().unwrap();

    let response = mmrs::send_message("https://localhost:9009/post", body.to_string());
    
    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);
        }
    }
} 
Commit count: 13

cargo fmt