Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Kazagumo
✓ import { Kazagumo } from 'kazagumo'
✗ const Kazagumo = require('kazagumo')
ESM-only; Kazagumo is a named export, not default.
KazagumoPlayer
✓ import { KazagumoPlayer } from 'kazagumo'
✗ import KazagumoPlayer from 'kazagumo'
Named export, not default.
KazagumoQueue
✓ import { KazagumoQueue } from 'kazagumo'
✗ import { Queue } from 'kazagumo'
The queue class is named KazagumoQueue, not Queue.
Initializes Kazagumo with Lavalink nodes, creates a player, searches for a track, adds it to the queue, and starts playback.
import { Kazagumo } from 'kazagumo';
import { Connectors } from 'shoukaku';
const kazagumo = new Kazagumo(
{
defaultVolume: 70,
defaultSearchEngine: 'youtube',
send: (guildId, payload) => {
const guild = client.guilds.cache.get(guildId);
guild?.shard.send(payload);
},
},
new Connectors.DiscordJS(client),
[
{
name: 'Node 1',
url: process.env.LAVALINK_URL ?? 'localhost:2333',
auth: process.env.LAVALINK_PASS ?? 'password',
},
],
{
options: {
moveOnDisconnect: true,
resumable: true,
resumableTimeout: 30,
reconnectTries: 2,
reconnectInterval: 5,
},
},
);
kazagumo.on('playerCreate', (player) => {
console.log(`Player created for guild ${player.guildId}`);
});
// Play a track
const player = kazagumo.createPlayer({
guildId: '123',
voiceId: '456',
textId: '789',
});
const result = await kazagumo.search('https://www.youtube.com/watch?v=dQw4w9WgXcQ', { requester: user });
if (result.tracks.length) {
player.queue.add(result.tracks[0]);
if (!player.playing && !player.paused) await player.play();
}
Errors
Common errors & fixes
TypeError: Kazagumo is not a constructor
Using CommonJS require() instead of ESM import.
fixUse import { Kazagumo } from 'kazagumo' and ensure project uses ESM (e.g., 'type': 'module' in package.json). Error: No available nodes found
Lavalink node URL or auth invalid, or node is not running.
fixCheck LAVALINK_URL and LAVALINK_PASS environment variables; ensure Lavalink server is running and reachable.
Cannot read properties of undefined (reading 'play')
Calling player.play() before adding any tracks to the queue.
fixAdd a track to player.queue before calling player.play().
Audit
Dependencies
shoukakurequiredCore dependency for Lavalink node communication
discord.jsoptionalTypical peer dependency for Discord bot integration (if used)