Get message by ID and then update it
I tried this but
.update
does not exist
19 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!
- ✅
Marked as resolved by OPnpm list discord.js
node -v
Fetch returns a promise
very first you need to await or use then
update also doesn't exist on a message
It's a method on an interaction
oh I used await sorry accidentally cut that off
that still won't work I assume. The update should go on next line
This is why you don't one line promises
it's edit also
If you don't need the message content or anything prior, you can just do channel.messages.edit()
Don't need to fetch it first
what? dont i still need the message to put it to first argument of edit?
or does that work with a message id too?
let me try
Of course you don't need the full message object, that would defeat the purpose of it being able to edit uncached messages
so I'm trying to edit an embed and replace that with another
so this should work right?
my IDEs complaining about the types mismatching though and when I checked the types I couldn't figure out how would I edit an embed with files and components
What's it saying is wrong
is not assignable to parameter type
string | MessagePayload | MessageEditOptions
anyways i'll try it anyways and see if thats an IDE issue
doesn't look like a one tho, because its correct when I check the docsI think it's attachments when editing
The message edit options don't agree with the message payload
I'm not super well versed in this part, sorry
even though my IDE complains about stuff, it works fine!
tysm @Mark