Skip to main content
Version: v3.0.0 (current)

SearchOptions

Pass these options as the second argument to manager.search(query, options). The first argument is a string, not a SearchQuery object. A non-string query throws MANAGER_SEARCH_FAILED. A searchType that is not letters and digits only also throws MANAGER_SEARCH_FAILED; it is lowercased. player.search() is removed; use player.manager.search().

const result = await manager.search("daft punk", {
source: SearchPlatform.YouTube,
requester: interaction.user,
nodeIdentifier: "music",
});

The requester is copied to PortableUser. A missing or incompatible preferred node falls back to a compatible connected node with a Debug diagnostic. NodeLink searchType modifiers require NodeLink; resolve collection result URIs before playback.

export interface SearchOptions {
/**
* The source to search from.
* @default the manager's defaultSearchPlatform
*/
source?: SearchSource;
/**
* NodeLink search type modifier.
*
* Builds identifiers like `ytsearch:playlist:query` and routes the search to a NodeLink node.
*/
searchType?: NodeLinkSearchType | string;
/** The user set as requester of the tracks and the playlist found. */
requester?: RequesterInput | null;
/**
* The identifier of the node that runs the search.
* When this node is unknown, disconnected or cannot run the search, the manager picks another node.
* @default the node picked by the manager
*/
nodeIdentifier?: string;
}