Class

Room

Room(guild, botGuild, name, rolesAllowedopt, usersAllowedopt)

The room class represents a room where things can occur, a room consists of a category with voice and text channels. As well as roles or users allowed to see the room.
Constructor

# new Room(guild, botGuild, name, rolesAllowedopt, usersAllowedopt)

Parameters:
Name Type Attributes Default Description
guild Guild the guild in which the room lives
botGuild BotGuildModel the botGuild
name String name of the room
rolesAllowed Collection.<String, Role> <optional>
Collection() the participants able to view this room
usersAllowed Collection.<String, User> <optional>
Collection() the individual users allowed to see the room

View Source classes/room.js, line 29

Members

BotGuildModel

# botGuild

The mongoose BotGuildModel Object

View Source classes/room.js, line 84

RoomChannels

# channels

All the channels this room has!

View Source classes/room.js, line 70

Guild

# guild

The guild this activity is in.

View Source classes/room.js, line 52

Boolean

# locked

True if the room is locked, false otherwise.

View Source classes/room.js, line 90

string

# name

The name of this room. Will remove all leading and trailing whitespace and switch spaces for '-'. Will also replace all character except for numbers, letters and '-' and make it lowercase.

View Source classes/room.js, line 46

Collection.<String, Role>

# rolesAllowed

Roles allowed to view the room.

View Source classes/room.js, line 58

Number

# timeCreated

The time this room was created.

View Source classes/room.js, line 96

Collection.<String, User>

# usersAllowed

Users allowed to view the room.

View Source classes/room.js, line 64

Methods

# addExcisingChannel(channel)

Parameters:
Name Type Description
channel TextChannel | VoiceChannel

View Source classes/room.js, line 313

# async addRoomChannel(args)

Adds a channels to the room.
Parameters:
Name Type Attributes Default Description
args Object
name String name of the channel to create
info GuildCreateChannelOptions <optional>
{} one of voice or text
permissions Array.<RolePermission> <optional>
[] the permissions per role to be added to this channel after creation.
isSafe Boolean <optional>
false true if the channel is safe and cant be removed

View Source classes/room.js, line 176

# async archive(archiveCategory)

Archive the activity. Move general text channel to archive category, remove all remaining channels and remove the category.
Parameters:
Name Type Description
archiveCategory CategoryChannel the category where the general text channel will be moved to

View Source classes/room.js, line 236

# async delete()

Deletes the room.

View Source classes/room.js, line 217

# giveRoleAccess(role)

Gives access to the room to a role.
Parameters:
Name Type Description
role Role role to give access to

View Source classes/room.js, line 282

# giveUserAccess(user)

Gives access to a user
Parameters:
Name Type Description
user User user to give access to

View Source classes/room.js, line 296

# async init(argsopt) → {Promise.<Room>}

Initialize this activity by creating the channels, adding the features and sending the admin console.
Parameters:
Name Type Attributes Description
args Object <optional>
channels already created to add to this room
category CategoryChannel
textChannel TextChannel
voiceChannel VoiceChannel

View Source classes/room.js, line 109

Promise.<Room>

# async lockRoom() → {Promise.<TextChannel>}

Locks the room for all roles except for a text channel. To gain access users must be allowed access individually.

View Source classes/room.js, line 261

- channel available to roles
Promise.<TextChannel>

# async removeRoomChannel(channelToRemove, isForcedopt)

Removes a channel from the room.
Parameters:
Name Type Attributes Default Description
channelToRemove VoiceChannel | TextChannel
isForced Boolean <optional>
false is the deletion forced?, if so then channel will be removed even if its safeChannels

View Source classes/room.js, line 201

# removeUserAccess(user)

Removes access to a user to see this room.
Parameters:
Name Type Description
user User the user to remove access to

View Source classes/room.js, line 305