How do I get a response from a dm?

I have a system setup where if the user clicks a button, the bot sends them a dm asking a question. I would like to get the user's message and have it send to an admin only channel in the server. How can I go about doing that?
9 Replies
d.js toolkit
d.js toolkit6mo 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!
d.js docs
d.js docs6mo ago
:guide: Other Interactions: Modals read more
arc
arcOP6mo ago
oh probably because I have no idea what modals are 😭 can I send images through modals?
Benluka.dev
Benluka.dev6mo ago
you can use collectors or best use message create event
arc
arcOP6mo ago
how do I create a message collector in a user's dm?
d.js docs
d.js docs6mo ago
:method: DMChannel#createMessageCollector @14.15.3 Creates a Message Collector.
// Create a message collector
const filter = message => message.content.includes('discord');
const collector = channel.createMessageCollector({ filter, time: 15_000 });
collector.on('collect', message => console.log(`Collected ${message.content}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));
// Create a message collector
const filter = message => message.content.includes('discord');
const collector = channel.createMessageCollector({ filter, time: 15_000 });
collector.on('collect', message => console.log(`Collected ${message.content}`));
collector.on('end', collected => console.log(`Collected ${collected.size} items`));
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs6mo ago
:dtypes: v10: GatewayIntentBits - DirectMessages read more
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server