已知函数$f(x)=\sin(\omega x+\varphi)(\omega$为正整数,$0 < \varphi < \pi)$在区间$\left(\dfrac{\pi}{4},\pi\right)$上单调,且$f(\pi)=f\left(\dfrac{3\pi}{2}\right)$,则$\varphi=$( )
$\text{A.}$ $\dfrac{\pi}{6}$
$\text{B.}$ $\dfrac{\pi}{4}$
$\text{C.}$ $\dfrac{\pi}{3}$
$\text{D.}$ $\dfrac{2\pi}{3}$