When he had stayed behind from Tabuk, Kaab said, "By Allah, Allah has never granted me a blessing, after guiding me, greater than my telling the Messenger of Allah ﷺ the truth and not lying to him, and so perishing as those who lied perished when the revelation came down, 'They will swear to you by Allah when you return to them', up to His words, 'the rebellious people'" [Tawbah 9:95–96].
حين تخلف عن تبوك: والله! ما أنعم الله على من نعمة بعد إذ هداني أعظم من صدقي رسول الله ﷺ أن لا أكون كذبته، فأهلك كما هلك الذين كذبوا حين أنزل الوحي{سيحلفون بالله لكم إذا أنقلبتم إليهم} إلى قوله {الفاسقين}.
Bukhari related it in the tafsir (4673), and Muslim in the tawba (2769), both through Ibn Shihab, who said, Abdul-Rahman bin Abdullah bin Kaab bin Malik informed me that Abdullah bin Kaab said, I heard Kaab bin Malik say, then he related it. The wording given here is Bukhari's, and Muslim's wording is longer.