Abu Hurairah reported,

The Prophet ﷺ came out upon a group of his companions who were laughing and chatting. He said, "By the One in whose hand my soul rests, if you knew what I know, you would laugh little and weep much."Then he turned away, and the people wept. Allah عز وجل revealed to him, "Muhammad, why do you drive my servants to despair?"So the Prophet ﷺ returned and said, "Rejoice, be steadfast, and seek the middle path."

Azami 14710

Sahih

عن أبي هريرة قال

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

الأعظمي 14710صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Hisbah, dawah, and the sermon
Section
Prohibition of causing the slaves of Allah to despair
Numbering
Jami al-Kamil 14710 (2nd edition)
Azami 14710