Vote Button Update Logic
Hey,
I'm working on a bot that implements mafia game mechanics, and I'm facing a challenge with updating the dynamic count emojis on voting buttons during the mafia vote phase.
In the mafiaVote function, I dynamically create buttons for each non-mafia player, where the emoji on each button represents the current vote count. The logic works well for individual votes, but I'm struggling with updating the interaction for all mafia players after each mafia vote.
Currently when a mafia player votes for a certain player, the vote counter changes only for the player who voted, but does not change for the rest of the players, except when the other player's votes
The code:
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!get the id from the followUp and store it then try (if it exists) edit it with editReply({message: id, content, buttons }) should work
i have been thinking about this idea, i will give it a try.