Skip to main content
Version: v2.10.3

ManagerOptions

Manager Options

Definition​

export interface ManagerOptions {
/** The state storage options.
*
* @default { type: StateStorageType.Collection, deleteDestroyedPlayers: true }
*/
stateStorage?: StateStorageOptions;
/** Enable priority mode over least player count or load balancing?
* @default false
*/
enablePriorityMode?: boolean;
/** Automatically play the next track when the current one ends.
* @default true
*/
playNextOnEnd?: boolean;
/** An array of search platforms to use for autoplay. First to last matters
* Use enum `AutoPlayPlatform`.
* @default [AutoPlayPlatform.YouTube]
*/
autoPlaySearchPlatforms?: AutoPlayPlatform[];
/** The client ID to use. */
clientId?: string;
/** Value to use for the `Client-Name` header.
* @default "Magmastream"
*
* For NodeLink, leave it empty.
*/
clientName?: string;
/** The array of shard IDs connected to this manager instance.
* @default 0
*/
clusterId?: number;
/** List of plugins to load. */
enabledPlugins?: Plugin[];
/** The default search platform to use.
* Use enum `SearchPlatform`.
* @default SearchPlatform.YouTube
*/
defaultSearchPlatform?: SearchSource;
/** The last.fm API key.
* If you need to create one go here: https://www.last.fm/api/account/create.
* If you already have one, get it from here: https://www.last.fm/api/accounts. */
lastFmApiKey?: string;
/** The maximum number of previous tracks to store.
* @default 20
*/
maxPreviousTracks?: number;
/** The array of nodes to connect to. */
nodes?: NodeOptions[];
/** Whether the YouTube video titles should be replaced if the Author does not exactly match.
* @default false
*/
normalizeYouTubeTitles?: boolean;
/** An array of track properties to keep. `track` will always be present. */
trackPartial?: TrackPartial[];
/** Use the least amount of players or least load?
* Use enum `UseNodeOptions`.
* @default UseNodeOptions.LeastPlayers
*/
useNode?: UseNodeOptions.LeastLoad | UseNodeOptions.LeastPlayers;
/** Whether the manager should listen to SIGINT and SIGTERM events.
* @default true
*/
listenToSIGEvents?: boolean;
/**
* Function to send data to the websocket.
* @param id The ID of the node to send the data to.
* @param payload The payload to send.
*/
send?: (packet: DiscordPacket) => unknown;
/**
* User cache getter. Required when using `new Manager(...)` directly, optional for built-in wrappers.
* When resolving a user from a partial ID, this function will be called first.
* Should return the full user object if cached, or undefined if not.
* @param id The ID of the user to get.
* @returns The user object if cached, or undefined if not.
*/
getUser?: (id: string) => AnyUser | undefined;
/**
* Guild cache getter. Required when using `new Manager(...)` directly, optional for built-in wrappers.
* When resolving a guild from a partial ID, this function will be called first.
* Should return the full guild object if cached, or undefined if not.
* @param id The ID of the guild to get.
* @returns The guild object if cached, or undefined if not.
*/
getGuild?: (id: string) => AnyGuild | undefined;
}