#Stand-off command

25 messages · Page 1 of 1 (latest)

last kayakBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
keen trail
#

If you know you have to use a reaction listener, what's the problem?

gusty sandal
native meadow
#

the only code I see for reacting is in the collect event for your reaction collector
this means that it will react when a reaction is received
are you sure this is what you intended to do?

keen trail
gusty sandal
gusty sandal
#

ill try that out

#

(sry for double ping)

gusty sandal
#

so guys i editied it, now it will react(stupid for putting it in the collector) but now when i click the reaction nothing happens? check it out for me?@native meadow@keen trail

native meadow
#

have you tried logging throughout to see what executes and what doesn't?
does the collect event emit in the first place?
does your bot even receive a reaction in the first place?
does your filter execute?
does it pass the filter? (the answer here is probably not given that <:revolver_left:1137134967697182741 isn't an id)
do you have the proper intents?

lilac pumice
#

Stand-off command

gusty sandal
# native meadow have you tried logging throughout to see what executes and what doesn't? does th...

just tried logging the error, im pretty sure it's the filter, not sure tho could be wrong

[Function: collectorFilter] ReactionCollector {
  _events: [Object: null prototype] {
    end: [Function: bound onceWrapper] { listener: [Function (anonymous)] },
    collect: [Function (anonymous)],
    remove: [Function (anonymous)]
  },
  _eventsCount: 3,
  _maxListeners: undefined,
  filter: [Function: collectorFilter],
  options: { filter: [Function: collectorFilter], time: 10000 },
  collected: Collection(0) [Map] {},
  ended: false,
  _timeout: Timeout {
    _idleTimeout: 10000,
    _idlePrev: [TimersList],
    _idleNext: [TimersList],
    _idleStart: 14602,
    _onTimeout: [Function (anonymous)],
    _timerArgs: undefined,
    _repeat: null,
    _destroyed: false,
    [Symbol(refed)]: false,
    [Symbol(kHasPrimitive)]: false,
    [Symbol(asyncId)]: 8017,
    [Symbol(triggerId)]: 0
  },
  _idletimeout: null,
  _endReason: null,
  handleCollect: [Function: bound handleCollect] AsyncFunction,
  handleDispose: [Function: bound handleDispose] AsyncFunction,
  lastCollectedTimestamp: null,
  message: Message {
    channelId: '832218391624155136',
    guildId: '758465602913697822',
    id: '1137920497057796257',
    createdTimestamp: 1691371788039,
    type: 20,
    system: false,
    content: '🤠![revolver_left](https://cdn.discordapp.com/emojis/1137134967697182741.webp?size=128 "revolver_left")       ![revolver_right](https://cdn.discordapp.com/emojis/1137134969374900275.webp?size=128 "revolver_right")🤠',
    author: ClientUser {
      id: '798109762864152596',
      bot: true,
      system: false,
      flags: [UserFlagsBitField],
      username: 'CITY',
      discriminator: '4160',
      avatar: 'ffc9432db4d99fe36cac624684608b4c',
      banner: null,
      accentColor: null,
      verified: true,
      mfaEnabled: true
    },
    pinned: false,
    tts: false,
    nonce: '1137920481840594944',
    embeds: [ [Embed] ],
    components: [],
    attachments: Collection(0) [Map] {},
    stickers: Collection(0) [Map] {},
    position: null,
    roleSubscriptionData: null,
    editedTimestamp: null,
    reactions: ReactionManager { message: [Message] },
    mentions: MessageMentions {
      everyone: false,
      users: Collection(0) [Map] {},
      roles: Collection(0) [Map] {},
      _members: null,
      _channels: null,
      _parsedUsers: null,
      crosspostedChannels: Collection(0) [Map] {},
      repliedUser: null
    },
    webhookId: '798109762864152596',
    groupActivityApplication: null,
    applicationId: '798109762864152596',
    activity: null,
    flags: MessageFlagsBitField { bitfield: 0 },
    reference: null,
    interaction: {
      id: '1137920495245860975',
      type: 2,
      commandName: 'standoff',
      user: [User]
    }
  },
  users: Collection(0) [Map] {},
  total: 0,
  empty: [Function: bound empty],
  _handleChannelDeletion: [Function: bound _handleChannelDeletion],
  _handleThreadDeletion: [Function: bound _handleThreadDeletion],
  _handleGuildDeletion: [Function: bound _handleGuildDeletion],
  _handleMessageDeletion: [Function: bound _handleMessageDeletion],
  [Symbol(kCapture)]: false
}
#

also when i log the end of my collectors it tells me it caught 0 reactions

#

so im rly not sure

native meadow
#

this just looks like you logged your filter function and the collector itself
this only really answers my first question in that it's unlikely that you've logged throughout to see what executes and what doesn't

elder thistleBOT
#

If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops.

  • Once you do, log relevant values and if-conditions
  • More sophisticated debugging methods are breakpoints and runtime inspections: learn more
gusty sandal
gusty sandal
#

since it's basically turning off instantly

#

@native meadowI FUCKING GOT IT

#

I FIXED IT

#

FINALLY