Sends a text message to the given chat. Returns database ID of the sent message.
(
context: &Context,
chat_id: ChatId,
text_to_send: String,
)
| 3013 | /// |
| 3014 | /// Returns database ID of the sent message. |
| 3015 | pub 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. |
| 3030 | pub async fn send_edit_request(context: &Context, msg_id: MsgId, new_text: String) -> Result<()> { |