Welcome to the forum!
Wording in Dominion is generally very precise, so be careful not to say that you "played Diplomat" in this situation. As a reaction, Diplomat has something that it does other then letting you play it for its normal ability. So when another player plays an attack card, you can
reveal Diplomat from your hand, which does not count as
playing Diplomat.
Reaction cards in general are not things that protect you from attacks.
Moat happens to be a reaction card that does protect you from Attacks, but that doesn't mean other reaction cards will as well. Because Diplomat's reaction ability would leave you with 4 cards instead of 5 in hand, it can give you protection from an attack such as
Minion, which only affects you if you have 5 or more cards in hand.
However, Diplomat's reaction does not interact in any way with either Swindler or Bandit, other than the fact that by drawing cards you will change what card is on top of your draw pile.