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
d.js toolkit
d.js toolkit16mo ago
- 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!
LightAndy📸
LightAndy📸OP16mo ago
d.js docs
d.js docs16mo ago
property MessageContextMenuCommandInteraction#targetMessage The message this interaction was sent from
chewie
chewie16mo ago
Then call .author on that
LightAndy📸
LightAndy📸OP16mo ago
Sorry, but can you give me an example? :)
chewie
chewie16mo ago
There is no example to give Its literally just interaction.targetMessage.author
LightAndy📸
LightAndy📸OP16mo ago
oh That's it?
chewie
chewie16mo ago
Like it says above
LightAndy📸
LightAndy📸OP16mo ago
Damn, I'm brain dead Thanks
LightAndy📸
LightAndy📸OP16mo ago
Code Error:
chewie
chewie16mo ago
Use that typeguard
LightAndy📸
LightAndy📸OP16mo ago
That worked, thank you! And then is there a way to use that variable (const messageAuthor = interaction.targetMessage.author) from Adauga.ts to Modals.ts?
chewie
chewie16mo ago
If you handle the modal in the same file, yes Otherwise I dont see how
LightAndy📸
LightAndy📸OP16mo ago
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?
chewie
chewie16mo ago
Thats not really what I meant at all
d.js docs
d.js docs16mo ago
method InteractionResponses#awaitModalSubmit() Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
LightAndy📸
LightAndy📸OP16mo ago
The link's empty, nothing in that page
d.js docs
d.js docs16mo ago
method MessageContextMenuCommandInteraction#awaitModalSubmit() Collects a single modal submit interaction that passes the filter. The Promise will reject if the time expires.
LightAndy📸
LightAndy📸OP16mo ago
Oh thanks Thank you very much
Want results from more Discord servers?
Add your server