Add ban command

This commit is contained in:
2025-08-25 19:36:18 -03:00
parent 6d8217ed81
commit e44ab51adf
7 changed files with 189 additions and 27 deletions
+3 -3
View File
@@ -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)
}