Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IRoomBuilder

Interface for building out a room. Please note, a room creator, name, and type must be set otherwise you will NOT be able to successfully save the room object.

Hierarchy

Index

Properties

kind

Methods

addCustomField

  • Adds a custom field to the room. Note: This will replace an existing field with the same key should it exist already.

    Parameters

    • key: string

      the name of the key

    • value: object

      the value of the custom field

    Returns IRoomBuilder

addMemberToBeAddedByUsername

  • addMemberToBeAddedByUsername(username: string): IRoomBuilder

addUsername

  • Adds a user to the room, these are by username until further notice.

    deprecated

    in favor of addMemberByUsername. This method will be removed on version 2.0.0

    Parameters

    • username: string

      the user's username to add to the room

    Returns IRoomBuilder

getCreator

getCustomFields

  • getCustomFields(): object

getDisplayName

  • getDisplayName(): string

getDisplayingOfSystemMessages

  • getDisplayingOfSystemMessages(): boolean

getIsDefault

  • getIsDefault(): boolean

getIsReadOnly

  • getIsReadOnly(): boolean

getMembersToBeAddedUsernames

  • getMembersToBeAddedUsernames(): Array<string>

getRoom

getSlugifiedName

  • getSlugifiedName(): string

getType

getUserIds

  • getUserIds(): Array<string>

getUsernames

  • getUsernames(): Array<string>
  • Gets the usernames of users in the room.

    deprecated

    in favor of getMembersUsernames. This method will be removed on version 2.0.0

    Returns Array<string>

setCreator

setCustomFields

  • Sets the entire custom field property to an object provided. This will overwrite every existing key/values which are unrecoverable.

    Parameters

    • fields: object

      the data to set

      • [key: string]: object

    Returns IRoomBuilder

setData

setDefault

  • Sets whether this room should be a default room or not. This means that new users will automatically join this room when they join the server.

    Parameters

    • isDefault: boolean

      room should be default or not

    Returns IRoomBuilder

setDisplayName

setDisplayingOfSystemMessages

  • setDisplayingOfSystemMessages(displaySystemMessages: boolean): IRoomBuilder
  • Sets whether this room should display the system messages (like user join, etc) or not. This means that whenever a system event, such as joining or leaving, happens then Rocket.Chat won't send the message to the channel.

    Parameters

    • displaySystemMessages: boolean

      whether the messages should display or not

    Returns IRoomBuilder

setMembersToBeAddedByUsernames

  • setMembersToBeAddedByUsernames(usernames: Array<string>): IRoomBuilder

setReadOnly

  • Sets whether this room should be in read only state or not. This means that users without the required permission to talk when a room is muted will not be able to talk but instead will only be able to read the contents of the room.

    Parameters

    • isReadOnly: boolean

      whether it should be read only or not

    Returns IRoomBuilder

setSlugifiedName

  • Sets the slugified name of this room, it must align to the rules of Rocket.Chat room names otherwise there will be an error thrown (no spaces, special characters, etc).

    Parameters

    • name: string

      the slugified name

    Returns IRoomBuilder

setType

setUsernames

  • Sets the usernames of who are joined to the room.

    deprecated

    in favor of setMembersByUsernames. This method will be removed on version 2.0.0

    Parameters

    • usernames: Array<string>

      the list of usernames

    Returns IRoomBuilder

Generated using TypeDoc