take: Improve error message

First arg must be a username, so "and not a valid amount" is misleading.
This commit is contained in:
Juerd Waalboer 2023-12-26 05:14:51 +01:00
parent bdd92748ab
commit 243b34e295

View file

@ -36,7 +36,7 @@ sub arg :Tab(USERS) ($self, $cart, $arg, @) {
push @{ $self->{users} }, $user;
} else {
return REJECT, "$arg: No such user" .
($amount ? "." : ", and not a valid amount.");
($amount || !@{ $self->{users} } ? "." : ", and not a valid amount.");
}
return "User to take from, or total amount to finish", \&arg;