Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
Message Collector not collecting messages | discord.js

I'm making a DM command that asks for input then sends that input to another channel. Right now it's not logging anything on the console after it asks for the content. What am I missing?

const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('journal')
        .setDescription('Write a journal entry!'),
    async execute(client, interaction) {

        // CHANNELS
        const outChannel = client.channels.cache.get('[CHANNEL_ID]');
        const inChannel = await interaction.user.createDM();

        // COLLECT MESSAGE
        await interaction.reply('Okay, what would you like to say?');
        const filter = (m) => m.author.id === interaction.user.id;
        const contentCollector = inChannel.createMessageCollector(filter, { max: 1, time: 30000 });
        contentCollector.on("collect", (m) => {
            console.log(`Collected ${m.content}`);
        });
    

        // SEND REPLY
    },
};
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!