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 |
Members
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.
Methods
# 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 |
# 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 |
# giveRoleAccess(role)
Gives access to the room to a role.
Parameters:
Name | Type | Description |
---|---|---|
role |
Role | role to give access to |
# giveUserAccess(user)
Gives access to a user
Parameters:
Name | Type | Description |
---|---|---|
user |
User | user to give access to |
# 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 |
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.
- 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 |
# removeUserAccess(user)
Removes access to a user to see this room.
Parameters:
Name | Type | Description |
---|---|---|
user |
User | the user to remove access to |