Narrated Ibn 'Abbas:
"When the Messenger of Allah (ﷺ) was finished at Badr, it was said to him: 'You have to get the caravan, you can not settle for less than that.' Al-'Abbas called out while he was bound up: 'There is no use.' He said: 'For Allah, Most High, has promised you one of the two parties, and He gave you what He promised you.' He said: 'He has said the truth.'"
English reference: Vol. 5, Book 44, Hadith 3080
Arabic reference: Book 47, Hadith 3360