Debugging
new Raya({ nodes, connector, debug: true }); // prints "[Raya] ..." to the consolenew Raya({ nodes, connector, debug: (message) => logger.debug(message) }); // your own loggerraya.on('debug', (message) => {}); // or listen to the eventMessages are only built when something is listening, so leaving debug off costs nothing.
What you’ll see
Section titled “What you’ll see”[Raya] Raya 1.0.0 created with 1 node(s), default search source "spsearch"[Raya] [Node main] connecting to ws://localhost:2333/v4/websocket[Raya] [Node main] ready (session b1c2d3e4, resumed: false)[Raya] [Player 1234] created on node main[Raya] [Player 1234] voice state received (channel 5678)[Raya] [Player 1234] voice server received (c-ams01-abc.discord.media:443)[Raya] [Player 1234] voice forwarded to node main[Raya] Search "spsearch:lofi" -> search (10 tracks)[Raya] [Player 1234] playing "Lofi Study" (spotify) on node main[Raya] [Player 1234] track ended "Lofi Study" (finished)[Raya] [Player 1234] autoplay "spsearch:Chill Artist" -> search (10 tracks), picked "Rainy Nights"Common problems
Section titled “Common problems”VOICE_TIMEOUT when joining
Section titled “VOICE_TIMEOUT when joining”Lavalink never received voice credentials. Check that:
- The bot has the Guild Voice States intent.
- The connector is created before logging in, or, without a connector, every raw packet reaches
raya.handleRaw(). - With debug on, you see both
voice state receivedandvoice server received.
NO_NODES
Section titled “NO_NODES”No Lavalink node is ready. Look for [Node ...] lines: a wrong host or port shows reconnect attempts, and a wrong password shows NODE_AUTH_FAILED.
Search returns error or empty
Section titled “Search returns error or empty”Your node may not have that source. node.hasSource('spotify') tells you, and the sources table lists which plugin each source needs.
Autoplay doesn’t continue
Section titled “Autoplay doesn’t continue”- Make sure it’s on:
playerDefaults: { autoplay: true }orplayer.setAutoplay(true). A top-levelautoplayis ignored and prints a warning. - The debug log shows every query autoplay tries and why each result was or wasn’t used.
Voice channel status doesn’t change
Section titled “Voice channel status doesn’t change”The bot needs the Set Voice Channel Status permission. Add onError to voiceStatus to see Discord’s response.
Inspecting state
Section titled “Inspecting state”raya.stats; // { nodes, readyNodes, players, playingPlayers, cache }raya.readyNodes; // connected nodesnode.penalty; // load scorenode.ping; // WebSocket latency in msnode.rest.latency; // average REST latency in msplayer.voiceState; // voice credentials Raya knows aboutraya.on('nodeRaw', (node, payload) => {}); // every WebSocket message