It is narrated from Zaid bin Khalid Al-Juhani (may Allah be pleased with him) that he said: The Messenger of Allah (ﷺ) led us in the morning prayer at Hudaybiyyah after a night in which it had rained. When he finished the prayer, he turned to the people and said: "Do you know what your Lord has said?" The people replied: Allah and His Messenger know best. He (ﷺ) said: (Allah has said) 'This morning some of My servants have become believers in Me and some have become disbelievers. As for the one who said: We have been given rain by the grace and mercy of Allah, he is a believer in Me and a disbeliever in the stars. And as for the one who said: We have been given rain by such-and-such star, he is a disbeliever in Me and a believer in the stars.'"
Hadith Referenceمسند الإمام الشافعي / كتاب العيدين والأضاحي والاستسقاء / 522
Hadith Takhrijاخرجه البخارى ، الأذان، باب يستقبل الامام الناس اذا سلم (846) ومسلم ، الايمان، باب بيان كفر من قال مطرنا بالنوء (71)۔