Crates.io | rocketchat-message |
lib.rs | rocketchat-message |
version | 0.1.3 |
source | src |
created_at | 2022-06-28 10:15:41.157408 |
updated_at | 2022-06-28 16:32:57.125447 |
description | Library to send rocket chat messages |
homepage | |
repository | |
max_upload_size | |
id | 614745 |
size | 14,857 |
This library is an implementation of rocket chat hooks for messages
let client = RocketChat::new("ROCKET_CHAT_WEBHOOK_URL", "#channel");
client.send_text("Text").await?;
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?;
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?;