Skip to main content

Webpack

Webpack is a utility class for getting internal webpack modules. Instance is accessible through the BdApi. This is extremely useful for interacting with the internals of Discord.

Properties

Filters

Series of Filters to be used for finding webpack modules.

Type: Filters


Methods

getBulk

Finds multiple modules using multiple filters.

ParameterTypeOptionalDefaultDescription
queries...objectnoneObject representing the query to perform
queries.filterfunctionnoneA function to use to filter modules
queries.firstBooleantrueWhether to return only the first matching module
queries.defaultExportBooleantrueWhether to return default export when matching the default export
queries.searchExportsBooleanfalseWhether to execute the filter on webpack exports

Returns: any


getModule

Finds a module using a filter function.

ParameterTypeOptionalDefaultDescription
filterfunctionnoneA function to use to filter modules. It is given exports, module, and moduleID. Return true to signify match.
optionsobjectnoneOptions to configure the search
options.firstBooleantrueWhether to return only the first matching module
options.defaultExportBooleantrueWhether to return default export when matching the default export
options.searchExportsBooleanfalseWhether to execute the filter on webpack exports

Returns: any


waitForModule

Finds a module that is lazily loaded.

ParameterTypeOptionalDefaultDescription
filterfunctionnoneA function to use to filter modules. It is given exports. Return true to signify match.
optionsobjectnoneOptions for configuring the listener
options.signalAbortSignalnoneAbortSignal of an AbortController to cancel the promise
options.defaultExportBooleantrueWhether to return default export when matching the default export
options.searchExportsBooleanfalseWhether to execute the filter on webpack exports

Returns: Promise.<any>