My suggestion is to add <context.invite> to on discord user joins:
<context.invite> will return code of the invite, and if bot on the server this invite was used aaaaand bot has permission MANAGE_SERVER, it can read:
- Code of invite
- Uses of invite
- How long until invite is expired
- Who made the invite
I guess there is needed new inviteObject
I know that you can make this stuff with webget, but it will be a hell of a work to parse through all invites on the server and see which one is being used at the moment by user that joined, especially since you can only see uses, not WHO used it