Your computer was not hacked, but apparently, you have in the past received several invitations to join these spam groups. As far as I remember, this was happening when Skype was still active, but these groups might have been migrated to Teams.
If you install Teams, and see these groups, you can then delete these groups.