Add ban command
This commit is contained in:
@@ -106,7 +106,7 @@ impl<S, E> FromArguments<S, E> for NeedyString {
|
||||
args: &'a str,
|
||||
_ctx: &'a CommandContext<'_, S, E>,
|
||||
) -> Result<(Self, &'a str), ArgumentParsingError> {
|
||||
if !args.is_empty() {
|
||||
if !args.trim().is_empty() {
|
||||
match args.split_once(" ") {
|
||||
Some((arg, rest)) => Ok((Self(arg.to_string()), rest)),
|
||||
None => Ok((Self(args.to_string()), "")),
|
||||
@@ -144,8 +144,8 @@ impl<S, E> FromArguments<S, E> for NeedyGreedyString {
|
||||
args: &'a str,
|
||||
_ctx: &'a CommandContext<'_, S, E>,
|
||||
) -> Result<(Self, &'a str), ArgumentParsingError> {
|
||||
if !args.is_empty() {
|
||||
Ok((Self(args.to_string()), ""))
|
||||
if !args.trim().is_empty() {
|
||||
Ok((Self(args.trim().to_string()), ""))
|
||||
} else {
|
||||
Err(ArgumentParsingError::MissingArgument)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user