when you hear the cocks crowing, ask Allah for some of His grace, for they have seen as angel; but when you hear an ass braying, seek refuge in Allah from the devil, for it has seen the devil. (Using translation from Abū Dāʾūd 5102)
أَنَّ رَسُولَ اللهِ ﷺ قَالَ «إِذَا سَمِعْتُمُ الدِّيَكَةَ تَصِيحُ بِاللَّيْلِ فَإِنَّهَا رَأَتْ مَلَكًا فَسَلُوا اللهَ مِنْ فَضْلِهِ وَإِذَا سَمِعْتُمْ نَهِيقَ الْحَمِيرِ فَإِنَّهَا رَأَتْ شَيْطَانًا فَاسْتَعِيذُوا بِاللهِ مِنَ الشَّيْطَانِ الرَّجِيمِ»