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

@ -110,16 +110,25 @@ async fn room_message_handler(
return; return;
} }
}; };
log_error( let command = &text_content
room.send(
RoomMessageEventContent::text_plain(
&crate::bot::process_command(
&text_content
.body .body
.trim_start_matches(&state.display_name) .trim_start_matches(&state.display_name)
.trim_start_matches(":") .trim_start_matches(":")
.trim() .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(), &event.sender.to_string(),
&mut client, &mut client,
bot_state.clone(), bot_state.clone(),