I've tried doing 
client.accept_invite("link of invite in discord.gg or url id(tried both many times)"
but It doesn't seem to work, when I put the invite code in, it tries to join, the script just keeps hanging and nothing is happening, on the other hand, every time I tried to join the invite link I needed to reconfirm the email on the account, after I reconfirm it, I try again, and again I need to confirm it, and so on.
I've read the discord API and they still have accept_invite in their documentations, I don't see why this won't work? I've tried logging into the account with token AND email+pw, both give same results. No error, just hanging +  email needs to be reconfirmed.
If anyone knows how to help, would be appreciated.
Client.accept_invite() is
 a) deprecated
b) intended for user accounts
Additionally, logging in using email+pw flags your account and could result in punishments (thats the last I heard at least)
Do not use this, instead make a bot account and ask users to invite your bot through it's oauth URL.
Each time you use an endpoint you shouldnt (like the endpoint used to login with username and password), Discord unverifies and flags your account.
client.accept_invite won't work, account tries to join but instead it just hangs