Home / @sym20/core-conversations / IConversationStore / addMember

IConversationStore.addMember() method

Add a member to a conversation

Signature
addMember(conversationId: ConversationId, userId: UserId, init: Partial<IMemberCreate>): Promise<IMember>;

Remarks

The current user must be a member of the conversation to be able to add another member, and unless the membersCanAddUsers setting is true, the current user must also be an owner.

Parameters

ParameterTypeDescription
conversationIdConversationId

The conversation to add a member to

userIdUserId

The user to add to the conversation

initPartial<IMemberCreate>

Initial settings for the member. Any setting that is not included will have default values.

Returns

TypeDescription
Promise<IMember>

The member object

Throws

Error

ConversationNotFound

UserNotFound

UserNotEntitled

TooManyMembersInConversation

InactiveMembersInConversation

InformationBarrierViolation

UserConnectionMissing

BannedUser

UserInactive

ConversationInactive

NotARoom