When you march up to attack a city, make its people an offer of peace. If they accept and open their gates, all the people in it shall be subject to forced labor and shall work for you. If they refuse to make peace and they engage you in battle, lay siege to that city. When YHWH delivers it into your hand, put to the sword all the men in it. As for the women, the children, the livestock and everything else in the city, you may take these as plunder for yourselves. And you may use the plunder YHWH gives you from your enemies. This is how you are to treat all the cities that are at a distance from you and do not belong to the goyim nearby.
However, in the cities of the goyim YHWH gives over to you, do not leave alive anything that breathes.
You must destroy all the goyim YHWH gives over to you. Do not look on them with pity and do not serve their gods, for that will be a snare to you.
YHWH will drive out those goyim before you, little by little. You will not be allowed to eliminate them all at once, or the wild animals will multiply around you. But YHWH will deliver them over to you, throwing them into great confusion until they are destroyed. He will give their kings into your hand, and you will wipe out their names from under heaven. No one will be able to stand up against you; you will destroy them.
The purpose of a conventional foreign service is to foster friendship and peace with other states. Emissaries typically try to bridge gaps and mend fences.