bannedMembersList in addMembersToGroup is not optional

According to the TypeScript definition the bannedMembersList argument of the addMembersToGroup call is optional. But if you don’t pass that argument, you’ll get an error.

export function addMembersToGroup(guid: string, groupMembers: Array<GroupMember>, bannedMembersList?: Array<string>): Promise<Object>;

Hello @Thijs,

Can you please try sending an empty array instead?

Warm Regards,

CometChat Pro
Mayur Bhandari

1 Like

Yes, that does work. But that means that the argument is not optional, so the TypeScript definition is wrong

Hello @Thijs,

Yeah it does look wrong. I will get this checked and will be fixed in the next release. Thank you for reporting.

Warm Regards,

CometChat Pro
Mayur Bhandari

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Hello @Thijs,

In the latest release v2.1.2 we have fixed this issue. The type definition has been updated and it is a mandatory parameter. You can pass null if you do not wish to ban member from the group.

Warm Regards,

CometChat Pro
Mayur Bhandari

1 Like