rocketchat-message

Crates.iorocketchat-message
lib.rsrocketchat-message
version0.1.3
sourcesrc
created_at2022-06-28 10:15:41.157408
updated_at2022-06-28 16:32:57.125447
descriptionLibrary to send rocket chat messages
homepage
repository
max_upload_size
id614745
size14,857
Ben Ji (Ben-Ji96)

documentation

README

RocketChat Message for Rust

This library is an implementation of rocket chat hooks for messages

Send text example

let client = RocketChat::new("ROCKET_CHAT_WEBHOOK_URL", "#channel");

client.send_text("Text").await?;

Send message example

let client = RocketChat::new("ROCKET_CHAT_WEBHOOK_URL", "#channel");

let msg = RocketChatMessage::new()
    .set_text("Text")
    .set_attachments(vec![RocketChatAttachment::new()
        .set_title("Attachment title")
        .set_title_link("https://google.fr")
        .set_text("Attachment text")
        .set_author_name("Author name")
        .set_color("#c97149")]);

client.send_message(msg).await?;

Send messages example

let client = RocketChat::new("ROCKET_CHAT_WEBHOOK_URL", "#channel");

let msgs = vec![
    RocketChatMessage::new().set_text("Message1"),
    RocketChatMessage::new().set_text("Message2"),
];

client.send_messages(msgs).await?;
Commit count: 0

cargo fmt