The Prophet ﷺ said, "Whoever swears an oath and says in it, 'By al-Lat and al-Uzza,' let him say, 'There is no god but Allah.' And whoever says to his companion, 'Come, let me gamble with you,' let him give in charity."
عن النبي ﷺ قال: من حلف، فقال في حلفه: باللات والعزى، فليقل: لا إله إلا الله، ومن قال لصاحبه: تعال أقامرك، فليتصدق.
Bukhari narrated it in the Book of Oaths and Vows (6650), and Muslim narrated it in the Book of Oaths and Vows (1647), both through Zuhri, from Humayd bin Abdul-Rahman, from Abu Hurairah, who mentioned it.