Class: Extendable

Extendable

Base class for all Klasa Extendables. See Creating Extendables for more information how to use this class to build custom extendables.

new Extendable(client, dir, file, appliesTo, options)

Parameters:
Name Type Description
client KlasaClient The klasa client
dir string The path to the core or user extendable pieces folder
file string The path from the pieces folder to the extendable file
appliesTo Array.<string> The discord classes this extendable applies to
options ExtendableOptions The options for this extendable
Since:
  • 0.0.1
Implements:
Source:
lib/structures/Extendable.js#L28
Tutorials:

Properties


appliesTo

The discord classes this extendable applies to
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L68

client :KlasaClient

Type:
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L33

dir :string

The directory to where this extendable piece is stored
Type:
  • string
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L40

enabled :boolean

If the language is enabled or not
Type:
  • boolean
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L75

file :string

The file location where this extendable is stored
Type:
  • string
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L47

name :string

The name of the extendable
Type:
  • string
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L54

target :boolean

The target library to apply this extendable to
Type:
  • boolean
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L82

type :string

The type of Klasa piece this is
Type:
  • string
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L61

Methods


disable()

Disables this piece
Since:
  • 0.0.1
Implements:
Source:
lib/structures/Extendable.js#L110
Returns:
This piece
Type
Piece

enable( [init])

Enables this piece
Parameters:
Name Type Argument Default Description
init boolean <optional>
false If the piece is being init or not
Since:
  • 0.0.1
Implements:
Source:
lib/structures/Extendable.js#L123
Returns:
This piece
Type
Piece

<abstract> extend(params)

The extend method to be overwritten in actual extend pieces
Parameters:
Name Type Description
params any Any parameters you want
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L92
Returns:
Type
any

<async> init()

The init method to apply the extend method to the Discord.js Class
Since:
  • 0.0.1
Source:
lib/structures/Extendable.js#L101
Returns:
Type
void

<async> reload()

Reloads this piece
Since:
  • 0.0.1
Implements:
Source:
lib/structures/interfaces/Piece.js#L21
Returns:
The newly loaded piece
Type
Piece

unload()

Unloads this piece
Since:
  • 0.0.1
Implements:
Source:
lib/structures/interfaces/Piece.js#L33
Returns:
Type
void

Type Definitions


ExtendableOptions

Type:
  • object
Properties:
Name Type Argument Default Description
name string <optional>
theFileName The name of the extendable
enabled boolean <optional>
true If the extendable is enabled or not
klasa boolean <optional>
false If the extendable is for Klasa instead of Discord.js
Source:
lib/structures/Extendable.js#L12