Is there a way to use a context menu builder and then get the message's author?
I want to right click > Apps > Click on my Context Menu App >
console.log
the author of the message (which I use the Apps on)20 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button![email protected]
v20.5.0
Then call .author on that
Sorry, but can you give me an example? :)
There is no example to give
Its literally just interaction.targetMessage.author
oh
That's it?
Like it says above
Damn, I'm brain dead
Thanks
Code
Error:
ContextMenuCommandInteraction#isMessageContextMenuCommand()
Indicates whether this interaction is a MessageContextMenuCommandInteraction
Use that typeguard
If you handle the modal in the same file, yes
Otherwise I dont see how
Oh ok, thank you
I added the modal handler to the
Adauga.ts
file as well and here is the code. Now how can I access the messageAuthor variable if I'm running another function?Thats not really what I meant at all
InteractionResponses#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
The link's empty, nothing in that page
MessageContextMenuCommandInteraction#awaitModalSubmit()
Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
Oh thanks
Thank you very much