Methods
-
<static> loadData( name, key, defaultData ) → {object}
-
Description
Loads data through BetterDiscord's API.
Parameters
Name Type Description namestring name for the file (usually plugin name)
keystring which key the data is saved under
defaultDataobject 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 namestring name for the file (usually plugin name)
keystring which key the data should be saved under
dataobject data to save
Details
-
<static> loadSettings( name, defaultData ) → {object}
-
Description
Loads settings through BetterDiscord's API.
Parameters
Name Type Description namestring name for the file (usually plugin name)
defaultDataobject default data to populate the object with
Returns
Details
-
<static> saveSettings( name, data )
-
Description
Saves settings through BetterDiscord's API.
Parameters
Name Type Description namestring name for the file (usually plugin name)
dataobject 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 callbackcallable basic callback to happen on channel switch
Details
-
<static> removeOnSwitchListener( callback )
-
Description
Removes the listener added by InternalUtilities.addOnSwitchListener.
Parameters
Name Type Description callbackcallable callback to remove from the listener list
Details
-
<static> addStyle( id, css )
-
Description
Adds a style to the document.
Parameters
Name Type Description idstring identifier to use as the element id
cssstring css to add to the document
Details
-
<static> removeStyle( id )
-
Description
Removes a style from the document.
Parameters
Name Type Description idstring original identifier used
Details
-
<static> addScript( id, url ) → {Promise}
-
Description
Adds/requires a remote script to be loaded
Parameters
Name Type Description idstring identifier to use for this script
urlstring url from which to load the script
Returns
Details
-
<static> removeScript( id )
-
Description
Removes a remote script from the document.
Parameters
Name Type Description idstring original identifier used
Details