S-IAF
Join ServerSapphire - Imagine a framework
discordjs-support
receiving invalid message id
AAkanixon1/17/2023
Either I'm getting something wrong or something aint right but in the image below you see the bot replying to a command and using the ID to fetch the message again, why? Because I wanted to verify its the correct ID before moving onward but then I get the error
{ message: 'Unknown Message', code: 10008 }
So now I'm obviously confused and don't understand what I screwed up
2241/17/2023
that's a weird statement flow- why verify the replied interaction when you know it's either a valid message or void since the reply might or might not return that
2241/17/2023
I'd check docs- but I wouldn't double fetch since that would be what djs does internally anyways
AAkanixon1/17/2023
I need it because I need to edit the message components later
AAkanixon1/17/2023
the verify was just for me to figure out whats wrong
Bbomi1/22/2023
I don't see how checking that the message is still there helps with that?
The message could be deleted after you check once anyway, and then you'd still error on the edit
The message could be deleted after you check once anyway, and then you'd still error on the edit
Bbomi1/22/2023
Now it seems like you're not able to fetch the message at all. But we can't see the details of the message?
Is it ephemeral?
Is it ephemeral?
AAkanixon1/22/2023
it's not ephemeral, it's a standard reply
AAkanixon1/22/2023
I do because a process which is running outside the command and not initiated by a discord event needs to edit a part of the embed and therefore would need the message id as well as the ability to fetch based on it.
Bbomi1/22/2023
I mean I have such a thing too (Message updater in GW bot), so I just send message, store message ID in db
Then in the update function I try to fetch it, if it fails I send a new one, if that fails I tell the user they messed up
Then in the update function I try to fetch it, if it fails I send a new one, if that fails I tell the user they messed up
AAkanixon1/22/2023
indeed, with the difference that the messageId reported doesn't match up with the actual messageId
Bbomi1/22/2023
But yeah something else is wrong here I suppose. Can you send the code maybe we can experiment
Bbomi1/22/2023
Well it should. have you verified that you get the wrong message ID?
Well I don't use reply for a reason
Maybe it just has problems.
Well I don't use reply for a reason

AAkanixon1/22/2023
let rsp = await interaction.Reply({components,embeds});
try{
rsp = await interaction.channel.messages.fetch(rsp.id);
}catch(e){
console.log(e.rawError)
}
AAkanixon1/22/2023
yes thats how I know they don't match
Bbomi1/22/2023
I bet just .send() in works better?
AAkanixon1/22/2023
true, the intension later on is to make it ephemeral. And theorectically editing ephemerals is not supported but a editReply just works anyway and keeps it ephemeral
Bbomi1/22/2023
Also why is it Reply ? mine is reply and Reply doesnt work
Bbomi1/22/2023
What a mess
AAkanixon1/22/2023
undocumented discord api features š
Bbomi1/22/2023
Well yeah I can confirm it gives the wrong ID
Bbomi1/22/2023
.send gives the right ID
Bbomi1/22/2023
But also if you're going to update it later, the ephemeral might just be gone?
AAkanixon1/22/2023
na it keeps it ephemeral
AAkanixon1/22/2023
š
AAkanixon1/22/2023
the point of having reply is to have an initial with a reference to the command used
Bbomi1/22/2023
My suggestion is using the old reliable .send() and edit() rather than going going into strange undocumented land unless you want to deal with stuff like this
AAkanixon1/22/2023
then I just have to lock down the channel every time someone is using the command š
AAkanixon1/22/2023
as the reference is for the user to see what options they select it while still keeping it privat
AAkanixon1/22/2023
Thanks for your help, I guess
.reply
is just broken atm