Well since the early 18th Century (in a limited way) copyright rights have been given to creators - the overwhelming majority of countries are signatories to international treaties (for the last 100 years) that give creators control of created artistic works (which has been deemed to include program code).
Exploitation of those rights is down to individuals, only since Google came on the scene has any company been able to get away with broad ranging infringement of these rights without censure.
As for your cheque, you have the right to sell your work. No-one is obliged to buy it, of course. You also, under copyright, have the right to make a license to exchange use of your works for binding the users to conditions of release of their derivative/associated works ([F]OSS licensing).
You still have the right to sell it, and if ML models have been trained on those works you have the right to seek compensation.