Description

Represents an open channel.

Hierarchy

Properties

Accessors

Methods

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.

isEphemeral: boolean = false

Whether the channel is ephemeral.

isFrozen: boolean = false

Whether the channel is frozen.

operators: User[] = []

The operators of the channel.

participantCount: number = 0

The total number of participants in this channel.

Accessors

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

    Returns object

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

    Returns number

  • 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

    • userIds: string[]

    Returns Promise<void>

    Description

    Add operators to the channel.

  • Parameters

    • pollId: number
    • optionText: string

    Returns Promise<Poll>

    Description

    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
    • Optional duration: number
    • Optional description: string

    Returns Promise<void>

    Description

    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
    • Optional duration: number
    • Optional description: string

    Returns Promise<void>

    Description

    Bans a member with userId.

  • Parameters

    • pollId: number

    Returns Promise<Poll>

    Description

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

  • Returns Promise<void>

    Description

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

  • Parameters

    • key: string

    Returns Promise<void>

    Description

    Deletes a meta counter.

  • Parameters

    • key: string

    Returns Promise<void>

    Description

    Deletes a meta data.

  • Parameters

    • pollId: number

    Returns Promise<void>

    Description

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

  • Parameters

    • pollId: number
    • pollOptionId: number

    Returns Promise<void>

    Description

    Deletes this poll option.

  • Returns Promise<void>

    Description

    Enters this channel. The current User becomes a participant of this channel.

  • Returns Promise<void>

    Description

    Exits from this channel. The current User is no longer a participant of this channel.

  • Returns Promise<void>

    Description

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

  • Parameters

    Returns boolean

    Description

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

  • Parameters

    Returns boolean

    Description

    Whether the given channel is identical to this channel.

  • Parameters

    • userOrUserId: string | User

    Returns boolean

    Description

    Checks if the given User is an operator of this channel.

  • Parameters

    • user: User
    • Optional duration: number
    • Optional description: string

    Returns Promise<void>

    Description

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

  • Parameters

    • userId: string
    • Optional duration: number
    • Optional description: string

    Returns Promise<void>

    Description

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

  • Returns Promise<OpenChannel>

    Description

    Refreshes all the data of this channel.

  • Parameters

    • userIds: string[]

    Returns Promise<void>

    Description

    Remove operators from the channel.

  • Parameters

    Returns Promise<void>

    Description

    Reports this channel of inappropriate activities.

  • Parameters

    Returns Promise<void>

    Description

    Reports a user of suspicious activities.

  • Parameters

    Returns Promise<void>

    Description

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

  • Parameters

    • userId: string

    Returns Promise<void>

    Description

    Unbans User with userId.

  • Returns Promise<void>

    Description

    Unfreezes the channel.

  • Parameters

    Returns Promise<void>

    Description

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

  • Parameters

    • userId: string

    Returns Promise<void>

    Description

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

  • Parameters

    • name: string
    • coverUrlOrImage: string | FileCompat
    • data: string
    • operatorUserIds: string[]
    • customType: string

    Returns Promise<OpenChannel>

    Deprecated

    Description

    Update this channel with given parameters.

  • Parameters

    Returns Promise<FileMessage>

    Description

    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.

  • Parameters

    Returns Promise<Poll>

    Description

    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>

    Description

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

  • Parameters

    • pollId: number
    • pollOptionIds: number[]

    Returns Promise<PollVoteEvent>

    Description

    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.

Generated using TypeDoc