Log Matrix messages

This commit is contained in:
ErrorNoInternet 2023-01-28 22:51:35 +08:00
parent 3836ad8094
commit 38c1240998
Signed by untrusted user who does not match committer: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3

View File

@ -110,16 +110,25 @@ async fn room_message_handler(
return;
}
};
log_error(
room.send(
RoomMessageEventContent::text_plain(
&crate::bot::process_command(
&text_content
let command = &text_content
.body
.trim_start_matches(&state.display_name)
.trim_start_matches(":")
.trim()
.to_string(),
.to_string();
log_message(
Matrix,
&format!(
"Executing command from {}: {}",
event.sender.to_string(),
command
),
);
log_error(
room.send(
RoomMessageEventContent::text_plain(
&crate::bot::process_command(
&command,
&event.sender.to_string(),
&mut client,
bot_state.clone(),