Reciprocity for $L$-functions twisted by Dirichlet characters