📅  最后修改于: 2022-03-11 14:59:39.584000             🧑  作者: Mango
if (alias.equalsIgnoreCase("hello") {
if (args.length == 0) { //Sender only typed '/hello' and nothing else
sender.sendMessage("You only typed hello!");
} else { //Sender typed more then 1 argument, so args[0] can't be null.
if (args[0].equalsIgnoreCase("sir") { //Sender typed '/hello sir'
sender.sendMessage("You typed hello sir!");
} else { //Sender had attest 1 argument, but didn't type sir as a second one!
//args[0] also returns string, so lets send the message right back to them!
sender.sendMessage("Your first argument was: " + args[0]);
}
}