new Switch( name, note, isChecked, onChange [, options ] )

Description

Creates a switch using discord's built in switch.

Parameters
Name Type Attributes Description
name string

name label of the setting

note string

help/note to show underneath or above the setting

isChecked boolean

should switch be checked

onChange callable

callback to perform on setting change, callback receives boolean

options object <optional>

object of options to give to the setting

Name Type Attributes Default Description
disabled boolean <optional>
false

should the setting be disabled

Methods


getElement() → {HTMLElement}

Returns
  • root element for setting

onChange()

Description

Fires onchange to listeners


onAdded()

Description

Fired when root node added to DOM


onRemoved()

Description

Fired when root node removed from DOM