Represents a group channel.

Hierarchy (view full)

Properties

Accessors

Methods

acceptInvitation addMessageMetaArrayValues addOperators addPollOption addReaction banUser banUserWithUserId cancelScheduledMessage cancelUploadingFileMessage closePoll copyFileMessage copyMessage copyUserMessage createBannedUserListQuery createMemberListQuery createMessageCollection createMessageMetaArrayKeys createMetaCounters createMetaData createMutedUserListQuery createOperatorListQuery createPinnedMessageListQuery createPollListQuery createPollVoterListQuery createPreviousMessageListQuery createScheduledFileMessage createScheduledUserMessage createThreadedParentMessageListQuery declineInvitation decreaseMetaCounters delete deleteAllMetaCounters deleteAllMetaData deleteMessage deleteMessageMetaArrayKeys deleteMetaCounter deleteMetaData deletePoll deletePollOption deleteReaction endTyping freeze getAllMetaCounters getAllMetaData getDeliveryStatus getMessageChangeLogsSinceTimestamp getMessageChangeLogsSinceToken getMessagesByMessageId getMessagesByTimestamp getMetaCounters getMetaData getMyMutedInfo getMyPushTriggerOption getPollChangeLogsSinceTimestamp getPollChangeLogsSinceToken getReadMembers getReadStatus getTypingUsers getUndeliveredMemberCount getUnreadMemberCount getUnreadMembers hide increaseMetaCounters invite inviteWithUserIds isEqual isFeedChannel isGroupChannel isIdentical isOpenChannel isReadMessage join leave markAsDelivered markAsRead muteUser muteUserWithUserId pinMessage refresh removeMessageMetaArrayValues removeOperators report reportMessage reportUser resendFileMessage resendMessage resendUserMessage resetMyHistory sendFileMessage sendFileMessages sendMultipleFilesMessage sendScheduledMessageNow sendUserMessage serialize setMyCountPreference setMyPushTriggerOption startTyping translateUserMessage unbanUser unbanUserWithUserId unfreeze unhide unmuteUser unmuteUserWithUserId unpinMessage updateChannel updateFileMessage updateMetaCounters updateMetaData updatePoll updatePollOption updateScheduledFileMessage updateScheduledUserMessage updateUserMessage uploadFile votePoll

Properties

channelType: ChannelType = ChannelType.BASE
coverUrl: string = ''

The cover image URL.

creator: null | User = null

A User who created the channel. null if it's created by system.

customType: string = ''

The custom type of the channel.

data: string = ''

The channel data.

hiddenState: HiddenState = HiddenState.UNHIDDEN

The HiddenState of this channel.

invitedAt: number = 0

My invitation timestamp.

inviter: null | User = null

The inviter of the current user to this channel.

isAccessCodeRequired: boolean = false

Whether this channel requires access code to join. This value is valid only if this channel is a public GroupChannel.

isBroadcast: boolean = false

Checks whether this channel is a broadcast GroupChannel.

isChatNotification: boolean = false

Checks whether this channel is a chat notification GroupChannel.

isDiscoverable: boolean = true

Checks whether this channel is discoverable in the result of PublicGroupChannelListQuery. If it is false, it will not appear on the result of PublicGroupChannelListQuery.

isDistinct: boolean = false

Checks whether this channel is a distinct GroupChannel. For a distinct GroupChannel, later when you create GroupChannel with same User and isDistinct flag being true (refer to GroupChannelModule.createChannel), the channel URL does not change, which means the messages between Users remain at the channel. If the channel is not distinct one, a new GroupChannel is created even though Users are same. As a result, you get a totally new channel URL (the old channel still remains), which means the Users start new conversation.

isEphemeral: boolean = false

Whether the channel is ephemeral.

isExclusive: boolean = false

Checks whether this channel is an exclusive GroupChannel.

isFrozen: boolean = false

Whether the channel is frozen.

isPublic: boolean = false

Checks whether this channel is a public GroupChannel.

isPushEnabled: boolean = false
isSuper: boolean = false

Checks whether this channel is a super GroupChannel.

joinedAt: number = 0

The timestamp when the current user joined.

joinedMemberCount: number = 0

The total joined member count for this channel.

lastMessage: null | BaseMessage = null

The last message of the channel.

lastPinnedMessage: null | BaseMessage = null

The last message among channel's pinned messages.

memberCount: number = 0

The total member count for this channel.

members: Member[] = []

Member list for this channel.

messageOffsetTimestamp: number = 0

This property is set when GroupChannel.resetMyHistory or GroupChannel.hide is called.

myCountPreference: CountPreference = CountPreference.ALL

Checks whether unread message count is enabled for this channel. This count preference can be set by GroupChannel.setMyCountPreference.

myLastRead: number = 0

Current user's last read receipt timestamp in channel.

myMemberState: MemberState = MemberState.NONE

My member state.

myMutedState: MutedState = MutedState.UNMUTED

My muted state in this channel.

myPushTriggerOption: PushTriggerOption = PushTriggerOption.DEFAULT

My push trigger option. The push trigger setting can be updated by GroupChannel.setMyPushTriggerOption.

myRole: Role = Role.NONE

My Role in this channel.

pinnedMessageIds: number[] = []

The pinned message IDs of the channel.

totalUnreadReplyCount: number = 0

The total unread reply count for this channel.

unreadMentionCount: number = 0

The unread mention count for this channel for the current user.

unreadMessageCount: number = 0

The unread message count for this channel for the current user.

Accessors

  • get cachedMetaData(): object
  • All locally cached metadata as a map.

    Returns object

  • get cachedUndeliveredMemberState(): object
  • Snapshot of member delivery state map.

    Returns object

  • get cachedUnreadMemberState(): object
  • Snapshot of member reading state map.

    Returns object

  • get createdAt(): number
  • The creation time of the channel in milliseconds.

    Returns number

  • get hasAiBot(): boolean
  • Indicates whether this channel includes any AI bots.

    Returns boolean

  • get hasBot(): boolean
  • Indicates whether this channel includes any bots

    Returns boolean

  • get isHidden(): boolean
  • Checks whether this channel is hidden.

    Returns boolean

  • get isTyping(): boolean
  • Whether one or more members are typing.

    Returns boolean

  • get messageCollectionLastAccessedAt(): number
  • The local timestamp of when this channel has been used in a MessageCollection.

    Returns number

  • get name(): string
  • The topic or name of the channel.

    Returns string

  • set name(value): void
  • Parameters

    • value: string

    Returns void

  • get url(): string
  • The unique channel URL.

    Returns string

Methods

  • Parameters

    • OptionalaccessCode: string

    Returns Promise<GroupChannel>

    Accepts the invitation sent to the current user. After the acceptance, the user will be joined to the channel.

  • Parameters

    • userIds: string[]

    Returns Promise<void>

    Add operators to the channel.

  • Parameters

    • pollId: number
    • optionText: string

    Returns Promise<Poll>

    Adds an option with optionText to this poll. Once added successfully, a non-null Poll instance will be passed to the result.

  • Parameters

    • user: User
    • Optionalduration: number
    • Optionaldescription: string

    Returns Promise<void>

    Bans a member. Operators can ban members from this channel. Banned member is kicked out of this channel and cannot enter during the specified seconds. If you want to ban the user indefinitely, pass -1 to seconds as the argument.

  • Parameters

    • userId: string
    • Optionalduration: number
    • Optionaldescription: string

    Returns Promise<void>

    Bans a member with userId.

  • Parameters

    • scheduledMessageId: number

    Returns Promise<void>

    Cancels a scheduled message with scheduledMessageId.

  • Parameters

    • pollId: number

    Returns Promise<Poll>

    Closes this poll. Once closed successfully, a non-null Poll instance will be passed to the result.

  • Returns Promise<GroupChannel>

    Declines the invitation sent to the current user.

  • Returns Promise<void>

    Deletes this GroupChannel. Note that only operators of a channel are able to delete it. Otherwise, an error will be thrown.

  • Parameters

    • key: string

    Returns Promise<void>

    Deletes a meta counter.

  • Parameters

    • key: string

    Returns Promise<void>

    Deletes a meta data.

  • Parameters

    • pollId: number

    Returns Promise<void>

    Deletes this poll. Once deleted successfully, null will be passed to the result.

  • Parameters

    • pollId: number
    • pollOptionId: number

    Returns Promise<void>

    Deletes this poll option.

  • Returns Promise<void>

    Sends end typing event.

  • Returns Promise<void>

    Freezes the channel. No one could send a message in a frozen channel.

  • Parameters

    • includeAllMembers: boolean = true

    Returns null | {
        [key: string]: DeliveryStatus;
    }

    Gets delivered time for all members in this channel.

  • Parameters

    Returns Member[]

    Gets the member list who have read the given message.

  • Parameters

    • includeAllMembers: boolean = false

    Returns null | {
        [key: string]: ReadStatus;
    }

    Gets ReadStatus for all members in this channel.

  • Returns Member[]

    The typing user list.

  • Parameters

    Returns number

    Returns the number of member's that haven't received the given message. This excludes the current user and the Sender of the message. It will always be zero if the passed on message is an AdminMessage, or if this channel is a super group channel.

  • Parameters

    Returns number

    Returns the number of member's that haven't read the given message. This excludes the current user and the Sender of the message. It will always be zero if the passed on message is an AdminMessage, or if this channel is a super group channel.

  • Parameters

    Returns Member[]

    Gets the member list who haven't read the given message.

  • Parameters

    • userIds: string[]

    Returns Promise<GroupChannel>

    Invites Users with userIds.

  • Parameters

    Returns boolean

    Whether the given channel is equal in all the values of this channel.

  • Parameters

    Returns boolean

    Whether the given channel is identical to this channel.

  • Parameters

    Returns boolean

    Checks if the current user has read the message.

  • Parameters

    • OptionalaccessCode: string

    Returns Promise<GroupChannel>

    Joins this channel if this channel is public.

  • Parameters

    • shouldRemoveOperatorStatus: boolean = false

    Returns Promise<void>

    Leaves this channel.

  • Returns Promise<void>

    Sends mark as delivered to this channel.

  • Returns Promise<void>

    Sends mark as read to this channel.

  • Parameters

    • user: User
    • Optionalduration: number
    • Optionaldescription: string

    Returns Promise<void>

    Mutes a User. A muted user cannot send a message.

  • Parameters

    • userId: string
    • Optionalduration: number
    • Optionaldescription: string

    Returns Promise<void>

    Mutes a User with userId. A muted user cannot send a message.

  • Parameters

    • messageId: number

    Returns Promise<void>

    Pins a message to the channel.

  • Parameters

    • userIds: string[]

    Returns Promise<void>

    Remove operators from the channel.

  • Parameters

    Returns Promise<void>

    Reports this channel of inappropriate activities.

  • Parameters

    Returns Promise<void>

    Reports a user of suspicious activities.

  • Returns Promise<GroupChannel>

    Resets the chat history of this channel for the current user. After this call, the messages created before the call will not be loaded.

  • Parameters

    • scheduledMessageId: number

    Returns Promise<void>

    Sends a scheduled message now.

  • Returns Promise<void>

    Sends start typing event.

  • Parameters

    Returns Promise<void>

    Unbans User. Operators can unban User who has been banned from this channel.

  • Returns Promise<void>

    Unfreezes the channel.

  • Parameters

    Returns Promise<void>

    Unmutes User. The unmuted user could send a message again.

  • Parameters

    • userId: string

    Returns Promise<void>

    Unmutes User with userId. The unmuted user could send a message again.

  • Parameters

    • messageId: number

    Returns Promise<void>

    Removes the message from the channel's pinned messages.

  • Parameters

    Returns Promise<Poll>

    Updates fields of this poll with given params. Once updated successfully, a non-null Poll instance will be passed to the result.

  • Parameters

    • pollId: number
    • pollOptionId: number
    • optionText: string

    Returns Promise<Poll>

    Updates optionText fields of this poll option. Once updated successfully, a non-null Poll instance will be passed to the result.

  • Parameters

    Returns Promise<FileMessage>

    Update a scheduled file message with scheduledMessageId and ScheduledFileMessageUpdateParams.

  • Parameters

    Returns Promise<UserMessage>

    Update a scheduled user message with scheduledMessageId and ScheduledUserMessageUpdateParams.

  • Parameters

    • pollId: number
    • pollOptionIds: number[]

    Returns Promise<PollVoteEvent>

    Vote on pollOptionIds. This operation overrides previous vote actions, so to update previous vote, pass new pollOptionIds as parameter. To cancel votes, pass an empty list as pollOptionIds.