Zayd bin Khalid reported,

We set out with the Messenger of Allah ﷺ in the year of Hudaybiyah. One night rain fell upon us, so the Messenger of Allah ﷺ led us in the dawn prayer, then turned to us and asked, "Do you know what your Lord has said?"We replied, "Allah and His Messenger know best."He said, "Allah has 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, he 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, he is a believer in the stars and a disbeliever in me.'"

Bukhari 4147

Sahih

حدثنا خالد بن مخلد حدثنا سليمان بن بلال قال حدثني صالح بن كيسان عن عبيد الله بن عبد الله

عن زيد بن خالد رضي الله عنه قال

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

البخاري 4147صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Expedition of Hudaybiya
Numbering
Darussalam 4147
Bukhari 4147