Been a while since I coded with DJS. How do I listen for the (not as new but still newer) replies...
I am not sure how to listen to replies like the attached image. This works to run commands and I'd like to be able to do the same thing.
Also, how do you get the space between the prefix and the command name to work?
Is the prefix literally (in the case of this screenshot)
.t(space)
with (space) being replaced with a literal space?13 Replies
arguments
take the content of the message an split at every space then you got an array. Take the 2nd value [1] and this is your 1st argument. the first argument is "prefixCommand". If you just want the first value [0] to be the first argument then simply slice out the first value of your array and done
Alright, so they are using args slice 0 for
.t(space)
makes sense.
Any ideas on how to listen to replies like that?
For some of my commands I need to get the user ID of the user replied to... so I ran and logged a message in my test server to myself and this is what I need to grab (this user ID)
I just don't know how.object.......
user.id
done
so your logged user.id
I don't understand what you mean by object.
What object?
If you request something of the api then you get an object back.
Okay, that still doesn't tell me how I get that information.
I have tried
message.user.id
and message.mentions.users.first()
former says message.user
is incorrect and latter says undefined
how does your event looks like?
yeah so currently you log the user
trie user.id or user.user.id
idk
Did not work.
interesting
if you log the error then try: error.stack
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
I got it. I used
message.mentions.repliedUser.id
to get that user ID and user's info.