/home/container/node_modules/lavaclient/dist/structures/Socket.js:22
this.secure = data.secure ?? false;
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:931:16)
at Module._compile (internal/modules/cjs/loader.js:979:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/container/node_modules/lavaclient/dist/Structures.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/container/node_modules/lavaclient/dist/index.js:14:20)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
const { Manager } = require("lavaclient");
// Create our nodes array.
const nodes = [
{
id: "main",
host: "localhost",
port: 2333,
password: "youshallnotpass",
},
];
// Create our client and manager.
const manager = new Manager(nodes, {
// The shard count must be 1 or greater, or lavalink would break.
shards: 1,
// Send payloads to discord.
// Note: If you're doing this inside of a class, use an arrow function.
send(id, data) {
const guild = client.guilds.cache.get(id);
if (guild) guild.shard.send(data);
return;
}
});
client.on("ready", async => {
// lets initialize our manager. This connects to all of the given lavalink nodes.
await; manager.init(client.user.id);
console.log("ready");
});
// add our listeners, There are two more like "socketClose" and "socketDisconnect".
manager.on("socketError", ({ id }, error) => console.error(`${id} ran into an error`, error));
manager.on("socketReady", (node) => console.log(`${node.id} connected.`));
// Lets make sure we're supplying voice updates to lavaclient.
client.ws.on("VOICE_STATE_UPDATE", (upd) => manager.stateUpdate(upd));
client.ws.on("VOICE_SERVER_UPDATE", (upd) => manager.serverUpdate(upd));
server.init(client);
let vars = {
data:Server
};