mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 12:23:38 +00:00
Large update
This commit is contained in:
@ -1,14 +1,11 @@
|
||||
module.exports = {
|
||||
name: 'ready',
|
||||
async execute(client, Discord) {
|
||||
const debugChannel = await client.channels.fetch(client.config.debug_channel);
|
||||
client.debug_channel = debugChannel
|
||||
if (client.config.devMode) {
|
||||
console.log('dev mode');
|
||||
}
|
||||
client.user.setActivity(`@${client.user.username} help | 🎶`, { type: 'LISTENING' });
|
||||
client.user.setStatus('online');
|
||||
console.log('- Activated -');
|
||||
setInterval(() => {
|
||||
client.funcs.ffmpeg(client, Discord);
|
||||
}, 7200000);
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,32 @@
|
||||
module.exports = {
|
||||
name: 'voiceStateUpdate',
|
||||
async execute(client, newMember) {
|
||||
const serverQueue = client.radio.get(newMember.guild.id);
|
||||
if (!serverQueue) return;
|
||||
if (newMember === client.user) {
|
||||
if (newMember.voice.channel !== serverQueue.voiceChannel) {
|
||||
serverQueue.voiceChannel = newMember.voice.channel;
|
||||
console.log(`Changed serverQueue voiceChannel since Musix was moved to a different channel!`);
|
||||
async execute(client, oldState, newState) {
|
||||
let change = false;
|
||||
const radio = client.radio.get(newState.guild.id);
|
||||
if (!radio) return;
|
||||
if (newState.member.id === client.user.id && oldState.member.id === client.user.id) {
|
||||
if (newState.member.voice.channel === null) {
|
||||
radio.songs = [];
|
||||
radio.looping = false;
|
||||
radio.endReason = "manual disconnect";
|
||||
return client.queue.delete(newState.guild.id);
|
||||
}
|
||||
if (newState.member.voice.channel !== radio.voiceChannel) {
|
||||
change = true;
|
||||
radio.voiceChannel = newState.member.voice.channel;
|
||||
radio.connection = newState.connection;
|
||||
}
|
||||
}
|
||||
if (oldState.channel === null) return;
|
||||
if (oldState.channel.members.size === 1 && oldState.channel === radio.voiceChannel || change) {
|
||||
setTimeout(() => {
|
||||
if (!radio) return;
|
||||
if (radio.voiceChannel.members.size === 1) {
|
||||
radio.songs = [];
|
||||
radio.looping = false;
|
||||
radio.connection.dispatcher.end();
|
||||
}
|
||||
}, 12000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user