From 0b5a07d192c07f81afb9dec6fb410dd5d2651e2a Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Thu, 13 Jun 2024 00:31:35 -0700 Subject: [PATCH] add alternate !admin prefix for admin commands This is supported on conduwuit, and I liked it because it's faster for me to type than tab-completing the bot user, and because it makes it a little easier to copy-paste admin commands. --- src/service/rooms/timeline.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/service/rooms/timeline.rs b/src/service/rooms/timeline.rs index 3fc590c4..6f224e5a 100644 --- a/src/service/rooms/timeline.rs +++ b/src/service/rooms/timeline.rs @@ -522,7 +522,9 @@ impl Service { .starts_with(&format!("{admin_bot}: ")) || body.starts_with(&format!("{admin_bot} ")) || body == format!("{admin_bot}:") - || body == admin_bot.as_str(); + || body == admin_bot.as_str() + || body.starts_with("!admin ") + || body == "!admin"; // This will evaluate to false if the emergency password // is set up so that the administrator can execute commands