Members
collectors :Array.<Discord.Collector>
A list of Discord collectors that is cleared when this.clearCollectors(this.collectors)
is called. Whenever a MessageCollector
or ReactionCollector
is created, push it to this.collectors()
.
- Deprecated:
- Yes
- Source:
- See:
Type:
-
Array.<Discord.Collector>
ending :Boolean
Helper field that is only true when this.forceStop()
is called. This should be used to prevent the game from continuing when unexpectedly ended.
- Deprecated:
- use this.stage = 'ending' instead
- Source:
Type:
-
Boolean
Example
const collector = this.channel.createMessageCollector(filter, options)
collector.on('message', message => {
if(this.ending) return
// ...
})
gameOptions :Array.<GameOption>
The list of user-configurable options for this game. The configured options will be accessible from this.options[friendlyName]
after the init stage.
- Source:
Type:
-
Array.<GameOption>
Example
this.gameOptions = [
{
friendlyName: 'Categories',
type: 'checkboxes'
default: ['Game of Thrones']
choices: ['Game of Thrones', 'Narnia', 'Lord of the Rings', 'Harry Potter'],
note: 'Choose the categories for this game.'
},
{
friendlyName: 'Game Mode',
type: 'radio',
default: 'Solo',
choices: ['Team', 'Solo'],
note: 'In team, players are matched up against each other in groups. In solo, it\'s everyone for themself!'
},
{
friendlyName: 'Timer',
type: 'number',
default: 60,
note: 'Enter a new value in seconds, between 30-60.',
filter: m => parseInt(m.content) >= 30 && parseInt(m.content) <= 60
},
{
friendlyName: 'Clan Tag',
type: 'free',
default: 'none',
note: 'Enter a new 3-letter clan tag, or type \'none\' for no name.',
filter: m => m.content.length == 3 || m.content == 'none'
}
]
metadata :GameMetadata
The metadata from the game, typically read from a metadata.js file.
- Source:
Type:
Example
import metadata from './metadata.js'
msg :Discord.Message
The Discord message that initialized this game.
- Source:
- See:
Type:
-
Discord.Message
playerCount :Object
The game's minimum and maximum player count. Use this.metadata
instead.
Properties:
Name | Type | Description |
---|---|---|
min |
Number
|
The minimum player count for this game. |
max |
Number
|
The maximum player count for this game. |
- Deprecated:
- Yes
- Source:
Type:
-
Object
players :Discord.Collection
The collection of players who are added to this game during the join phase.
- Source:
- See:
Type:
-
Discord.Collection
playersToAdd :Array
An array of players that are queued to be added, populated using the this.addPlayer()
command
- Source:
Type:
-
Array
playersToKick :Array
An array of players that are queued to be added, populated using the this.removePlayer()
command
- Source:
Type:
-
Array
settings
Game-specific settings that are configurable on a class level.
- Source:
stage :String
The current stage of the game. Default stages include 'join' and 'init'.
- Source:
Type:
-
String