Skip to content

Latest commit

 

History

History
591 lines (445 loc) · 16.4 KB

djsgames.md

File metadata and controls

591 lines (445 loc) · 16.4 KB

This is the documentation for all game classes that implemented with discord.js.

Table of Contents

DjsGameWrapper

The discord.js wrapper for all games.

constructor

new DjsGameWrapper(djsGameWrapperOptions);
parameter type default description
djsGameWrapperOptions djsGameWrapperOptions required Options for the wrapper

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

abstract .strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

abstract .getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsBigTwo

extends DjsGameWrapper

The class for Bulls and Cows, discord.js version.

constructor

new DjsBigTwo(djsBigTwoOptions);
parameter type default description
djsBigTwoOptions djsBigTwoOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsBullsAndCows

extends DjsGameWrapper

The class for Bulls and Cows, discord.js version.

constructor

new DjsBullsAndCows(djsBullsAndCowsOptions);
parameter type default description
djsBullsAndCowsOptions djsBullsAndCowsOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.hardMode

  • Whether the game is in hard mode
  • Type: boolean

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsFinalCode

extends DjsGameWrapper

The class for Final Code, discord.js version.

constructor

new DjsFinalCode(djsFinalCodeOptions);
parameter type default description
djsFinalCodeOptions djsFinalCodeOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsFlipTrip

extends DjsGameWrapper

The class for Flip Trip, discord.js version.

constructor

new DjsFlipTrip(djsFlipTripOptions);
parameter type default description
djsFlipTripOptions DjsFlipTripOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsGomoku

extends DjsGameWrapper

The class for Gomoku, discord.js version.

constructor

new DjsGomoku(djsGomokuOptions);
parameter type default description
djsGomokuOptions DjsGomokuOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsLightsUp

extends DjsGameWrapper

The class for Lights-up, discord.js version.

constructor

new DjsLightsUp(djsLightsUpOptions);
parameter type default description
djsLightsUpOptions DjsLightsUpOptions required Options for the game

properties

.answered

  • Whether any player has asked for the answer
  • Type: boolean

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsTicTacToe

extends DjsGameWrapper

The class for Tic-tac-toe, discord.js version.

constructor

new DjsTicTacToe(djsTicTacToeOptions);
parameter type default description
djsTicTacToeOptions DjsTicTacToeOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.controller

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>

DjsTofe

extends DjsGameWrapper

The class for 2048, discord.js version.

constructor

new DjsTofe(djsTofeOptions);
parameter type default description
djsTofeOptions djsTofeOptions required Options for the game

properties

.client

  • The client that instantiated this
  • Type: Client

.subMessage

  • The subordinate message, or the main message if a subordinate message does not exist in a game
  • Type: ?Message

.loser

  • The loser of the game
  • Type: Player | null

.mainMessage

  • The message where most of the information are shown
  • Type: ?Message

.source

.strings

.time

  • How long to consider a player idle (in milliseconds)
  • Type: number

.winner

  • The winner of the game
  • Type: Player | null

methods

.conclude()

  • Sends a conclusion message of the game
  • Returns: Promise<void>

.initialize()

  • Initializes the game
  • Returns: Promise<void>

.getEndContent()

  • Gets the content to show on the concluding message
  • Returns: string

.start()

  • Starts running the game
  • Returns: Promise<void>