Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Room

The room class.

param

The client.

param

The room.

Hierarchy

  • Room

Index

Constructors

constructor

Properties

client

client: Client

The client that instantiated the room.

creatorId

creatorId: string

The id of the creator.

deafs

deafs: Record<string, boolean>

The list of deafened users.

description

description: null | string

The description of the room.

id

id: string

The id of the room.

insertedAt

insertedAt: string

The time the room was inserted.

isPrivate

isPrivate: boolean

If the room is private.

mutes

mutes: Record<string, boolean>

The list of muted users.

name

name: string

The name of the room.

peopleCount

peopleCount: number

The number of people in the room.

peoplePreviewList

peoplePreviewList: PeoplePreview

The preview of the people in the room.

users

users: Collection<string, User>

The list of users in the room.

voiceServerId

voiceServerId: string

The voice server id of the room.

Methods

Private _setUsers

  • _setUsers(): Promise<void>

addSpeaker

  • addSpeaker(userId: string): Promise<void>
  • Adds a speaker to the room.

    Parameters

    • userId: string

      The id of the user.

    Returns Promise<void>

askToSpeak

  • askToSpeak(): void

ban

  • ban(userId: string, shouldBanIp?: boolean): void
  • Bans a user from the room.

    Parameters

    • userId: string

      The id of the user.

    • Optional shouldBanIp: boolean

    Returns void

banFromChat

  • banFromChat(userId: string): Promise<void>

block

  • block(userId: string, reason?: string): void
  • Blocks a user from the room.

    Parameters

    • userId: string

      The id of the user.

    • Optional reason: string

    Returns void

changeRoomCreator

  • changeRoomCreator(userId: string): Promise<void>
  • Changes the room creator.

    Parameters

    • userId: string

      The id of the user.

    Returns Promise<void>

editRoom

  • editRoom(data: { description: string; name: string; privacy: string }): Promise<EditResponse>
  • Edits the room.

    Parameters

    • data: { description: string; name: string; privacy: string }

      The room data.

      • description: string

        The description of the room.

      • name: string

        The room name.

      • privacy: string

        The privacy of the room.

    Returns Promise<EditResponse>

    The data.

inviteToRoom

  • inviteToRoom(userId: string): void
  • Invites a user to the room.

    Parameters

    • userId: string

      The user id of the user.

    Returns void

join

  • join(): Promise<void>

leaveRoom

  • leaveRoom(): Promise<string>

send

  • send(tokens: MessageToken<string, unknown>[], whisperedTo?: string[]): Promise<void>
  • Sends a message to the room.

    Parameters

    • tokens: MessageToken<string, unknown>[]

      The message tokens.

    • Optional whisperedTo: string[]

    Returns Promise<void>

setDeaf

  • setDeaf(isDeafened: boolean): Promise<Record<string, never>>
  • Deafens the bot.

    Parameters

    • isDeafened: boolean

      If you want to deafen the bot.

    Returns Promise<Record<string, never>>

    The response.

setMute

  • setMute(isMuted: boolean): Promise<Record<string, never>>
  • Mutes the bot.

    Parameters

    • isMuted: boolean

      If you want to mute the bot.

    Returns Promise<Record<string, never>>

    The response.

unban

  • unban(userId: string): Promise<void>
  • Unbans a user from the room.

    Parameters

    • userId: string

      The id of the user.

    Returns Promise<void>

unbanFromChat

  • unbanFromChat(userId: string): Promise<void>
  • Unbans a user from the room chat.

    Parameters

    • userId: string

      The id of the user.

    Returns Promise<void>

Generated using TypeDoc