The Prophet ﷺ said, "When you hear the crowing of roosters, ask Allah of His bounty, for they have seen an angel. And when you hear the braying of donkeys, seek refuge with Allah from Satan, for they have seen a devil."
حدثنا قتيبة بن سعيد حدثنا الليث عن جعفر بن ربيعة عن الأعرج
أن النبي ﷺ قال إذا سمعتم صياح الديكة فسلوا الله تعالى من فضله فإنها رأت ملكا وإذا سمعتم نهيق الحمار فتعوذوا بالله من الشيطان فإنها رأت شيطانا
Bukhari included it in the Book of the Beginning of Creation, chapter on the best wealth of a Muslim being sheep that he takes to the mountain peaks, hadith no. 3303, and Muslim included it in the Book of Remembrance and Supplication, chapter on the recommendation of supplication at the crowing of the rooster, hadith no. 2729, from Qutayba.