arpos
arpos
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
No, it is not playing soundcloud
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
const results = await client.lavaclient.api.loadTracks("scsearch:never gonna give you up");
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
how do I do that ?
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
@Lupine , is there anything we can do
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
const info = {
host: "2.tcp.ngrok.io",
port: 13497,
auth: "youshallnotpass"
};

client.lavaclient = new Node({
info,
ws: {
// userId: '1227853247243616297',
clientName: "my very cool bot",
resuming: false | { timeout: 30_000 },
reconnecting: {
tries: 3,
delay: (attempt) => attempt * 1_000
}
},
rest: {
enableTrace: true,
fetch: fetch,
userAgent: "my very cool bot (v1.0.0, <user id>)"
},
discord: {
sendGatewayCommand: (id, payload) => {
const guild = client.guilds.cache.get(id);
console.log(guild);
if (guild) guild.shard.send(payload);
},
userId: '1227853247243616297'
}
});
const info = {
host: "2.tcp.ngrok.io",
port: 13497,
auth: "youshallnotpass"
};

client.lavaclient = new Node({
info,
ws: {
// userId: '1227853247243616297',
clientName: "my very cool bot",
resuming: false | { timeout: 30_000 },
reconnecting: {
tries: 3,
delay: (attempt) => attempt * 1_000
}
},
rest: {
enableTrace: true,
fetch: fetch,
userAgent: "my very cool bot (v1.0.0, <user id>)"
},
discord: {
sendGatewayCommand: (id, payload) => {
const guild = client.guilds.cache.get(id);
console.log(guild);
if (guild) guild.shard.send(payload);
},
userId: '1227853247243616297'
}
});
it is logging out the guild,
<ref *2> Guild {
id: '1227852145404153917',
name: 'Airon Bot Test',
icon: null,
features: [],
commands: <ref *1> GuildApplicationCommandManager {
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *1],
guild: [Circular *2],
guildId: '1227852145404153917',
commandId: null
},
guild: [Circular *2]
},
// All other stuffs
}
<ref *2> Guild {
id: '1227852145404153917',
name: 'Airon Bot Test',
icon: null,
features: [],
commands: <ref *1> GuildApplicationCommandManager {
permissions: ApplicationCommandPermissionsManager {
manager: [Circular *1],
guild: [Circular *2],
guildId: '1227852145404153917',
commandId: null
},
guild: [Circular *2]
},
// All other stuffs
}
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
ONE
const voiceStateUpdate = require('./WebSocketEvents/VoiceStateUpdate.js');
const voiceServerUpdate = require('./WebSocketEvents/VoiceServerUpdate.js');

client.ws.on(Discord.GatewayDispatchEvents.VoiceStateUpdate, (data) => {
// console.log("VoiceStateUpdate");
voiceStateUpdate.execute(client, data);
});
client.ws.on(Discord.GatewayDispatchEvents.VoiceServerUpdate, (data) => {
// console.log("VoiceServerUpdate");
voiceServerUpdate.execute(client, data);
});
const voiceStateUpdate = require('./WebSocketEvents/VoiceStateUpdate.js');
const voiceServerUpdate = require('./WebSocketEvents/VoiceServerUpdate.js');

client.ws.on(Discord.GatewayDispatchEvents.VoiceStateUpdate, (data) => {
// console.log("VoiceStateUpdate");
voiceStateUpdate.execute(client, data);
});
client.ws.on(Discord.GatewayDispatchEvents.VoiceServerUpdate, (data) => {
// console.log("VoiceServerUpdate");
voiceServerUpdate.execute(client, data);
});
TWO
// Event Handler
console.log('Loading Events');
const events = fs.readdirSync('./bots/music-bot/events/').filter((file) => file.endsWith('.js'));
for (const file of events) {
const event = require(`./events/${file}`);
// console.log(event);
// console.log(event.name);
client.on(file.split('.')[0], event.execute.bind(null, client));
delete require.cache[require.resolve(`./events/${file}`)];
}
// Event Handler
console.log('Loading Events');
const events = fs.readdirSync('./bots/music-bot/events/').filter((file) => file.endsWith('.js'));
for (const file of events) {
const event = require(`./events/${file}`);
// console.log(event);
// console.log(event.name);
client.on(file.split('.')[0], event.execute.bind(null, client));
delete require.cache[require.resolve(`./events/${file}`)];
}
These both are in index.js, one handles the websocket events such as VoiceStateUpdate, VoiceServerUpdate, and two handles the normal events such as messageCreate, ready etc,
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
I have different handler for the files in events, and the files in WebSocketEvents, both in index.js
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
This is my folder structure
- root
|- commands
| |- play.js
| |- skip.js
| |- volume.js
| |- queue.js
|
|- events
| |- guildCreate.js
| |- interactionCreate.js
| |- messageCreate.js
| |- ready.js
|
|- utils
| |- components.js
| |- constants.js
| |- functions.js
| |- logger.js
| |- registerSlash.js
|
|- WebSocketEvents
| |- voiceServerUpdate.js
| |- voiceStateUpdate.js
|
|- index.js
|- README.md
|- express.js
|- config.json
- root
|- commands
| |- play.js
| |- skip.js
| |- volume.js
| |- queue.js
|
|- events
| |- guildCreate.js
| |- interactionCreate.js
| |- messageCreate.js
| |- ready.js
|
|- utils
| |- components.js
| |- constants.js
| |- functions.js
| |- logger.js
| |- registerSlash.js
|
|- WebSocketEvents
| |- voiceServerUpdate.js
| |- voiceStateUpdate.js
|
|- index.js
|- README.md
|- express.js
|- config.json
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
wait, I will send you the folder structure
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
I have event hander for both normal events and websocketevents in index.js
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
const events = fs.readdirSync('./bots/music-bot/events/').filter((file)
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
No, I don't have VoiceServerUpdate in there, this handler only handles the files in events folder, and I have VoiceServerUpdate in WebSocketEvents folder
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
oh lol, I also have this is my index.js
// Event Handler
console.log('Loading Events');
const events = fs.readdirSync('./bots/music-bot/events/').filter((file) => file.endsWith('.js'));
for (const file of events) {
const event = require(`./events/${file}`);
// console.log(event);
// console.log(event.name);
client.on(file.split('.')[0], event.execute.bind(null, client));
delete require.cache[require.resolve(`./events/${file}`)];
}
// Event Handler
console.log('Loading Events');
const events = fs.readdirSync('./bots/music-bot/events/').filter((file) => file.endsWith('.js'));
for (const file of events) {
const event = require(`./events/${file}`);
// console.log(event);
// console.log(event.name);
client.on(file.split('.')[0], event.execute.bind(null, client));
delete require.cache[require.resolve(`./events/${file}`)];
}
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
I have this is my index.js
const voiceStateUpdate = require('./WebSocketEvents/VoiceStateUpdate.js');
const voiceServerUpdate = require('./WebSocketEvents/VoiceServerUpdate.js');

client.ws.on(Discord.GatewayDispatchEvents.VoiceStateUpdate, (data) => {
// console.log("VoiceStateUpdate");
voiceStateUpdate.execute(client, data);
});
client.ws.on(Discord.GatewayDispatchEvents.VoiceServerUpdate, (data) => {
// console.log("VoiceServerUpdate");
voiceServerUpdate.execute(client, data);
});
const voiceStateUpdate = require('./WebSocketEvents/VoiceStateUpdate.js');
const voiceServerUpdate = require('./WebSocketEvents/VoiceServerUpdate.js');

client.ws.on(Discord.GatewayDispatchEvents.VoiceStateUpdate, (data) => {
// console.log("VoiceStateUpdate");
voiceStateUpdate.execute(client, data);
});
client.ws.on(Discord.GatewayDispatchEvents.VoiceServerUpdate, (data) => {
// console.log("VoiceServerUpdate");
voiceServerUpdate.execute(client, data);
});
and in WebSocketEvents/VoiceStateUpdate.js, I have this, this is all codes in the file
const { Events, GatewayDispatchEvents } = require('discord.js');

module.exports = {
name: GatewayDispatchEvents.VoiceStateUpdate,
execute: async (client, data) => {
console.log("VoiceStateUpdate");
client.lavaclient.players.handleVoiceUpdate(data);
},
};
const { Events, GatewayDispatchEvents } = require('discord.js');

module.exports = {
name: GatewayDispatchEvents.VoiceStateUpdate,
execute: async (client, data) => {
console.log("VoiceStateUpdate");
client.lavaclient.players.handleVoiceUpdate(data);
},
};
and similar is for VoiceServerUpdate
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
Yeah, did it and still no result
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
I didn't understand
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
:AHHHH:
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
yeah, did it and still not playing
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
What to do next ?
77 replies
DFDimensional Fun
Created by arpos on 5/1/2024 in #lavaclient
not playing
Yeah, lol. Sorry for confusion
77 replies