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.
This commit is contained in:
Benjamin Lee 2024-06-13 00:31:35 -07:00 committed by Charles Hall
parent a909e2079b
commit 0b5a07d192
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -522,7 +522,9 @@ impl Service {
.starts_with(&format!("{admin_bot}: ")) .starts_with(&format!("{admin_bot}: "))
|| body.starts_with(&format!("{admin_bot} ")) || body.starts_with(&format!("{admin_bot} "))
|| body == 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 // This will evaluate to false if the emergency password
// is set up so that the administrator can execute commands // is set up so that the administrator can execute commands