Class Group<ContentTypes>

Type Parameters

  • ContentTypes extends DefaultContentTypes = DefaultContentTypes

Implements

Constructors

Properties

addedByInboxId: InboxId
createdAt: number
description: string
imageUrlSquare: string
isGroupActive: boolean
name: string
version: GROUP = ...

Methods

  • Parameters

    Returns Promise<void>

    A Promise that resolves when the inboxId is added to the group admins. Will throw if the user does not have the required permissions.

  • Parameters

    • addresses: string[]

      addresses to add to the group

    Returns Promise<void>

  • Parameters

    • inboxIds: InboxId[]

      inboxIds to add to the group

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

    A Promise that resolves when the inboxId is added to the group super admins. Will throw if the user does not have the required permissions.

  • This method returns a inbox id associated with the creator of the group.

    Returns Promise<InboxId>

    A Promise that resolves to a InboxId.

  • Returns the group description. To get the latest group description from the network, call sync() first.

    Returns Promise<string>

    A Promise that resolves to the group description.

  • Returns the group image url square. To get the latest group image url square from the network, call sync() first.

    Returns Promise<string>

    A Promise that resolves to the group name.

  • Returns the group name. To get the latest group name from the network, call sync() first.

    Returns Promise<string>

    A Promise that resolves to the group name.

  • Returns the group pinned frame. To get the latest group pinned frame url from the network, call sync() first.

    Returns Promise<string>

    A Promise that resolves to the group pinned frame url.

  • Returns whether the group is active. To get the latest active status from the network, call sync() first

    Returns Promise<boolean>

    A Promise that resolves if the group is active or not

  • Parameters

    Returns Promise<boolean>

    whether a given inboxId is an admin of the group. To get the latest admin status from the network, call sync() first.

  • Parameters

    Returns Promise<boolean>

    whether a given inboxId is a super admin of the group. To get the latest super admin status from the network, call sync() first.

  • Returns Promise<InboxId[]>

    A Promise that resolves to an array of inboxIds that are admins of the group. To get the latest admin list from the network, call sync() first.

  • Returns Promise<InboxId[]>

    A Promise that resolves to an array of inboxIds that are super admins of the group. To get the latest super admin list from the network, call sync() first.

  • This method returns an array of inbox ids associated with the group. To get the latest member inbox ids from the network, call sync() first.

    Returns Promise<InboxId[]>

    A Promise that resolves to an array of InboxId objects.

  • Returns Promise<Member[]>

    A Promise that resolves to an array of Member objects. To get the latest member list from the network, call sync() first.

  • This method returns an array of messages associated with the group. To get the latest messages from the network, call sync() first.

    Parameters

    • Optional opts: MessagesOptions

    Returns Promise<DecodedMessage<ContentTypes>[]>

    A Promise that resolves to an array of DecodedMessage objects.

  • Returns Promise<PermissionPolicySet>

    A {PermissionPolicySet} object representing the group's permission policy set.

  • Prepare a group message to be sent.

    Type Parameters

    Parameters

    • content: ConversationSendPayload<SendContentTypes>

      The content of the message. It can be either a string or a structured MessageContent object.

    Returns Promise<string>

    A Promise that resolves to a string identifier for the prepared message to be sent.

    Throws

    Throws an error if there is an issue with sending the message.

  • Publish all prepared messages.

    Returns Promise<any>

    Throws

    Throws an error if there is an issue finding the unpublished message

  • Parameters

    Returns Promise<void>

    A Promise that resolves when the inboxId is removed from the group admins. Will throw if the user does not have the required permissions.

  • Parameters

    • addresses: string[]

      addresses to remove from the group

    Returns Promise<void>

  • Parameters

    • inboxIds: InboxId[]

      inboxIds to remove from the group

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

    A Promise that resolves when the inboxId is removed from the group super admins. Will throw if the user does not have the required permissions.

  • Sends a message to the current group.

    Type Parameters

    Parameters

    • content: ConversationSendPayload<SendContentTypes>

      The content of the message. It can be either a string or a structured MessageContent object.

    Returns Promise<MessageId>

    A Promise that resolves to a string identifier for the sent message.

    Throws

    Throws an error if there is an issue with sending the message.

  • Sets up a real-time message stream for the current group.

    This method subscribes to incoming messages in real-time and listens for new message events. When a new message is detected, the provided callback function is invoked with the details of the message. Additionally, this method returns a function that can be called to unsubscribe and end the message stream.

    Parameters

    • callback: ((message) => Promise<void>)

      A callback function that will be invoked with the new DecodedMessage when a message is received.

    Returns Promise<(() => void)>

    A function that, when called, unsubscribes from the message stream and ends real-time updates.

  • Executes a network request to fetch the latest messages and membership changes associated with the group and saves them to the local state.

    Returns Promise<void>

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the addAdmin permission is updated for the group. Will throw if the user does not have the required permissions.

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the addMember permission is updated for the group. Will throw if the user does not have the required permissions.

  • Parameters

    Returns Promise<void>

  • Updates the group description. Will throw if the user does not have the required permissions.

    Parameters

    • description: string

      new group description

    Returns Promise<void>

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the groupDescription permission is updated for the group. Will throw if the user does not have the required permissions.

  • Updates the group image url square. Will throw if the user does not have the required permissions.

    Parameters

    • imageUrlSquare: string

      new group profile image url

    Returns Promise<void>

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the groupImageUrlSquare permission is updated for the group. Will throw if the user does not have the required permissions.

  • Updates the group name. Will throw if the user does not have the required permissions.

    Parameters

    • groupName: string

      new group name

    Returns Promise<void>

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the groupName permission is updated for the group. Will throw if the user does not have the required permissions.

  • Updates the group pinned frame url. Will throw if the user does not have the required permissions.

    Parameters

    • pinnedFrameUrl: string

      new group pinned frame url

    Returns Promise<void>

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the groupPinnedFrameUrl permission is updated for the group. Will throw if the user does not have the required permissions.

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the removeAdmin permission is updated for the group. Will throw if the user does not have the required permissions.

  • Parameters

    • permissionOption: PermissionUpdateOption

    Returns Promise<void>

    A Promise that resolves when the removeMember permission is updated for the group. Will throw if the user does not have the required permissions.

Generated using TypeDoc