Fixed message commands where a null optionnal argument was being parsed when it shouldn't be

This commit is contained in:
anthorob committed 2024-12-12 21:17:15 -05:00
1 parent 2afab8f1f5
commit bae37fc8b1
2 files changed
+12 -1

No files matched your search

@@ -268,7 +268,10 @@ public class MessageCommandContext extends CommandContext {
invalidateContext(data, "the argument provided was not a number.");
}
options.add(new MessageCommandOption(data, value));
if (value != null) {
options.add(new MessageCommandOption(data, value));
}
index++;
}
@@ -146,4 +146,12 @@ public class MessageCommandOption implements CommandOption {
throw new IllegalStateException("Cannot resolve option of type " + type + " to GuildChannelUnion");
}
@Override
public String toString() {
return "MessageCommandOption{" +
"name=" + data.getName() +
", type=" + type +
", value=" + value +
'}';
}
}