Class

Team

Team()

A Team represents a real life team with members. Teams can merge together, have channels and each team has a unique ID.
Constructor

# new Team()

View Source classes/team.js, line 9

Members

Boolean

# deleted

True if the team has been deleted, else false.

View Source classes/team.js, line 46

Boolean

# hasBeenComplete

True if the team has been complete at least once.

View Source classes/team.js, line 40

Number

# id

The team ID

View Source classes/team.js, line 16

Discord.Snowflake

# leader

The team leader.

View Source classes/team.js, line 34

Discord.Collection.<Discord.Snowflake, (Discord.User|Discord.GuildMember)>

# members

All the team members

View Source classes/team.js, line 22

Discord.TextChannel | null

# textChannel

The team's text channel if any

View Source classes/team.js, line 28

Methods

# async addTeamMember(user)

Add a new user to the team.
Parameters:
Name Type Description
user Discord.User | Discord.GuildMember the user to add to the team

View Source classes/team.js, line 116

# async createTextChannel(channelManager, category) → {Promise.<Discord.TextChannel>}

Create a text channel for this team and add all the team members. Will notify the members of the channel creation
Parameters:
Name Type Description
channelManager Discord.ChannelManager the channel manager to create the text channel
category Discord.CategoryChannel the category where to create the channel

View Source classes/team.js, line 57

Promise.<Discord.TextChannel>

# isComplete()

True if the team has 4 members, false otherwise.

View Source classes/team.js, line 161

# async mergeTeam(team)

Merge two teams. Team with a text channel, if any will be kept. New members will be added to the text channel, if any.
Parameters:
Name Type Description
team Team team to merge into this team

View Source classes/team.js, line 82

# removeTeamMember(user) → {Number}

Removes a user from the team.
Parameters:
Name Type Description
user Discord.User the user to remove from the team

View Source classes/team.js, line 135

- the new size of this team
Number

# size() → {Number}

Return the length of the members collection.

View Source classes/team.js, line 154

Number

# toString() → {String}

Returns a string with the team id and all the team members.

View Source classes/team.js, line 169

String