Imam Bukhari, may Allāh have mercy on him, narrates: Abdullah bin Maslamah narrated to us from Malik from Salih bin Kaisan from Ubaidullah bin Abdullah bin Utbah bin Mas'ud from Zaid bin Khalid al-Juhani, he relates that
the Messenger of Allāh ﷺ led us in the morning prayer at Hudaibiyah. At that time there were signs of the night's rain upon the sky. Having finished the prayer, he sat facing the people, then he said: Do you know what your Lord has said? The Companions said: Allāh and His Messenger know best. He said: Allāh says: Some of My servants became believers in the morning and some became disbelievers. Those who said: It rained by the grace of Allāh and His mercy, are believers in Me and disbelievers in the stars. And those who said: It rained because of such and such a star, are disbelievers in Me and believers in the stars.
حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، عَنْ صَالِحِ بْنِ كَيْسَانَ، عَنْ عُبَيْدِ اللَّهِ بْنِ عَبْدِ اللَّهِ بْنِ عُتْبَةَ بْنِ مَسْعُودٍ، عَنْ زَيْدِ بْنِ خَالِدٍ الْجُهَنِيِّ، أَنَّهُ قَالَ صَلَّى لَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم صَلاَةَ الصُّبْحِ بِالْحُدَيْبِيَةِ عَلَى إِثْرِ سَمَاءٍ كَانَتْ مِنَ اللَّيْلَةِ، فَلَمَّا انْصَرَفَ أَقْبَلَ عَلَى النَّاسِ فَقَالَ " هَلْ تَدْرُونَ مَاذَا قَالَ رَبُّكُمْ ". قَالُوا اللَّهُ وَرَسُولُهُ أَعْلَمُ. قَالَ " أَصْبَحَ مِنْ عِبَادِي مُؤْمِنٌ بِي وَكَافِرٌ، فَأَمَّا مَنْ قَالَ مُطِرْنَا بِفَضْلِ اللَّهِ وَرَحْمَتِهِ فَذَلِكَ مُؤْمِنٌ بِي وَكَافِرٌ بِالْكَوْكَبِ، وَأَمَّا مَنْ قَالَ بِنَوْءِ كَذَا وَكَذَا فَذَلِكَ كَافِرٌ بِي وَمُؤْمِنٌ بِالْكَوْكَبِ ".
Reference: Sahih Al Bukhari 846