Language:
كتاب الحدود
86  
Limits and Punishments set by Allah (Hudood)
(5)
Chapter: Cursing is disliked against the drunkard and he is not regarded as a non-Muslim
(5)
باب مَا يُكْرَهُ مِنْ لَعْنِ شَارِبِ الْخَمْرِ وَإِنَّهُ لَيْسَ بِخَارِجٍ مِنَ الْمِلَّةِ
Sahih al-Bukhari 6780

Narrated `Umar bin Al-Khattab:

During the lifetime of the Prophet (ﷺ) there was a man called `Abdullah whose nickname was Donkey, and he used to make Allah's Messenger (ﷺ) laugh. The Prophet (ﷺ) lashed him because of drinking (alcohol). And one-day he was brought to the Prophet (ﷺ) on the same charge and was lashed. On that, a man among the people said, "O Allah, curse him ! How frequently he has been brought (to the Prophet (ﷺ) on such a charge)!" The Prophet (ﷺ) said, "Do not curse him, for by Allah, I know for he loves Allah and His Apostle."

حَدَّثَنَا يَحْيَى بْنُ بُكَيْرٍ، حَدَّثَنِي اللَّيْثُ، قَالَ حَدَّثَنِي خَالِدُ بْنُ يَزِيدَ، عَنْ سَعِيدِ بْنِ أَبِي هِلاَلٍ، عَنْ زَيْدِ بْنِ أَسْلَمَ، عَنْ أَبِيهِ، عَنْ عُمَرَ بْنِ الْخَطَّابِ، أَنَّ رَجُلاً، عَلَى عَهْدِ النَّبِيِّ صلى الله عليه وسلم كَانَ اسْمُهُ عَبْدَ اللَّهِ، وَكَانَ يُلَقَّبُ حِمَارًا، وَكَانَ يُضْحِكُ رَسُولَ اللَّهِ صلى الله عليه وسلم، وَكَانَ النَّبِيُّ صلى الله عليه وسلم قَدْ جَلَدَهُ فِي الشَّرَابِ، فَأُتِيَ بِهِ يَوْمًا فَأَمَرَ بِهِ فَجُلِدَ، فَقَالَ رَجُلٌ مِنَ الْقَوْمِ اللَّهُمَّ الْعَنْهُ مَا أَكْثَرَ مَا يُؤْتَى بِهِ‏.‏ فَقَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ لاَ تَلْعَنُوهُ، فَوَاللَّهِ مَا عَلِمْتُ أَنَّهُ يُحِبُّ اللَّهَ وَرَسُولَهُ ‏"‏‏.‏
Reference : Sahih al-Bukhari 6780
In-book reference : Book 86, Hadith 9
USC-MSA web (English) reference : Vol. 8, Book 81, Hadith 771
  (deprecated numbering scheme)