Go-whatsapp: How do I get the Participant properties? Creator, admin, participant...

Created on 3 Jun 2020  路  10Comments  路  Source: Rhymen/go-whatsapp

Hello. I wanted to get the participant properties. I tried to get the participant ID (not the RemoteJid but the SenderJid) and I got an error but I found out how to get the participant ID, but now I wanted to get the participant's properties, like, I want to know whether a participant is an admin or not.
Could somebody please help me?

Thank you in advance.

Most helpful comment

What do you mean participants in group? Check group.go, there is GetMetadata function.

@ramacatur I mean how can I identify whether a participant is an admin, or a regular member? Thank you for your reply.
I have tried contacts.go and store.go. but I can't find anything related to this. I noticed the the file token.go has these properties but I don't know how to get them.

I'm using these to get the participant ID but I would like to know how I get its "properties"

message.Info.Source.GetParticipant()
message.ContextInfo.Participant

May be try use function GetGroupMetaData in group.go and you will get json data participants. In data participants, you will found IsAdmin and IsSuperAdmin in bool type.

All 10 comments

@tguimmaraess send me an email : [email protected]

What do you mean participants in group? Check group.go, there is GetMetadata function.

What do you mean participants in group? Check group.go, there is GetMetadata function.

@ramacatur I mean how can I identify whether a participant is an admin, or a regular member? Thank you for your reply.
I have tried contacts.go and store.go. but I can't find anything related to this. I noticed the the file token.go has these properties but I don't know how to get them.

I'm using these to get the participant ID but I would like to know how I get its "properties"

message.Info.Source.GetParticipant()
message.ContextInfo.Participant

This is from incoming message group?

This is from incoming message group?

Yes. I just need to know what participant is an admin. I don't know how I do it.
Is there any way like message.Info.Source.GetParticipant().IsAdmin() or something or proto.GetParticipant.GetKey().Type

What do you mean participants in group? Check group.go, there is GetMetadata function.

@ramacatur I mean how can I identify whether a participant is an admin, or a regular member? Thank you for your reply.
I have tried contacts.go and store.go. but I can't find anything related to this. I noticed the the file token.go has these properties but I don't know how to get them.

I'm using these to get the participant ID but I would like to know how I get its "properties"

message.Info.Source.GetParticipant()
message.ContextInfo.Participant

May be try use function GetGroupMetaData in group.go and you will get json data participants. In data participants, you will found IsAdmin and IsSuperAdmin in bool type.

What do you mean participants in group? Check group.go, there is GetMetadata function.

@ramacatur I mean how can I identify whether a participant is an admin, or a regular member? Thank you for your reply.
I have tried contacts.go and store.go. but I can't find anything related to this. I noticed the the file token.go has these properties but I don't know how to get them.
I'm using these to get the participant ID but I would like to know how I get its "properties"

message.Info.Source.GetParticipant()
message.ContextInfo.Participant

May be try use function GetGroupMetaData in group.go and you will get json data participants. In data participants, you will found IsAdmin and IsSuperAdmin in bool type.

Oh thank you very much. That's what I needed to know! Thank you.

gambar
i try do this but ended getting this..
gambar

gambar
i try do this but ended getting this..
gambar

It is output pointer. You can use fmt.Println(*gmeta)

gambar
i try do this but ended getting this..
gambar

It's a chan so use <-gmta

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jhow2892 picture jhow2892  路  3Comments

anton-rs picture anton-rs  路  10Comments

denislee picture denislee  路  6Comments

highness28 picture highness28  路  5Comments

Valdenirmezadri picture Valdenirmezadri  路  7Comments