Is there any way to handle a poll ending?
I want to do something based on the results of a poll after it closes - is this possible?
4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- 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!Not sure if this answers it but from my understanding there isn't anything in the API for editing polls
https://discord.com/channels/222078108977594368/824411059443204127/1236418392727224431
here's a very stupid solution:
- track new messages via
Events.messageCreate
and add them to an array if the message contains a poll
- check periodically if Date.now() > poll.expiresTimestamp
. If so, then do whatever you want with that poll.
you could also check if Events.messageUpdate
is triggered when a poll is closed.Yes. Using the
Events.MessageUpdate
emitter, you will get the message object containing the finished poll.