Fixed message commands where a null optionnal argument was being parsed when it shouldn't be
This commit is contained in:
1 parent
2afab8f1f5
commit
bae37fc8b1
2 files changed
+11
No files matched your search
@@ -268,7 +268,10 @@ public class MessageCommandContext extends CommandContext {
|
|||||||
invalidateContext(data, "the argument provided was not a number.");
|
invalidateContext(data, "the argument provided was not a number.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value != null) {
|
||||||
options.add(new MessageCommandOption(data, value));
|
options.add(new MessageCommandOption(data, value));
|
||||||
|
}
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,4 +146,12 @@ public class MessageCommandOption implements CommandOption {
|
|||||||
throw new IllegalStateException("Cannot resolve option of type " + type + " to GuildChannelUnion");
|
throw new IllegalStateException("Cannot resolve option of type " + type + " to GuildChannelUnion");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MessageCommandOption{" +
|
||||||
|
"name=" + data.getName() +
|
||||||
|
", type=" + type +
|
||||||
|
", value=" + value +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user