Umar bin Khattab reported,

During the time of the Prophet ﷺ, there was a man named Abdullah who was nicknamed Himar, meaning "donkey," and he used to make the Messenger of Allah ﷺ laugh. The Prophet ﷺ had previously flogged him for drinking wine.One day he was brought in again, and the Prophet ﷺ ordered that he be flogged. A man among the people said, "Allah, curse him. How often he is brought in!"The Prophet ﷺ said, "Do not curse him. By Allah, I know nothing of him except that he loves Allah and His Messenger."

Bukhari 6780

Sahih

حدثنا يحيى بن بكير حدثني الليث قال حدثني خالد بن يزيد عن سعيد بن أبي هلال عن زيد بن أسلم عن أبيه

عن عمر بن الخطاب

أن رجلا على عهد النبي ﷺ كان اسمه عبد الله وكان يلقب حمارا وكان يضحك رسول الله ﷺ وكان النبي ﷺ قد جلده في الشراب فأتي به يوما فأمر به فجلد فقال رجل من القوم اللهم العنه ما أكثر ما يؤتى به فقال النبي ﷺ لا تلعنوه فوالله ما علمت إنه يحب الله ورسوله

البخاري 6780صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Legal punishments
Chapter
What is disliked of cursing the wine drinker, and that he is not outside the religion
Numbering
Darussalam 6780
Bukhari 6780