Error coming up when trying to pin a message

I am trying to make my bot pin a fetched message when a command is run, however it runs into an error saying “.pin is not a function”. The code is below (ignore everything except the code that is in the else block)

   if (primaryCommand == "pin") {
    if (args[0] == null) {
      missingArg(receivedMessage, "message id")
    }
    else {
      receivedMessage.channel.fetchMessage("708042670240432168").pin()
      
    }
      
}
  
}

EDIT: Image of error:
image

Assuming you’re using Discord.js V11, you should do

receivedMessage.channel.fetchMessage('708042670240432168').then(msg => msg.pin())

Thanks! It now works