Abdullah bin Umar reported,

When the Messenger of Allah ﷺ besieged Taif and gained nothing from them, he said, "We will return home, Allah willing." This was difficult for the Companions, and they said, "Shall we leave without conquering it?" He said another time, "We will withdraw."Then he said, "Set out tomorrow for battle." They went out and suffered wounds.He then said, "We will return home tomorrow, Allah willing." This pleased them, and the Prophet ﷺ laughed.Sufyan once said, "He smiled."Humaydi said, Sufyan narrated to us the entire report.

Bukhari 4325

Sahih

حدثنا علي بن عبد الله حدثنا سفيان عن عمرو عن أبي العباس الشاعر الأعمى

عن عبد الله بن عمر قال

لما حاصر رسول الله ﷺ الطائف فلم ينل منهم شيئا قال إنا قافلون إن شاء الله فثقل عليهم وقالوا نذهب ولا نفتحه وقال مرة نقفل فقال اغدوا على القتال فغدوا فأصابهم جراح فقال إنا قافلون غدا إن شاء الله فأعجبهم فضحك النبي ﷺ وقال سفيان مرة فتبسم قال قال الحميدي حدثنا سفيان الخبر كله

البخاري 4325صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Expedition of Taif in Shawwal, year eight
Numbering
Darussalam 4325
Bukhari 4325