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.
In addition to all you mentioned, report such group invite to telegram as spam. You can see the report button on the top right hand once the invite opens up. This forceful invite only spells trouble and doom. I nearly fell victim in 2018 to something I view as scam now - the group needed me to send my telegram registration code to redeem a certain amount of coins. I was on the process to sending it until something told me not to. I am sure my telegram handle would've been hijacked if I had sent it.
I have disabled the ability to invite me to group or my telegrams risk will turn into a cesspool...I think that most users have long done the same, but maybe beginners will find this information useful.