#When doing the command twice and answering one of the questions, it sends the msg twice
1 messages · Page 1 of 1 (latest)
lemme see ur code rq
u don't using a filter
im tryna make it be like this
its not coz of that, and i have a filter
it's because you are using the collector in the channel, not the channel. try the check the message.id in the filter?
its to do with the collectors
how i do that?
give me a second to think about it
it already is filtering the msg isnt it?
let filter = m => m.id === message.id```message being the message your bot is sending
what i mean is that your collector is collecting messages in the channel, so by asking two questions you are waiting for two answers, right?
yh
so what you can do is only check what quesiton is this message answering
wait i'm confuse now
same
okay i have an idea
this problem is so confusing
yeah the problem is that questions are overlapping each other in the channel...
so i mean an easy way to fix this is to only allow 1 question per channel
yh someone in a dif server said something ab the collectors, lemme check
hmm
or you can make that if there is multiple questions in a channel, you have to answer using the reply thing
(like this)
hmm
how did this server do it?
so that your bot knows which question the user is answering
i guess they ignore the answer if it's not the correct one
coz of this
yeah thats wut i did except it does the double msg thing if i say the correct answer for either question
oh i know why
because you are checking if it's the correct answer in the filter
i think you should check if the message content is the answer or not in the collector, so you should use the collector.on thing instead of awaitMessage I guess?
I don't know if it's the best way to do what you want to do, but if i was my code i would do that 🤔
how bout u right 7 and the answer is 7 10 or somethin, and wouldnt it still send it twice
idk test it
i also realised i can only answer the newer question not the first question
so the new collector overwrites the old one
i think
show your code
Hi, not sure if I'm just blind or if you don't initiate quiz (at least not inside the function)
quiz = questions[Math.floor(Math.random() * questions.length)]
It might overwrite quiz everytime you call the function
hmm
A simple const quiz = ... should work
Lol you're welcome
the most smallest mistake was the reason of this whole thing