Closed bobbyJame closed 3 years ago
If the group is in your roster, I think the list of members should be there. You can see all the information in the Group object. Try something like:
def on_roster_received(self, response: FetchRosterResponse):
for peer in response.peers:
if isinstance(peer, Group):
group_members = peer.members
You can also you the is_admin
property.
ON ifinstance(peer, Group) I get error 'Group' is not defined
With is_admin I just receive 'User' object has no attribute 'is_admin'.
I need to check if the member sending the message is admin.
So I have managed to get it to print out the members and whether they're admin but it looks like this: <kik_unofficial.datatypes.peers.GroupMember object at 0x7fac8841c460> is admin
my code: for peer in response.peers: if str(peer).startswith("Group("): for member in peer.members: print(member) if member.is_admin == True: print(member, "is admin")
What's the problem with that? You seem successful
How can I retrieve the jid of the member instead of <kik_unofficial.datatypes.peers.GroupMember object at 0x7fac8841c460>
It is only showing object locations when I iterate through the members field
member.jid
Ok got it now. Thank you very much.
This isn't really an issue but I am wondering if you know of a way to list members of a group and check admin statuses of members, I've looked at some of the closed issues and don't seem to be getting anywhere.
If you have an example for listing group members or checking member admin status, it would be greatly appreciated.