receiving invalid message id

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 }
{ message: 'Unknown Message', code: 10008 }
So now I'm obviously confused and don't understand what I screwed up
No description
16 Replies
24
24ā€¢2y ago
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 I'd check docs- but I wouldn't double fetch since that would be what djs does internally anyways
Akanixon
Akanixonā€¢2y ago
I need it because I need to edit the message components later the verify was just for me to figure out whats wrong
bomi
bomiā€¢2y ago
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 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?
Akanixon
Akanixonā€¢2y ago
it's not ephemeral, it's a standard reply 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.
bomi
bomiā€¢2y ago
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
Akanixon
Akanixonā€¢2y ago
indeed, with the difference that the messageId reported doesn't match up with the actual messageId
bomi
bomiā€¢2y ago
But yeah something else is wrong here I suppose. Can you send the code maybe we can experiment Well it should. have you verified that you get the wrong message ID? Well I don't use reply for a reason KEKW Maybe it just has problems.
Akanixon
Akanixonā€¢2y ago
let rsp = await interaction.Reply({components,embeds});
try{
rsp = await interaction.channel.messages.fetch(rsp.id);
}catch(e){
console.log(e.rawError)
}
let rsp = await interaction.Reply({components,embeds});
try{
rsp = await interaction.channel.messages.fetch(rsp.id);
}catch(e){
console.log(e.rawError)
}
yes thats how I know they don't match
bomi
bomiā€¢2y ago
I bet just .send() in works better?
Akanixon
Akanixonā€¢2y ago
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
bomi
bomiā€¢2y ago
Also why is it Reply ? mine is reply and Reply doesnt work What a mess
Akanixon
Akanixonā€¢2y ago
undocumented discord api features šŸ˜„
bomi
bomiā€¢2y ago
Well yeah I can confirm it gives the wrong ID .send gives the right ID But also if you're going to update it later, the ephemeral might just be gone?
Akanixon
Akanixonā€¢2y ago
na it keeps it ephemeral šŸ˜„ the point of having reply is to have an initial with a reference to the command used
bomi
bomiā€¢2y ago
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
Akanixon
Akanixonā€¢2y ago
then I just have to lock down the channel every time someone is using the command šŸ˜„ as the reference is for the user to see what options they select it while still keeping it privat Thanks for your help, I guess .reply is just broken atm