refactor(matrix): check prefix before owner

This commit is contained in:
Ryan 2025-03-21 07:58:31 -04:00
parent 2814f4f43a
commit ad24daae33
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3

View File

@ -28,7 +28,7 @@ pub async fn on_regular_room_message(
return Ok(()); return Ok(());
}; };
if ctx.is_owner(&event.sender.to_string()) && text_content.body.starts_with(&ctx.name) { if text_content.body.starts_with(&ctx.name) && ctx.is_owner(&event.sender.to_string()) {
let body = text_content.body[ctx.name.len()..] let body = text_content.body[ctx.name.len()..]
.trim_start_matches(':') .trim_start_matches(':')
.trim(); .trim();