Methods
-
<static> loadData( name, key, defaultData ) → {object}
-
Description
Loads data through BetterDiscord's API.
Parameters
Name Type Description name
string name for the file (usually plugin name)
key
string which key the data is saved under
defaultData
object default data to populate the object with
Returns
Details
-
<static> saveData( name, key, data )
-
Description
Saves data through BetterDiscord's API.
Parameters
Name Type Description name
string name for the file (usually plugin name)
key
string which key the data should be saved under
data
object data to save
Details
-
<static> loadSettings( name, defaultData ) → {object}
-
Description
Loads settings through BetterDiscord's API.
Parameters
Name Type Description name
string name for the file (usually plugin name)
defaultData
object default data to populate the object with
Returns
Details
-
<static> saveSettings( name, data )
-
Description
Saves settings through BetterDiscord's API.
Parameters
Name Type Description name
string name for the file (usually plugin name)
data
object settings to save
Details
-
<static> getBDFolder() → {string}
-
Description
Get the full path to the BetterDiscord folder.
Returns
Details
-
<static> getPluginsFolder() → {string}
-
Description
Get the full path to the plugins folder.
Returns
Details
-
<static> getThemesFolder() → {string}
-
Description
Get the full path to the themes folder.
Returns
Details
-
<static> addOnSwitchListener( callback )
-
Description
Adds a callback to a set of listeners for onSwitch.
Parameters
Name Type Description callback
callable basic callback to happen on channel switch
Details
-
<static> removeOnSwitchListener( callback )
-
Description
Removes the listener added by InternalUtilities.addOnSwitchListener.
Parameters
Name Type Description callback
callable callback to remove from the listener list
Details
-
<static> addStyle( id, css )
-
Description
Adds a style to the document.
Parameters
Name Type Description id
string identifier to use as the element id
css
string css to add to the document
Details
-
<static> removeStyle( id )
-
Description
Removes a style from the document.
Parameters
Name Type Description id
string original identifier used
Details
-
<static> addScript( id, url ) → {Promise}
-
Description
Adds/requires a remote script to be loaded
Parameters
Name Type Description id
string identifier to use for this script
url
string url from which to load the script
Returns
Details
-
<static> removeScript( id )
-
Description
Removes a remote script from the document.
Parameters
Name Type Description id
string original identifier used
Details