First Argument
const user = await args.pick("member").catch(() => null);
With this code I tried to make the bot get the member from the first argument but looks like it only gets the member if the bot finds it on the second argument, third, etc, how can I fix it?15 Replies
@_carlos123 Could you send your full code?
It's because the first argument is
const argument = await args.pick("string").catch(() => null);
wdym
user
is coming from the second argument because argument
is coming from the firstoh is there any alternative to do what i was trying to do
basically I want it to say something if the user does not provide nothing at all but also say something if the user provides something but is not a vaild member
Try something like
lemme show with one of the bots i coded
its in slash but itd be somewhat similar with the if checks
these are all with 1 argument
instead of
this didn't work, since there's no reason in the command I'm trying to make i tried this:
@Carlos1996 use
args.finished
, which tells you if the user provided anything
the .createError's now work as intented but now the bot does not detect the user at all, even if I provide it in the second, third argument etc
I logged
user
and looks like its detecting the user from the first argument correctly, no idea why it sends the if (!user)
part
bumpCan you send your code
@_carlos123
Well also isn't needed
wdym
i'm 100% sure I already tried this but I just tried it again rn and it worked for some reason
well I changed args.pick("member") to args.pick("user") but just tested both and they work
maybe my vsc was having some troubles when i tried
anyways ty a lot of the help