error when starting / connecting to node

TypeError: require(...).setDefaultAutoSelectFamily is not a function
at new MoonlinkWebSocket (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Services\MoonlinkWebSocket.js:32:24)
at MoonlinkNode.connect (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Entities\MoonlinkNode.js:105:23)
at new MoonlinkNode (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Entities\MoonlinkNode.js:66:14)
at Nodes.add (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:165:30)
at C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:161:52
at Array.forEach (<anonymous>)
at Nodes.check (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:161:31)
at Nodes.init (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:150:14)
at MoonlinkManager.init (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Managers\MoonlinkManager.js:39:20)
at Object.execute (C:\Users\paul0\Desktop\lavabeats\src\events\ready.js:13:17)
TypeError: require(...).setDefaultAutoSelectFamily is not a function
at new MoonlinkWebSocket (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Services\MoonlinkWebSocket.js:32:24)
at MoonlinkNode.connect (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Entities\MoonlinkNode.js:105:23)
at new MoonlinkNode (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Entities\MoonlinkNode.js:66:14)
at Nodes.add (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:165:30)
at C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:161:52
at Array.forEach (<anonymous>)
at Nodes.check (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:161:31)
at Nodes.init (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Utils\Structure.js:150:14)
at MoonlinkManager.init (C:\Users\paul0\Desktop\lavabeats\node_modules\moonlink.js\dist\src\@Managers\MoonlinkManager.js:39:20)
at Object.execute (C:\Users\paul0\Desktop\lavabeats\src\events\ready.js:13:17)
appears when starting the bot ready.js
const { ActivityType, Events } = require("discord.js");
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v10");

module.exports = {
name: Events.ClientReady,
once: true,
execute: async (client) => {
const rest = new REST({ version: "10" }).setToken(client.token);


client.log(`${client.user.username} Online`);
client.moon.init(client.user.id);

try {
await rest.put(Routes.applicationCommands(client.user.id), {
body: client.slashDatas,
});
} catch (error) {
console.error(error);
}
},
};
const { ActivityType, Events } = require("discord.js");
const { REST } = require("@discordjs/rest");
const { Routes } = require("discord-api-types/v10");

module.exports = {
name: Events.ClientReady,
once: true,
execute: async (client) => {
const rest = new REST({ version: "10" }).setToken(client.token);


client.log(`${client.user.username} Online`);
client.moon.init(client.user.id);

try {
await rest.put(Routes.applicationCommands(client.user.id), {
body: client.slashDatas,
});
} catch (error) {
console.error(error);
}
},
};
Newest moonlink.js version
2 Replies
conscious-sapphire
conscious-sapphireOP•11mo ago
Lavalink Node isnt connecting confing:
client.moon = new MoonlinkManager(
[
{
host: "//",
port: //,
secure: false,
password: "//"
}
],
{
clientName : "//",
reconnectAttempts: 5,
retryTime: 3000,
retryAmount: 3,
resumeKey: "myResumeKey",
resumeTimeout: 5000,
autoResume: true,
},
(guild, sPayload) => {
// Sending payload information to the server
client.guilds.cache.get(guild).shard.send(JSON.parse(sPayload));
}
);
client.moon = new MoonlinkManager(
[
{
host: "//",
port: //,
secure: false,
password: "//"
}
],
{
clientName : "//",
reconnectAttempts: 5,
retryTime: 3000,
retryAmount: 3,
resumeKey: "myResumeKey",
resumeTimeout: 5000,
autoResume: true,
},
(guild, sPayload) => {
// Sending payload information to the server
client.guilds.cache.get(guild).shard.send(JSON.parse(sPayload));
}
);
// = censored
1Lucas1.apk
1Lucas1.apk•11mo ago
I'm sorry, it seems that a function I put in the Websocket code is not available in other versions of NodeJs, I will fix it
Want results from more Discord servers?
Add your server