"I do not know whether the Messenger of Allah ﷺ forbade it because the donkeys were the people's means of transport, so he disliked that their transport be lost, or whether he prohibited the flesh of domestic donkeys on the day of Khaybar outright."
لا أدري أنهى رسول الله ﷺ من أجل أنه كان حمولة الناس، فكره أن تذهب حمولتهم، أو حرمه في يوم خيبر لحوم الحمر الأهلية.
Bukhari narrated it in the Book of Military Expeditions (4227), and Muslim in the Book of Hunting and Slaughtered Animals (1939:32), both of them via Umar bin Hafs bin Ghiyath, who said, my father narrated to us, from Asim, from Amir (that is, Shaybi), from Ibn Abbas, who mentioned it.