Closed Gorott closed 4 years ago
Please provide a minimal reproducible code sample so we can attempt to reproduce and verify your issue. This means isolating the erroneous behavior to a fresh bot, or stripping away functionality until you can be sure the code is minimal. Also include a manual with the steps you take interacting with the code in question which results in the behavior you outlined.
Please try to reproduce the issue yourself on a fresh bot. If you can't reproduce it, it's very likely that we can't either and the code sample in question is not enough.
Boilerplate: https://discord.js.org/#/docs/main/stable/examples/ping Minimal Reproducible sample: https://stackoverflow.com/help/minimal-reproducible-example
done
I can not find a reproducible bug here, if you still find an issue in it please detail the exact operation of actions you take, what you expect to happen and what happens instead.
So this is a diagram of the logical flow in the provided code:
- start collector for emoji (1)
- start collector for emoji (2)
- react with both emojis (1), (2)
- - reacting with (1):
- - - stop collector for emoji (1)
- - - stop collector for emoji (2)
- - - start collector for (tick)
- - - start collector for (X)
- - - react with both emojis (tick), (x)
- - - - reacting with (tick)
- - - - - console log
- - - - reacting with (x)
- - - - - <no operation>
- - reacting with (2):
- - - <no operation>
Accordingly the only branches that results in an actions are:
Which works as intended:
You maybe want to consider consolidating this into a single (or maybe two) collectors. You do not need to create a separate collector for each of the emojis, you can just as well check for both emojis in a single collector and filter ["unicode_1", "unicode_2"].includes(reaction.emoji.name)
and handle the further path (which emoji was collected) in the "collect" event callback.
collector.on("collect", collected => {
if (collected.first().emoji.name === "unicode_1") {
// ...
} else {
// ...
}
})
Resources: discordjs.guide Invite to the support server if you have more questions on collectors (as this repository is only for bug reports and feature requests): https://discord.gg/bRCvFy9
it's strange that it works perfectly fine for you since it really doesn't work for me. what could be the cause for it to not work?
From how this behaves you are not running the exact code you provided as minimal sample above (which is what this report should be centered around), which makes this demonstration rather irrelevant.
The exact code above will behave the exact same on the tested version of the library 12.3.1
. There is no reason why it might behave differently for you, should you use this version and the provided code.
As for your original code (which you seem to be running in your demo): Log around, try and find out where execution stops/filters are passed/collectors end/input arrives - possibly by attaching more listeners (for end) and monitoring the behavior.
If you can actually still reproduce after running the minimal code sample feel free to re-open.
@almostSouji seems like i found out what the problem is (don't know how to fix it) updated the example hope u can do something with it
you compare names with ids in your second set of filters.
If you need help with discord.js installation or usage, please go to the discord.js Discord server instead: https://discord.gg/bRCvFy9 This issue tracker is only for bug reports and enhancement suggestions. You won't receive any basic help here.
Please describe the problem you are having in as much detail as possible: So i am currently working on a settings menu with reactions the problem is that the only the first collector works which is '1️⃣'
Include a reproducible code sample here, if possible:
utils.editEmbed and utils.sendEmbed just work the same as a normal embed creation
Further details:
Relevant client options: