Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
InteractionCollector is is not being set properly in Quick.DB .sqlite file discord.js

I'm trying to use quick.db for an InteractionCollector manager in discord.js with typescript, and since there can't be more than 1 collector active, whenever a user uses a command that has a collector, it gets set into a map with the user id, and whenever the user uses another command with a collector, the old one gets destroyed.
The problem is, if I use a normal JavaScript map, it works, but since it is heavier I want to use a .sqlite file with quick.db, and when I set the collector, it does not get set entirely, only a sub-object, and since that sub-object does not have the stop function, it gives an error

oldCollector.stop is not a function

Is there a way to fix this, and why does this happen?

Example: This is a collector:

InteractionCollector {
    _events: [Object: null prototype] { end: [Array], collect: [Array] },
    _eventsCount: 2,
    _maxListeners: undefined,
    filter: [AsyncFunction: filter],
    options: {
      filter: [AsyncFunction: filter],
      time: 67709,
      interactionType: 3,
      channel: [TextChannel]
    },
    collected: Collection(0) [Map] {},
    ended: false,
    _timeout: Timeout {
      _idleTimeout: 67709,
      _idlePrev: [TimersList],
      _idleNext: [TimersList],
      _idleStart: 21969,
      _onTimeout: [Function (anonymous)],
      _timerArgs: undefined,
      _repeat: null,
      _destroyed: false,
      [Symbol(refed)]: false,
      [Symbol(kHasPrimitive)]: false,
      [Symbol(asyncId)]: 741,
      [Symbol(triggerId)]: 0
    },
    _idletimeout: null,
    handleCollect: [Function: bound handleCollect] AsyncFunction,
    handleDispose: [Function: bound handleDispose] AsyncFunction,
    messageId: null,
    channelId: '988393091528523816',
    guildId: '988393091067174973',
    interactionType: 'MESSAGE_COMPONENT',
    componentType: null,
    users: Collection(0) [Map] {},
    total: 0,
    empty: [Function: bound empty],
    _handleChannelDeletion: [Function: bound _handleChannelDeletion],
    _handleThreadDeletion: [Function: bound _handleThreadDeletion],
    _handleGuildDeletion: [Function: bound _handleGuildDeletion],
    [Symbol(kCapture)]: false
  }
}

and if I set it with quick.db via db.set(interaction.user.id, collector), it returns this and crashes:

{
      collected: [],
      messageId: null,
      channelId: '988393091528523816',
      guildId: '988393091067174973',
      interactionType: 'MESSAGE_COMPONENT',
      componentType: null,
      users: [],
      total: 0
}

How I set it in the db:

 const collector = interaction.channel.createMessageComponentCollector({
    filter,
    time: utils.rng(50000, 100000),
  });
  collectorMap.set(interaction.user.id, collector);
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda