Add support for white spaces between command prefix and name
This commit is contained in:
@@ -66,7 +66,7 @@ pub fn get_command_parts<'a>(prefix: &str, message: &'a str) -> Option<CommandPa
|
|||||||
.to_ascii_lowercase()
|
.to_ascii_lowercase()
|
||||||
.starts_with(&prefix.to_ascii_lowercase())
|
.starts_with(&prefix.to_ascii_lowercase())
|
||||||
{
|
{
|
||||||
let message = message_trimmed_start.split_at(prefix.len()).1;
|
let message = message_trimmed_start.split_at(prefix.len()).1.trim_ascii_start();
|
||||||
|
|
||||||
match message.split_once(" ") {
|
match message.split_once(" ") {
|
||||||
Some((name, args)) => Some(CommandParts::new(name, args)),
|
Some((name, args)) => Some(CommandParts::new(name, args)),
|
||||||
|
|||||||
Reference in New Issue
Block a user