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.