Editing a pinned message?

Hello! I have a reply to an interaction that I'd like to edit at a later time.

The ID of the reply is stored in my database, and then the message is pinned to save it:

interaction.reply("Message...").then( reply => {
    var stored = reply.id;
    reply.pin();
});


At a later time in my code when a button is pressed, I want this message to update. So I fetch the pinned messages:

interaction.channel.fetchPinned();


But at this point, I'm stuck. Is there a way to access the message by ID here so that I can edit it?

The following doesn't seem to work:
interaction.channel.fetchPinned().then( messages => {
  for(const [key, value] of messages)
  { //if I print messages here, I see a key=>value collection — but is there a better way to access the message by the ID I stored?
      if(key == game.TURNMSG){
           value.edit("Edited!");
           //This doesn't edit the message...
           break;
      }
  }
})
Was this page helpful?