Registry / messaging / damonjs

damonjs

JSON →
library2.1.8jsnpmunverified

DamonJS is a modified Shoukaku wrapper for Lavalink that provides enhanced queue management, voice state handling, and track resolution. Version 2.1.8 supports Node >=16.5.0, ships TypeScript definitions, and offers a drop-in replacement for Shoukaku with additional features like built-in queue support, custom filters, and improved error handling. It is designed for Discord music bots, simplifying audio streaming with Lavalink nodes. Active maintenance is indicated by recent updates and community use.

npm install damonjs
INSTALL
IMPORT
SIG · DAMONJS
D
damonjs
messagingjavascriptv2.1.8
harness data pending
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.

Damon
import { Damon } from 'damonjs'
const Damon = require('damonjs').Damon
ESM-only; named export since v2
Queue
import { Queue } from 'damonjs'
import Queue from 'damonjs/Queue'
Queue is a named export, not a default or subpath export
Track
import { Track } from 'damonjs'
TypeScript users should import Track for type annotations

Initializes a Damon client connecting to a Lavalink node with Discord.js, showing essential setup with environment variable for password.

import { Damon } from 'damonjs'; const client = new Damon({ nodes: [ { name: 'main', host: 'localhost', port: 2333, auth: process.env.LAVALINK_PASSWORD ?? 'youshallnotpass', secure: false } ], send: (guildId, payload) => console.log(guildId, payload), library: 'discord.js' }); client.on('ready', () => console.log('Damon is ready!'));
Debug
Known issues
breakingESM-only since v2; CommonJS require() will fail
fix
Use import instead of require; set type: module in package.json if needed
affects: >=2.0.0
gotchaThe 'send' function must be provided and must handle voice server updates; otherwise, no audio output
fix
Implement a proper voice state update handler that forwards payloads to Discord
affects: >=2.0.0
deprecatedUse of .search() without specifying source is deprecated; future versions will require explicit source
fix
Pass source parameter like { source: 'youtube' } to search()
affects: >=2.1.0
gotchaNode host must not include protocol (e.g., http://); only hostname/IP
fix
Remove protocol prefix; use host: 'myhost.com' instead of 'http://myhost.com'
affects: >=2.0.0
breakingVoice state handling changed: the 'send' function must now return a Promise
fix
Make send() async or return a Promise to ensure proper voice state propagation
affects: >=2.1.0
Errors
Common errors & fixes
TypeError: damon.on is not a function
Incorrect import; Damon is a class, not an event emitter on its own
fix
const client = new Damon(...); client.on('ready', ...) if you have a wrapper, or use the library's built-in events
Error: No available nodes
Lavalink node is not reachable or authentication failed
fix
Check node host/port and auth; ensure Lavalink is running and accessible
UnhandledPromiseRejectionWarning: TypeError: send is not a function
Missing or invalid 'send' parameter in Damon constructor
fix
Provide a 'send' function that takes (guildId, payload) and sends it to Discord
Upgrade
Version history
2.1.8latest on npm
Audit
Dependencies
shoukakurequiredCore dependency for Lavalink WebSocket connection and audio management
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
damonjs — npm install damonjs · libregistry