MCPcopy Create free account
hub / github.com/chatmail/core / send_text_msg

Function send_text_msg

src/chat.rs:3015–3027  ·  view source on GitHub ↗

Sends a text message to the given chat. Returns database ID of the sent message.

(
    context: &Context,
    chat_id: ChatId,
    text_to_send: String,
)

Source from the content-addressed store, hash-verified

3013///
3014/// Returns database ID of the sent message.
3015pub async fn send_text_msg(
3016 context: &Context,
3017 chat_id: ChatId,
3018 text_to_send: String,
3019) -> Result<MsgId> {
3020 ensure!(
3021 !chat_id.is_special(),
3022 "bad chat_id, can not be a special chat: {chat_id}"
3023 );
3024
3025 let mut msg = Message::new_text(text_to_send);
3026 send_msg(context, chat_id, &mut msg).await
3027}
3028
3029/// Sends chat members a request to edit the given message's text.
3030pub async fn send_edit_request(context: &Context, msg_id: MsgId, new_text: String) -> Result<()> {

Calls 1

send_msgFunction · 0.85