I'm trying to give role to a member after inviting 2 members to the server or have 2 or more invite uses, I'm uncertain if I used the correct event
-
on_ready()
will only execute on bot startup. What you want is probablyon_member_join(member)
. - You can't get the invite by doing
member.invite
, asdiscord.Member
objects does not provide it. -
Member.add_roles()
takes a list of roles, not a single role.
A solution to your problem could be to register each invite in a dict, then compare each of them when a member joins.