If not for a decree from Allāh that preceded,1 you would have been touched for what you took by a great punishment.
Translation: Saheeh International (English)
1 Three interpretations of the "decree" are given: that by which the companions of Badr were forgiven, that by which indeliberate errors in judgement by believers are not punished, and that which made lawful the spoils of war.
لَمَسَّكُمۡsurely (would) have touched youlamassakum
فِيمَآfor whatfīmā
أَخَذۡتُمۡyou took akhadhtum
عَذَابٌa punishmentʿadhābun
عَظِيمٞgreatʿaẓīmun
Tafsir
Were it not for a decree from Allah – in which it had already been decided that He would make the gains of war lawful for you and permit you to ransom captives – a severe punishment from Allah would have afflicted you because of the gains of war and ransom you took from the captives at Badr before the coming of revelation from Allah that permitted it.