The Messenger of Allah ﷺ used to say, "No one is to be lashed more than ten lashes except for one of the prescribed punishments set by Allah ."
أخبرنا قتيبة بن سعيد حدثنا الليث عن يزيد بن أبي حبيب عن بكير بن عبد الله بن الأشج عن سليمان بن يسار عن عبد الرحمن بن جابر بن عبد الله
أن رسول الله ﷺ كان يقول لا يجلد فوق عشر جلدات إلا في حد من حدود الله عز وجل
Bukhari narrated it in the Book of Legal Punishments, chapter "How Many Lashes for Disciplinary Punishment?", no. 6848, from the hadith of Layth bin Saad, and Muslim narrated it in the Book of Legal Punishments, chapter "The Number of Lashes for Disciplinary Punishment", no. 1708, from the hadith of Bukayr bin Abdullah, through the same chain.