nhut lam
nhut lam
MIA🎶 Moonlink.js - Imagine a Music Application
Created by nhut lam on 8/10/2024 in #help
Can't see connection status and event in moonlink doesn't seem to work.
const { Client, Collection } = require('discord.js');
const { Manager } = require('moonlink.js');

module.exports = class BotClient extends Client {
constructor(option) {
super(option);
this.client = this;
this.moonlink = new Manager({
nodes: [
{
identifier: 'xxx',
host: 'xxx',
password: 'xxx',
port: 443,
secure: false,
},
],
options: {
// clientName: "MyApp/1.0.1"
},
sendPayload: (guildId, payload) => {
const guild = this.guilds.cache.get(guildId);
if (guild) guild.shard.send(JSON.parse(payload));
},
});
this.moonlink.on('nodeCreate', (node) => {
console.log(`${node.host} was connected, and the magic is in the air`);
});
this.on('raw', (data) => {
// Updating the Moonlink.js package with the necessary data
this.moonlink.packetUpdate(data);
});
}
async start(token) {
await this.login(token);
}
};
const { Client, Collection } = require('discord.js');
const { Manager } = require('moonlink.js');

module.exports = class BotClient extends Client {
constructor(option) {
super(option);
this.client = this;
this.moonlink = new Manager({
nodes: [
{
identifier: 'xxx',
host: 'xxx',
password: 'xxx',
port: 443,
secure: false,
},
],
options: {
// clientName: "MyApp/1.0.1"
},
sendPayload: (guildId, payload) => {
const guild = this.guilds.cache.get(guildId);
if (guild) guild.shard.send(JSON.parse(payload));
},
});
this.moonlink.on('nodeCreate', (node) => {
console.log(`${node.host} was connected, and the magic is in the air`);
});
this.on('raw', (data) => {
// Updating the Moonlink.js package with the necessary data
this.moonlink.packetUpdate(data);
});
}
async start(token) {
await this.login(token);
}
};
Why nodeCreate But I can't log out that I'm connected to lavalink? I don't understand why it doesn't work :((
12 replies