lavaclient / lavadeno

lavadeno is a simple, easy-to-use, and flexible lavalink client built on the Deno Runtime.
Apache License 2.0
12 stars 4 forks source link

Something seems broken, not sure what #13

Closed Yaikava closed 1 year ago

Yaikava commented 1 year ago

Hi, seems like something is breaking. Might be my lavalink. I have no idea.

Error It happens immediately upon starting the process.

error: Uncaught (in promise) TypeError: Cannot convert undefined to a BigInt
                const player = this.node.players.get(BigInt(payload.guildId));
                                                     ^
    at BigInt (<anonymous>)
    at Connection._onmessage (https://deno.land/x/lavadeno@3.3.0/src/connection.ts:242:54)
    at Connection._onopen (https://deno.land/x/lavadeno@3.3.0/src/connection.ts:217:24)

Minimal repro code

import { Cluster } from "https://deno.land/x/lavadeno@3.3.0/mod.ts";

const cluster = new Cluster({
  nodes: [
    {
      id: "main",
      host: "host.docker.internal",
      password: "lavalink",
      port: 2333,
      secure: false,
    },
  ],
  sendGatewayPayload: (id, payload) => console.log("Send to discord", id, payload),
});

await cluster.init(870267613635309618n); // This is the id from your README. I am using the id of my own bot.

Using lavalink via this docker image: fredboat/lavalink:latest. image

Deno version

deno 1.31.0 (release, x86_64-unknown-linux-gnu)
v8 11.0.226.13
typescript 4.9.4

Lavalink logs, they do not really seem helpful though

lavalink-lavalink-1  | 2023-03-04T18:15:59.621035300Z 2023-03-04 18:15:59.620  INFO 1 --- [  XNIO-1 task-1] l.server.io.HandshakeInterceptorImpl     : Incoming connection from /172.29.0.1:60438
lavalink-lavalink-1  | 2023-03-04T18:15:59.624255900Z 2023-03-04 18:15:59.623  INFO 1 --- [  XNIO-1 task-1] lavalink.server.io.SocketServer          : Connection successfully established from lavadeno (https://github.com/lavaclient/lavadeno, Deno v1.31.0)
lavalink-lavalink-1  | 2023-03-04T18:15:59.630129400Z 2023-03-04 18:15:59.629  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : Connection closed from /172.29.0.1:60438 -- CloseStatus[code=1006, reason=]
lavalink-lavalink-1  | 2023-03-04T18:15:59.630242300Z 2023-03-04 18:15:59.630  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketContext         : Shutting down 0 playing players.

Any idea if I am doing something wrong? :) Thanks

Yaikava commented 1 year ago

It is crashing on this op.

{
  data: '{"resumed":false,"sessionId":"censored","op":"ready"}',
  type: "message"
}
viztea commented 1 year ago

I forgot to add the closing action thing, but that commit should fix this :)