BAYHAQI 13380:
from Qāl Rasūl Allāh Ṣllá —
[Machine] The Messenger of Allah ﷺ said, "O Allah, I have made a covenant with You that You will not break. Indeed, I am only a human, so if I ever harm or insult a believer, or beat them, or curse them, then make it for them a means of prayer, purification, and nearness [to You] on the Day of Judgment." This is the wording of the Hadith of As-Sulami.
البيهقي ١٣٣٨٠:
عن قال رسول الاه صلى —
قَالَ رَسُولُ اللهِ ﷺ اللهُمَّ إِنِّي اتَّخَذْتُ عِنْدَكَ عَهْدًا لَنْ تُخْلِفَهُ إِنَّمَا أَنَا بَشَرٌ فَأِيُّ الْمُؤْمِنِينَ آذَيْتُهُ أَوْ شَتَمْتُهُ أَوْ جَلَدْتُهُ أَوْ لَعَنْتُهُ فَاجْعَلْهَا لَهُ صَلَاةً وَزَكَاةً وَقُرْبَةً تُقَرِّبُهُ بِهَا يَوْمَ الْقِيَامَةِ لَفْظُ حَدِيثِ السُّلَمِيِّ
hadithunlocked.com