He said, "I pledged allegiance to the Prophet ﷺ to listen and obey, and he prompted me to add, 'as far as I am able, and to give sincere counsel to every Muslim.'"In another wording, "I pledged allegiance to the Messenger of Allah to establish the prayer, to give the zakat, to give sincere counsel to every Muslim, and to dissociate from the polytheist."
قال بايعت النبي ﷺ على السمع والطاعة فلقنني: فيما استطعت، والنصح لكل مسلم. وفي لفظ: بايعت رسول الله على إقام الصلاة، وإيتاء الزكاة، والنصح لكل مسلم، وعلى فراق المشرك.
Bukhari narrated it in the Book of Rulings (7204), and Muslim in the Book of Faith (56:99), from Yaqub bin Ibrahim Dawraqi (Muslim added others besides him), from Hushaym, who said, Sayyar informed us, from Shaybi, from Jareer bin Abdullah, and he related it.The second wording was narrated by Nasai (4175) and Ahmad (19162) through the route of Muhammad bin Jafar, from Shubah, from Sulayman (that is, Amash), from Abu Waail, from Jareer, and he related it. Its chain of transmission is sahih.