Invitation without prior notice and done by bots? A BIG NO NO. To avoid those invitations to happen again, do this.
1st : Open your telegram account, go to settings
2nd : Go to Privacy and Security
3rd : Under Privacy, go to Groups then select "My Contacts" as Who can invite you to groups and channels
4th : Don't add any contacts. Just join your desired channel if you wish by getting their TG Profile link then Save.
Those invitations might be a part of bounty campaign or artificial growth of community to attract investors for selfish reasons. Leave those groups and report spam if you wish.
I agree this is the best solution to protect your account from spambots. I also forbid anyone to invite me into groups. Basically, this is a service for promoting fraudulent projects. There are a lot of such services today. And whenever bots add users to their groups, you need to think that this is a fraudulent project.