Bot not editing embed as expected
The bot should edit the original embed if there is one with the new data from the command, which it does successfully. However, if there is a message sent in the channel from another user (not the bot) which is more recent than the embed, instead of updating the original embed it creates a new one - which it should only do if there's no embed in the channel at all.
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Post the full error stack trace, not just the top part!
- Show your code!
- Explain what exactly your issue is.
- Not a discord.js issue? Check out #useful-servers.
- Issue solved? Press the button!The message count in a channel isn't limited and fetch returns only 50 (by default, max 100). It's better to have a db record about the channel and the message with the embed.
Returning 50 isn’t an issue as the channel is locked, message could would never exceed ≈5, just need to ensure that the embed still updates if a user posts under it, and if that did happen there would only ever be up to 5ish messages under the embed anyway