How do you defeat Doggo in Undertale?

How do you defeat Doggo in Undertale?

The trick with Doggos attack is not to move and it wont hurt you. Chose to pet doggo and keep staying still for his attack – once hes been pet his name will turn yellow indicating you can now spare him. Continue on east.

How do you beat Glyde?

To beat them, the protagonist must applaud them twice and then do nothing for the rest of the battle.