Clemont's Magnemite attacked
Clemont and his friends when they entered the gym because at the time the
Clembot was the owner of the gym and it had orders to get rid of intruders.
Clemont's Magnemite did recognize
Clemont though and smiled but still attacked.
It does know an electric attack but which move it is was not confirmed in the episode dialog.