Answer:
Praise be to Allah, the Lord of the Worlds; and blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Nobody should play with such words and expressions which can result in legal Islamic rulings, that are binding. Allah Says (interpretation of meaning): {And treat not the Verses (Laws) of Allâh as a jest,}[2:231].
The Ayat verses of Allah are His rules and verdicts the Halal the Haram, the orders and restraints. The verdicts concerning marriage and divorce are part of these Ayat.
The interpreters of Qur'an say that this verse was revealed about the person who divorces then says I was joking or who frees a slave or marries a woman and then says: "I was joking".
So, we advise you to repent to Allah and never go back to this kind of saying it could lead to consequences that you did not imagine.
As for the divorce it is invalid because you only promised with something that could be understood as Talaq (divorce). So divorce is valid only if he says it expressingly.
Allah knows best.