This commit is contained in:
MatteZ02
2020-03-02 21:38:42 +02:00
commit a96305e807
29 changed files with 599 additions and 0 deletions

View File

@ -0,0 +1,20 @@
module.exports = async function (client, reason, guild) {
const radio = client.radio.get(guild.id);
radio.playing = false;
if (reason === "Stream is not generating quickly enough.") {
console.log("Song ended");
} else if (reason === "seek") {
return;
} else {
console.log(reason);
}
if (!radio.songLooping) {
if (radio.looping) {
radio.songs.push(radio.songs[0]);
}
radio.votes = 0;
radio.voters = [];
radio.songs.shift();
}
client.funcs.play(guild, radio.songs[0], client, 0, true);
};

27
events/msg.js Normal file
View File

@ -0,0 +1,27 @@
module.exports = {
name: 'message',
async execute(client, msg, Discord) {
if (msg.author.bot || !msg.guild) return;
let prefix = client.config.prefix
if (client.config.devMode) prefix = client.config.devPrefix;
const args = msg.content.slice(prefix.length).split(' ');
if (msg.mentions.users.first()) {
if (msg.mentions.users.first().id === client.user.id) {
if (!args[1]) return;
if (args[1] === 'prefix') return msg.channel.send(`My prefix here is: \`${prefix}\`.`);
if (args[1] === 'help') {
const command = client.commands.get("help");
return client.funcs.exe(msg, args, client, Discord, prefix, command);
}
}
}
if (!msg.content.startsWith(prefix)) return;
if (!args[0]) return;
const commandName = args[0].toLowerCase();
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName);
if (!command && msg.content !== `${prefix}`) return;
if (command.onlyDev && msg.author.id !== client.config.devId) return msg.channel.send('<:redx:674263474704220182> You are not allowed to do that!');
if (client.config.devMode && msg.member.id !== client.config.devId) return msg.channel.send('<:redx:674263474704220182> Dev mode has been turned on! Commands are only available to developer(s)!');
client.funcs.exe(msg, args, client, Discord, prefix, command);
}
}

14
events/ready.js Normal file
View File

@ -0,0 +1,14 @@
module.exports = {
name: 'ready',
async execute(client, Discord) {
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);
}
}

View File

@ -0,0 +1,13 @@
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!`);
}
}
}
}