Embed and console desync
Hello. Im trying to make a reaction role like system for my server. On startup it sends an embed on the selected channel. In the embed it shows who has role. Below the Embeds are buttons that redeem the role. when the button is pressed, it redeems but the embed does not update. I do not receive an err. Clicking it again, it updates and then doesnt work anymore
https://cdn.discordapp.com/attachments/1224214387833835622/1224222029104807966/2024-03-30_19-21-27.mkv?ex=661cb49c&is=660a3f9c&hm=cf06a604a211b3b3a9f51f52a9f0b6dc48894964e472e10fcbf658dc2689e587&
11 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!1. Djs: 14.14.1 Node: 20.8.0
Code:
You have an old deprecated version of discord.js. I'm not sure if it will fix your issue, but you should update
npm i discord.js@latest
Hmmm well when I updated yesterday that’s what is got…
Oops I typed 4 instead of 14
add logs to your if statement:
`
ok
done and it indicated correctly
But the embed doesn’t seem to update still @Chrissy
Wait does the embed just not update or the roles not?
roles update embeds dont
it could be that roles.members is not valid
I'd recommend to call the updateMembersRoles Function through the interaction and get the members like that:
// for every role:
guild.members.cache. filter(member => member.roles.cache.has(roleId).map(member => member.toString());
its like that kinda but also the embed updates sometime every 2 clicks
Huh that doesn’t work either
its valid but no updating