Zayd bin Khalid reported,

We set out with the Messenger of Allah ﷺ during the year of Hudaybiyyah, and one night rain fell upon us. The Messenger of Allah ﷺ led us in the dawn prayer, then turned to us and said, "Do you know what your Lord has said?"We replied, "Allah and His Messenger know best."He said, "Allah said, 'This morning some of My servants have become believers in Me and others disbelievers. Whoever said, We have been given rain by the mercy of Allah, by the provision of Allah, and by the bounty of Allah, is a believer in Me and a disbeliever in the stars. But whoever said, We have been given rain by such-and-such a star, is a believer in the stars and a disbeliever in Me.'"

Azami 8965

Sahih

عن زيد بن خالد قال

خرجنا مع رسول الله ﷺ عام الحديبية، فأصابنا مطر ذات ليلة فصلى لنا رسول الله ﷺ صلاة الصبح ثم أقبل علينا فقال: أتدرون ماذا قال ربكم؟ قلنا: الله ورسوله أعلم، فقال: قال الله: أصبح من عبادي مؤمن بي وكافر بي، فأما من قال: مطرنا برحمة الله وبرزق الله، وبفضل الله، فهو مؤمن بي، كافر بالكواكب، وأما من قال: مطرنا بنجم كذا وكذا، فهو مؤمن بالكواكب كافر بي.

الأعظمي 8965صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Hudaybiya and expedition of Dhat al-Qarad
Section
Rain descending at Hudaybiya
Numbering
Jami al-Kamil 8965 (2nd edition)
Azami 8965