Add prefix customization command

This commit is contained in:
2025-08-14 18:30:33 -03:00
parent eb6dcb4604
commit 53d61cfbbb
7 changed files with 143 additions and 7 deletions
+7 -1
View File
@@ -20,6 +20,9 @@ pub enum CommandError {
#[error("A database operation failed due to an inconsistent state")]
DatabaseInconsistentState,
#[error("The command was used in DMs, but it can only be used in servers")]
ServerCommandRunInDMs,
}
#[async_trait]
@@ -66,7 +69,10 @@ pub fn get_command_parts<'a>(prefix: &str, message: &'a str) -> Option<CommandPa
.to_ascii_lowercase()
.starts_with(&prefix.to_ascii_lowercase())
{
let message = message_trimmed_start.split_at(prefix.len()).1.trim_ascii_start();
let message = message_trimmed_start
.split_at(prefix.len())
.1
.trim_ascii_start();
match message.split_once(" ") {
Some((name, args)) => Some(CommandParts::new(name, args)),