Closed nightnai35p closed 9 months ago
Can you show me your LavalinkManager.init()
Function / what you put in the ManagerOption#client property?
client.user
Can you show it to me, i asume that client.user.username has characters which are not useable in a header Make sure that your client.username does not have special chars which are not sendable.
client username?
oh cant use chinese invalid_char solved But another error arises err_unhandled_error
can you show the error?
and again, if possible the code related to it.
`node:events:381 throw err; // Unhandled 'error' event ^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. (<ref 1> LavalinkNode { options: { secure: false, retryAmount: 5, retryDelay: 30000, requestTimeout: 10000, host: 'localhost', port: 2333, authorization: 'Miko-20180305', regions: [] }, calls: 0, stats: { players: 0, playingPlayers: 0, cpu: { cores: 0, lavalinkLoad: 0, systemLoad: 0 }, memory: { allocated: 0, free: 0, reservable: 0, used: 0 }, uptime: 0, frameStats: { deficit: 0, nulled: 0, sent: 0 } }, sessionId: null, info: null, NodeManager: <ref 2> NodeManager { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, nodes: MiniMap(1) [Map] { 'localhost:2333' => [Circular 1] }, LavalinkManager: LavalinkManager { _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, initiated: true, players: MiniMap(0) [Map] {}, utils: [ManagerUtils], options: [Object], nodeManager: [Circular 2],
},
[Symbol(kCapture)]: false
},
reconnectTimeout: undefined,
reconnectAttempts: 1,
socket: WebSocket {
_events: [Object: null prototype] {
open: [Function: bound open] AsyncFunction,
close: [Function (anonymous)],
message: [Function: bound message] AsyncFunction,
error: [Function: bound error]
},
_eventsCount: 4,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage:
}, rest: <ref *3> Pool { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined,
[Symbol(destroyed)]: false,
[Symbol(onDestroyed)]: null,
[Symbol(closed)]: false,
[Symbol(onClosed)]: [],
[Symbol(queue)]: FixedQueue {
tail: [FixedCircularBuffer],
head: [FixedCircularBuffer]
},
[Symbol(clients)]: [],
[Symbol(queued)]: 0,
[Symbol(onDrain)]: [Function: onDrain],
[Symbol(onConnect)]: [Function (anonymous)],
[Symbol(onDisconnect)]: [Function (anonymous)],
[Symbol(onConnectionError)]: [Function (anonymous)],
[Symbol(stats)]: PoolStats { [Symbol(pool)]: [Circular *3] },
[Symbol(dispatch interceptors)]: [],
[Symbol(connections)]: null,
[Symbol(url)]: URL {
href: 'http://localhost:2333/',
origin: 'http://localhost:2333',
protocol: 'http:',
username: '',
password: '',
host: 'localhost:2333',
hostname: 'localhost',
port: '2333',
pathname: '/',
search: '',
searchParams: URLSearchParams {},
hash: ''
},
[Symbol(options)]: {
connect: [Function: connect],
allowH2: undefined,
interceptors: undefined
},
[Symbol(factory)]: [Function: defaultFactory]
},
version: 'v4',
decode: {
singleTrack: [AsyncFunction: singleTrack],
multipleTracks: [AsyncFunction: multipleTracks]
},
routePlannerApi: {
getStatus: [AsyncFunction: getStatus],
unmarkFailedAddress: [AsyncFunction: unmarkFailedAddress],
unmarkAllFailedAddresses: [AsyncFunction: unmarkAllFailedAddresses]
}
})
at new NodeError (node:internal/errors:371:5)
at NodeManager.emit (node:events:379:17)
at LavalinkNode.error (G:\Discord Bots\wzsy\node_modules\lavalink-client\dist\cjs\structures\Node.js:498:26)
at WebSocket.emit (node:events:390:28)
at emitErrorAndClose (G:\Discord Bots\wzsy\node_modules\ws\lib\websocket.js:1016:13)
at ClientRequest.
},
[Symbol(kCapture)]: false
},
reconnectTimeout: undefined,
reconnectAttempts: 1,
socket: WebSocket {
_events: [Object: null prototype] {
open: [Function: bound open] AsyncFunction,
close: [Function (anonymous)],
message: [Function: bound message] AsyncFunction,
error: [Function: bound error]
},
_eventsCount: 4,
_maxListeners: undefined,
_binaryType: 'nodebuffer',
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: Buffer(0) [Uint8Array] [],
_closeTimer: null,
_extensions: {},
_paused: false,
_protocol: '',
_readyState: 2,
_receiver: null,
_sender: null,
_socket: null,
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_url: 'ws://localhost:2333/v4/websocket',
_req: null,
[Symbol(kCapture)]: false
},
rest: <ref *4> Pool {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
[Symbol(kCapture)]: false,
[Symbol(destroyed)]: false,
[Symbol(onDestroyed)]: null,
[Symbol(closed)]: false,
[Symbol(onClosed)]: [],
[Symbol(queue)]: FixedQueue {
tail: FixedCircularBuffer {
bottom: 0,
top: 0,
list: [ <2048 empty items> ],
next: null
},
head: FixedCircularBuffer {
bottom: 0,
top: 0,
list: [ <2048 empty items> ],
next: null
}
},
[Symbol(clients)]: [],
[Symbol(queued)]: 0,
[Symbol(onDrain)]: [Function: onDrain],
[Symbol(onConnect)]: [Function (anonymous)],
[Symbol(onDisconnect)]: [Function (anonymous)],
[Symbol(onConnectionError)]: [Function (anonymous)],
[Symbol(stats)]: PoolStats { [Symbol(pool)]: [Circular *4] },
[Symbol(dispatch interceptors)]: [],
[Symbol(connections)]: null,
[Symbol(url)]: <ref *5> URL {
[Symbol(context)]: URLContext {
flags: 400,
scheme: 'http:',
username: '',
password: '',
host: 'localhost',
port: 2333,
path: [ '' ],
query: null,
fragment: null
},
[Symbol(query)]: URLSearchParams {
[Symbol(query)]: [],
[Symbol(context)]: [Circular *5]
}
},
[Symbol(options)]: {
connect: [Function: connect],
allowH2: undefined,
interceptors: undefined
},
[Symbol(factory)]: [Function: defaultFactory]
},
version: 'v4',
decode: {
singleTrack: [AsyncFunction: singleTrack],
multipleTracks: [AsyncFunction: multipleTracks]
},
routePlannerApi: {
getStatus: [AsyncFunction: getStatus],
unmarkFailedAddress: [AsyncFunction: unmarkFailedAddress],
unmarkAllFailedAddresses: [AsyncFunction: unmarkAllFailedAddresses]
}
} }`
Well I don't know what the error caused, nor when the error happend. But it seems like it couldn't build the connection (websocket) to the lavalink server.
You sure that your lavalink server runs on v4?
I'm closing this now, try to do the following: Use lavalink's .jar version: beta v4 aka beta latest Use the latest lavalink-client version
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Client-Name"] at ClientRequest.setHeader (node:_http_outgoing:579:3) at new ClientRequest (node:_http_client:256:14) at request (node:http:96:10) at initAsClient (G:\Discord Bots\wzsy\node_modules\ws\lib\websocket.js:851:28) at new WebSocket (G:\Discord Bots\wzsy\node_modules\ws\lib\websocket.js:85:7) at LavalinkNode.connect (G:\Discord Bots\wzsy\node_modules\lavalink-client\dist\cjs\structures\Node.js:206:23) at LavalinkManager.init (G:\Discord Bots\wzsy\node_modules\lavalink-client\dist\cjs\structures\LavalinkManager.js:149:28) at Client.<anonymous> (G:\Discord Bots\wzsy\src\index.js:50:20) at Client.emit (node:events:390:28) at WebSocketManager.triggerClientReady (G:\Discord Bots\wzsy\node_modules\discord.js\src\client\websocket\WebSocketManager.js:388:17) { code: 'ERR_INVALID_CHAR' }