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

  • IRoomBuilder

Index

Properties

kind

kind: ROOM

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

addUsername

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

    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

getRoom

  • Gets the resulting room that has been built up to the point of calling this method. Note: modifying the returned value will have no effect.

    Returns IRoom

getSlugifiedName

  • getSlugifiedName(): string

getType

getUsernames

  • getUsernames(): 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

  • Provides a convient way to set the data for the room. Note: Providing an "id" field here will be ignored.

    Parameters

    • room: IRoom

      the room data to set

    Returns IRoomBuilder

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

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

Generated using TypeDoc