Add prefix customization command
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user