Skip to content

Message collector responds to other people’s messages

I’m trying to make a collector which will collect the mentioned user’s message. But even with filter my bot respond to it’s own message and other peoples messages! Here is my test.js file code:

const mentioned = message.mentions.users.first();

const filter1 = (msg) => {
  return ===

const collector1 = await{ filter1, max: 1, time: 120000 })

collector1.on('collect', message => {

collector1.on('end', (collected) => {
  if (collected.size === 0) return"Mentioned user did not respond in time!")

  collected.forEach((message) => {
    if (message.content.toLowerCase() == 'accept') {`${mentioned} accepted!`)
    if (message.content.toLowerCase() == 'cancel') return`${mentioned} declined!`)

I was changing my filter many times, but I still can’t fix this problem, so what am I doing wrong? Also I use djs v13


The problem is you’re trying to use Short-Hand Property Assignment to assign the filter option. However, you pass in “filter1” which results in {filter1: filter1}. Since this does not resolve to a filter option for TextChannel#createMessageCollector() the method disregards the unknown option and therefor your collector has no filter.

Change your filter1 variable to filter

const filter = (msg) => {
  return ===

const collector1 = await{ filter, max: 1, time: 120000 })