1) Use of a knife by a Muslim
2) Via machine, with a Muslim pronouncing Bismillah
3) After the animal is electrically shocked and becomes weak (its consciousness is weakened), it is slaughtered by via machine with a Muslim pronouncing Bismillah
This is the response of Ayatullah Mahdi Hadavi Tehrani (may Allah prolong his life):
All three methods, given that all other conditions (such as the animal facing the Qiblah) are met, will result in the meat of the animal being halal.