GroupChannel

class GroupChannel : BaseChannel

Represents a group channel.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
enum PushTriggerOption : Enum<GroupChannel.PushTriggerOption>

The push trigger option. Refer to setMyPushTriggerOption.

Functions

Link copied to clipboard
fun acceptInvitation(handler: CompletionHandler?)
fun acceptInvitation(accessCode: String?, handler: CompletionHandler?)

Accepts the invitation sent to the current User. After the acceptance, the User will be joined to this GroupChannel.

Link copied to clipboard
fun addMessageMetaArrayValues(message: BaseMessage, metaArrays: List<MessageMetaArray>, handler: BaseMessageHandler?)

Adds message meta array values.

Link copied to clipboard
fun addOperators(userIds: Collection<String>, handler: CompletionHandler?)

Add operators to the channel. See [

Link copied to clipboard
fun addPollOption(pollId: Long, optionText: String, handler: PollHandler)

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

Link copied to clipboard
fun addReaction(message: BaseMessage, key: String, handler: ReactionHandler?)

Adds Reaction.

Link copied to clipboard
fun banUser(user: User, description: String?, seconds: Int, handler: CompletionHandler?)
fun banUser(userId: String, description: String?, seconds: Int, handler: CompletionHandler?)

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.

Link copied to clipboard
fun cancelFileMessageUpload(requestId: String): Boolean

Cancels an ongoing FileMessage upload.

Link copied to clipboard
fun cancelScheduledMessage(scheduledMessageId: Long, handler: CompletionHandler?)

Cancels a scheduled message with scheduledMessageId.

Link copied to clipboard
fun clone(): GroupChannel
Link copied to clipboard
fun closePoll(pollId: Long, handler: PollHandler)

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

Link copied to clipboard
fun copyFileMessage(targetChannel: BaseChannel, fileMessage: FileMessage, handler: FileMessageHandler?): FileMessage?

Copies a file message from this channel to the target channel.

Link copied to clipboard
fun copyUserMessage(targetChannel: BaseChannel, userMessage: UserMessage, handler: UserMessageHandler?): UserMessage?

Copies a user message from this channel to the target channel.

Link copied to clipboard
fun createBannedUserListQuery(limit: Int = QUERY_DEFAULT_LIMIT): BannedUserListQuery

Creates a query instance to get the banned user list from this channel.

Link copied to clipboard
fun createMemberListQuery(params: MemberListQueryParams): MemberListQuery

Creates a query instance to get members.

Link copied to clipboard
fun createMessageMetaArrayKeys(message: BaseMessage, metaArrayKeys: List<String>, handler: BaseMessageHandler?)

Creates message meta array keys.

Link copied to clipboard
fun createMetaCounters(metaCounterMap: Map<String, Int>, handler: MetaCounterHandler?)

Creates meta counters. This can be used to customize the channel.

Link copied to clipboard
fun createMetaData(metaDataMap: Map<String, String>, handler: MetaDataHandler?)

Creates meta data. This can be used to customize the channel.

Link copied to clipboard
fun createMutedUserListQuery(limit: Int = QUERY_DEFAULT_LIMIT): MutedUserListQuery

Creates a query instance to get the muted user (online and offline both) list of this channel.

Link copied to clipboard
fun createOperatorListQuery(limit: Int = QUERY_DEFAULT_LIMIT): OperatorListQuery

Creates a query instance to get the operator list from this channel.

Link copied to clipboard
fun createPollListQuery(limit: Int = QUERY_DEFAULT_LIMIT): PollListQuery

Creates a query instance to get the poll list from this channel.

Link copied to clipboard
fun createPollVoterListQuery(pollId: Long, pollOptionId: Long, limit: Int = QUERY_DEFAULT_LIMIT): PollVoterListQuery

Creates a query instance to get the voters of a poll option.

Link copied to clipboard

Creates previous message list query for this channel.

Link copied to clipboard
fun createScheduledFileMessage(scheduledFileMessageCreateParams: ScheduledFileMessageCreateParams, handler: FileMessageHandler?): FileMessage?

Creates a file message to be sent at the specified time.

Link copied to clipboard
fun createScheduledUserMessage(scheduledUserMessageCreateParams: ScheduledUserMessageCreateParams, handler: UserMessageHandler?): UserMessage

Creates a user message to be sent at the specified time.

Link copied to clipboard
fun declineInvitation(handler: CompletionHandler?)

Declines the invitation sent to the current User.

Link copied to clipboard
fun decreaseMetaCounters(metaCounterMap: Map<String, Int>, handler: MetaCounterHandler?)

Decreases meta counters. This decreases atomically the keyed meta counter by the specified value.

Link copied to clipboard
fun delete(handler: CompletionHandler?)

Deletes this GroupChannel. Note that only operators of a channel are able to delete it or else, an error will be returned to the handler.

Link copied to clipboard
fun deleteAllMetaCounters(handler: CompletionHandler?)

Deletes all meta counters.

Link copied to clipboard
fun deleteAllMetaData(handler: CompletionHandler?)

Deletes all meta data.

Link copied to clipboard
fun deleteMessage(message: BaseMessage, handler: CompletionHandler?)

Deletes a message.

fun deleteMessage(messageId: Long, handler: CompletionHandler?)

Deletes a message with message ID.

Link copied to clipboard
fun deleteMessageMetaArrayKeys(message: BaseMessage, metaArrayKeys: List<String>, handler: BaseMessageHandler?)

Deletes message meta array keys.

Link copied to clipboard
fun deleteMetaCounter(key: String, handler: CompletionHandler?)

Deletes a meta counter.

Link copied to clipboard
fun deleteMetaData(key: String, handler: CompletionHandler?)

Deletes a meta data.

Link copied to clipboard
fun deletePoll(pollId: Long, handler: CompletionHandler)

Deletes this poll. Once deleted successfully, a null will be passed to the handler as the error.

Link copied to clipboard
fun deletePollOption(pollId: Long, pollOptionId: Long, handler: CompletionHandler)

Deletes this poll option. Once deleted successfully, a null will be passed to the handler as error.

Link copied to clipboard
fun deleteReaction(message: BaseMessage, key: String, handler: ReactionHandler?)

Deletes Reaction.

Link copied to clipboard
fun endTyping()

Sends end typing event.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun freeze(handler: CompletionHandler?)

Freeze this GroupChannel.

Link copied to clipboard
fun getAllMetaCounters(handler: MetaCounterHandler?)

Get all meta counters.

Link copied to clipboard
fun getAllMetaData(handler: MetaDataHandler?)

Gets all meta data.

Link copied to clipboard
fun getMessageChangeLogsSinceTimestamp(ts: Long, params: MessageChangeLogsParams, handler: GetMessageChangeLogsHandler?)

Requests message change logs after given timestamp. The result is passed to handler.

Link copied to clipboard
fun getMessageChangeLogsSinceToken(token: String?, params: MessageChangeLogsParams, handler: GetMessageChangeLogsHandler?)

Requests message change logs after given token. The result is passed to handler.

Link copied to clipboard
fun getMessagesByMessageId(messageId: Long, params: MessageListParams, handler: BaseMessagesHandler?)

Retrieves previous or next messages based on the message ID in a specific channel. The result is passed to handler as list.

Link copied to clipboard
fun getMessagesByTimestamp(ts: Long, params: MessageListParams, handler: BaseMessagesHandler?)

Retrieves previous or next messages based on the timestamp in a specific channel. The result is passed to handler as list.

Link copied to clipboard
fun getMetaCounters(keys: Collection<String>, handler: MetaCounterHandler?)

Gets meta counters.

Link copied to clipboard
fun getMetaData(keys: Collection<String>, handler: MetaDataHandler?)

Gets meta data.

Link copied to clipboard
fun getMyMutedInfo(handler: MyMutedInfoHandler?)

Gets my muted information in this channel.

Link copied to clipboard
fun getMyPushTriggerOption(handler: GroupChannelGetMyPushTriggerOptionHandler?)

Gets push trigger option of this channel. Refer to GroupChannel.PushTriggerOption. For details of push trigger option, refer to setMyPushTriggerOption

Link copied to clipboard
fun getPollChangeLogsSinceTimestamp(ts: Long, handler: GetPollChangeLogsHandler?)

Requests poll change logs after given timestamp. The result is passed to handler.

Link copied to clipboard
fun getPollChangeLogsSinceToken(token: String?, handler: GetPollChangeLogsHandler?)

Requests poll change logs after given token. The result is passed to handler.

Link copied to clipboard
fun getReadMembers(message: BaseMessage, includeAllMembers: Boolean): List<Member>

Gets the member list who have read the given message.

Link copied to clipboard
fun getReadStatus(includeAllMembers: Boolean): Map<String, ReadStatus>

Gets ReadStatus for all members in this GroupChannel.

Link copied to clipboard
fun getUndeliveredMemberCount(message: BaseMessage): Int

Returns the number of member's that haven't received the given message. This excludes the current logged-in 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.

Link copied to clipboard
fun getUnreadMemberCount(message: BaseMessage): Int

Returns the number of member's that haven't read the given message. This excludes the current logged-in 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.

Link copied to clipboard
fun getUnreadMembers(message: BaseMessage, includeAllMembers: Boolean): List<Member>

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

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun hide(handler: CompletionHandler?)

Hides this channel from the current User's GroupChannel` list. When a new message is received from the channel, it appears again.

fun hide(hidePreviousMessages: Boolean, handler: CompletionHandler?)

Hides this channel from the current User's GroupChannel list. When a new message is received from the channel, it appears again.

fun hide(hidePreviousMessages: Boolean, allowAutoUnhide: Boolean, handler: CompletionHandler?)

Hides this channel from the current User's GroupChannel list.

Link copied to clipboard
fun increaseMetaCounters(metaCounterMap: Map<String, Int>, handler: MetaCounterHandler?)

Increases meta counters. This increases atomically the keyed meta counter by the specified value.

Link copied to clipboard
fun invite(userIds: List<String>, handler: CompletionHandler?)

Invites Users top this channel.

Link copied to clipboard
fun join(handler: CompletionHandler?)
fun join(accessCode: String?, handler: CompletionHandler?)

Joins this channel if this channel is public.

Link copied to clipboard
fun leave(shouldRemoveOperatorStatus: Boolean = false, handler: CompletionHandler?)

Leaves this channel.

Link copied to clipboard
fun markAsRead(handler: CompletionHandler?)

Sends mark as read to this channel with a CompletionHandler.

Link copied to clipboard
fun muteUser(user: User, handler: CompletionHandler?)
fun muteUser(userId: String, handler: CompletionHandler?)

Mutes User. Muted User's messages are no longer delivered to current User.

fun muteUser(user: User, description: String?, seconds: Int, handler: CompletionHandler?)
fun muteUser(userId: String, description: String?, seconds: Int, handler: CompletionHandler?)

Mutes User. Muted User's messages are no longer delivered to current User. If you want to mute the user indefinitely, pass -1 to seconds as the argument. Or you can use muteUser.

Link copied to clipboard
fun refresh(handler: CompletionHandler?)

Refreshes all the data of this channel.

Link copied to clipboard
fun removeAllOperators(handler: CompletionHandler?)

Remove all operators from the channel. See https://docs.sendbird.com/platform/user_type#3_operator for the explanations on the operators.

Link copied to clipboard
fun removeMessageMetaArrayValues(message: BaseMessage, metaArrays: List<MessageMetaArray>, handler: BaseMessageHandler?)

Removes message meta array values.

Link copied to clipboard
fun removeOperators(userIds: Collection<String>, handler: CompletionHandler?)

Remove operators from the channel. See [

Link copied to clipboard
fun report(reportCategory: ReportCategory, reportDescription: String?, handler: CompletionHandler?)

Reports this channel of inappropriate activities.

Link copied to clipboard
fun reportMessage(message: BaseMessage, reportCategory: ReportCategory, reportDescription: String?, handler: CompletionHandler?)

Reports a malicious message.

Link copied to clipboard
fun reportUser(offendingUser: User, reportCategory: ReportCategory, reportDescription: String?, handler: CompletionHandler?)

Reports a user of suspicious activities.

Link copied to clipboard
fun resendFileMessage(fileMessage: FileMessage, file: File?, handler: FileMessageHandler?)

Resends a file with given file information.

fun resendFileMessage(fileMessage: FileMessage, file: File?, handler: FileMessageWithProgressHandler?)

Resends a file with given file information and gets callback for uploading progress.

Link copied to clipboard
fun resendMessage(userMessage: UserMessage, handler: UserMessageHandler?): UserMessage

Resends a failed user message.

fun resendMessage(fileMessage: FileMessage, file: File?, handler: FileMessageHandler?): FileMessage?

Resends a file with given file information.

fun resendMessage(fileMessage: FileMessage, file: File?, handler: FileMessageWithProgressHandler?): FileMessage?

Resends a file with given file information and gets callback for uploading progress.

Link copied to clipboard
fun resendUserMessage(userMessage: UserMessage, handler: UserMessageHandler?)

Resends a failed user message.

Link copied to clipboard
fun resetMyHistory(handler: CompletionHandler?)

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

Link copied to clipboard
fun sendFileMessage(params: FileMessageCreateParams, handler: FileMessageHandler?): FileMessage?

Sends a file with given file information.

fun sendFileMessage(params: FileMessageCreateParams, handler: FileMessageWithProgressHandler?): FileMessage?

Sends a file with given file information and gets callback for uploading progress.

Link copied to clipboard
fun sendFileMessages(paramsList: List<FileMessageCreateParams>, handler: FileMessagesHandler?): List<FileMessage>

Sends files with given files information. The maximum number of files is 20.

fun sendFileMessages(paramsList: List<FileMessageCreateParams>, handler: FileMessagesWithProgressHandler?): List<FileMessage>

Sends files with given files information and gets callback for uploading progress. The maximum number of files is 20. This method handles FileMessageCreateParams only which have set binary file not URL.

Link copied to clipboard
fun sendScheduledMessageNow(scheduledMessageId: Long, handler: CompletionHandler?)

Sends a scheduled message now.

Link copied to clipboard
fun sendUserMessage(params: UserMessageCreateParams, handler: UserMessageHandler?): UserMessage
fun sendUserMessage(message: String, handler: UserMessageHandler?): UserMessage

Sends a user message.

Link copied to clipboard
fun serialize(): ByteArray

Serializes the GroupChannel or OpenChannel instance. This byte array can be stored in the database in your application. The instance can be restored by buildFromSerializedData.

Link copied to clipboard
fun setMyCountPreference(preference: CountPreference, handler: CompletionHandler?)

Sets my count preference for this channel.

Link copied to clipboard
fun setMyPushTriggerOption(pushTriggerOption: GroupChannel.PushTriggerOption, handler: CompletionHandler?)

Sets push trigger option of this channel. If channel's push trigger option is set to GroupChannel.PushTriggerOption.DEFAULT, it works according to the state of SendbirdChat.PushTriggerOption. If not, push messages will be triggered according to the state of GroupChannel.PushTriggerOption.

Link copied to clipboard
fun startTyping()

Sends start typing event.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun translateUserMessage(userMessage: UserMessage, targetLanguages: List<String>, handler: UserMessageHandler?)

Translates a user message.

Link copied to clipboard
fun unbanUser(user: User, handler: CompletionHandler?)
fun unbanUser(userId: String, handler: CompletionHandler?)

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

Link copied to clipboard
fun unfreeze(handler: CompletionHandler?)

Unfreeze this GroupChannel.

Link copied to clipboard
fun unhide(handler: CompletionHandler?)

Unhides this channel from the current User's GroupChannel list.

Link copied to clipboard
fun unmuteUser(user: User, handler: CompletionHandler?)
fun unmuteUser(userId: String, handler: CompletionHandler?)

Unmutes User. Unmuted User's messages are again shown to current User.

Link copied to clipboard
fun updateChannel(params: GroupChannelUpdateParams, handler: GroupChannelCallbackHandler?)

Update this channel with GroupChannelUpdateParams.

Link copied to clipboard
fun updateFileMessage(messageId: Long, params: FileMessageUpdateParams, handler: FileMessageHandler?)

Updates a FileMessage that was previously sent in the channel. Note that the file itself cannot be changed; only the fields stored within the message can be modified.

Link copied to clipboard
fun updateMetaCounters(metaCounterMap: Map<String, Int>, handler: MetaCounterHandler?)

Updates meta counters.

Link copied to clipboard
fun updateMetaData(metaDataMap: Map<String, String>, handler: MetaDataHandler?)

Updates meta data.

Link copied to clipboard
fun updatePoll(pollId: Long, params: PollUpdateParams, handler: PollHandler)

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

Link copied to clipboard
fun updatePollOption(pollId: Long, pollOptionId: Long, optionText: String, handler: PollHandler)

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

Link copied to clipboard
fun updateScheduledFileMessage(scheduledMessageId: Long, scheduledFileMessageUpdateParams: ScheduledFileMessageUpdateParams, handler: FileMessageHandler?)

Update a scheduled file message with scheduledMessageId and ScheduledFileMessageUpdateParams.

Link copied to clipboard
fun updateScheduledUserMessage(scheduledMessageId: Long, scheduledUserMessageUpdateParams: ScheduledUserMessageUpdateParams, handler: UserMessageHandler?)

Update a scheduled user message with scheduledMessageId and ScheduledUserMessageUpdateParams.

Link copied to clipboard
fun updateUserMessage(messageId: Long, params: UserMessageUpdateParams, handler: UserMessageHandler?)

Updates a UserMessage that was previously sent in the channel.

Link copied to clipboard
fun votePoll(pollId: Long, pollOptionIds: List<Long>, handler: PollVoteEventHandler)

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.

Properties

Link copied to clipboard
val cachedMetaData: Map<String, String>

All locally cached metadata as a map. Cached metadata is updated under following circumstances:

Link copied to clipboard
val channelType: ChannelType
Link copied to clipboard
var coverUrl: String

The cover image URL.

Link copied to clipboard
var createdAt: Long = 0

The creation time of the channel.

Link copied to clipboard
var creator: User? = null

The creator of this channel.

Link copied to clipboard
var customType: String? = null

The custom type of the channel. You can set custom type of this channel by createChannel or updateChannel.

Link copied to clipboard
var data: String

The channel data.

Link copied to clipboard
var hiddenState: HiddenState

The HiddenState of this channel.

Link copied to clipboard
var invitedAt: Long = 0

My invitation timestamp.

Link copied to clipboard
var inviter: User? = null

The inviter of the current User to this channel.

Link copied to clipboard
var isAccessCodeRequired: Boolean = false

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

Link copied to clipboard
var isBroadcast: Boolean = false

Checks whether this channel is a broadcast GroupChannel.

Link copied to clipboard
var isDiscoverable: Boolean = false

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

Link copied to clipboard
var 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 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.

Link copied to clipboard
var isEphemeral: Boolean = false

Whether the channel is ephemeral.

Link copied to clipboard
var isExclusive: Boolean = false

Checks whether this channel is an exclusive GroupChannel.

Link copied to clipboard
var isFrozen: Boolean = false

Whether the channel is frozen.

Link copied to clipboard
val isGroupChannel: Boolean

Whether the instance is GroupChannel type.

Link copied to clipboard
var isHidden: Boolean = false

Checks whether this channel is hidden.

Link copied to clipboard
val isOpenChannel: Boolean

Whether the instance is OpenChannel type.

Link copied to clipboard
var isPublic: Boolean = false

Checks whether this channel is a public GroupChannel.

Link copied to clipboard
var isSuper: Boolean = false

Checks whether this channel is a super GroupChannel.

Link copied to clipboard
val isTyping: Boolean

Whether one or more members are typing.

Link copied to clipboard
var joinedAt: Long = 0

The timestamp when the current user joined.

Link copied to clipboard
var joinedMemberCount: Int = 0

The total joined member count for this channel.

Link copied to clipboard
var lastMessage: BaseMessage? = null

The last message of the channel.

Link copied to clipboard
var memberCount: Int = 0

The total member count for this channel.

Link copied to clipboard
val members: List<Member>

Member list for this channel.

Link copied to clipboard
var messageOffsetTimestamp: Long = 0

This property is set when resetMyHistory and hide is called.

Link copied to clipboard
var messageSurvivalSeconds: Int = 0

The message survival seconds in this channel.

Link copied to clipboard
var myCountPreference: CountPreference

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

Link copied to clipboard
var myLastRead: Long = 0

Current user's last read receipt timestamp in channel.

Link copied to clipboard
var myMemberState: MemberState

My member state.

Link copied to clipboard
var myMutedState: MutedState

My muted state in this channel.

Link copied to clipboard
var myPushTriggerOption: GroupChannel.PushTriggerOption

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

Link copied to clipboard
var myRole: Role

My Role in this channel.

Link copied to clipboard
var name: String

The topic or name of the channel.

Link copied to clipboard
val typingUsers: List<User>

The typing user list.

Link copied to clipboard
var unreadMentionCount: Int = 0

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

Link copied to clipboard
var unreadMessageCount: Int = 0

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

Link copied to clipboard
var url: String

The unique channel URL.