1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-07-31 07:24:33 +00:00

updated all commands and removed some weird files

This commit is contained in:
MatteZ02
2019-08-14 15:26:33 +03:00
parent 29b40867a3
commit 9d7e55b5ee
1058 changed files with 170671 additions and 70 deletions

12
commands/bug.js Normal file
View File

@@ -0,0 +1,12 @@
module.exports = {
name: 'bug',
description: 'Report a bug',
cooldown: 5,
async execute(msg, args, client, RichEmbed) {
const embed = new RichEmbed()
.setTitle(`Found a bug with ${client.user.username}?\nDM the core developer:`)
.setDescription(`Matte#5254\nOr join the support server: https://discord.gg/rvHuJtB`)
.setColor('#b50002');
msg.channel.send(embed);
},
};

23
commands/eval.js Normal file
View File

@@ -0,0 +1,23 @@
module.exports = {
name: 'eval',
description: 'Evaluation command',
cooldown: 5,
async execute(message, args, client, RichEmbed) {
const serverQueue = client.queue.get(message.guild.id);
const status = process.env.hosted
if (message.author.id !== '360363051792203779') return message.channel.send(':x: You are not allowed to do that!');
const input = message.content.slice(6)
let output;
try {
output = await eval(input);
} catch (error) {
output = error.toString();
embed.setColor('#FF0000');
}
const embed = new RichEmbed()
.setTitle('Evaluation Command')
.setColor('#b50002')
.setDescription(`Input: \`\`\`js\n${input.replace(/; /g, ';').replace(/;/g, ';\n')}\n\`\`\`\nOutput: \`\`\`\n${output}\n\`\`\``);
return message.channel.send(embed);
},
};

View File

@@ -2,21 +2,22 @@ module.exports = {
name: 'help',
description: 'Help command.',
cooldown: 5,
execute(message, args, client, RichEmbed) {
execute(message, args, client, RichEmbed, prefix) {
const embed = new RichEmbed()
.setTitle('Commands for Musix!')
.addField('```-play | -p```', 'Play a song.', true)
.addField('```-queue | -q```', 'Display the queue.', true)
.addField('```-nowplaying | -np```', 'Display whats currently playing.', true)
.addField('```-volume```', 'Change or check the volume.', true)
.addField('```-pause```', 'Pause the music.', true)
.addField('```-resume```', 'Resume the music.', true)
.addField('```-stop```', 'Stop the music, Clear the queue and leave the current voice channel.', true)
.addField('```-skip | -s```', 'Skip a song.', true)
.addField('```-invite```', 'Invite Musix.', true)
.addField('```-ping```', 'See the current ping for Musix', true)
.addField('```-info```', 'Display the info', true)
.addField('```-help```', 'Display the help.', true)
.addField(`${prefix}play | ${prefix}p`, 'Play a song.', true)
.addField(`${prefix}queue | ${prefix}q`, 'Display the queue.', true)
.addField(`${prefix}nowplaying | ${prefix}np`, 'Display whats currently playing.', true)
.addField(`${prefix}volume`, 'Change or check the volume.', true)
.addField(`${prefix}pause`, 'Pause the music.', true)
.addField(`${prefix}resume`, 'Resume the music.', true)
.addField(`${prefix}stop`, 'Stop the music, Clear the queue and leave the current voice channel.', true)
.addField(`${prefix}skip | ${prefix}s`, 'Skip a song.', true)
.addField(`${prefix}invite`, 'Invite Musix.', true)
.addField(`${prefix}ping`, 'See the current ping for Musix', true)
.addField(`${prefix}bug`, 'Report a bug.', true)
.addField(`${prefix}settings`, 'Change the guild specific settings.', true)
.addField(`${prefix}help`, 'Display the help.', true)
.setAuthor(client.user.username, client.user.displayAvatarURL)
.setColor('#b50002')
return message.channel.send(embed);

View File

@@ -1,16 +0,0 @@
module.exports = {
name: 'info',
description: 'Info command.',
cooldown: 5,
execute(message, args, client, RichEmbed) {
const embed = new RichEmbed()
.setTitle('**Musix instructions and info**:')
.addField('If you encounter any errors with musix please report about them on the offical musix support server!', 'https://discord.gg/rvHuJtB', true)
.addField('On errors you can do -stop to reset the queue and try again!', 'To use all commands make sure you have `MANAGE_MESSAGES` and `MANAGE_CHANNELS` permissions!')
.addField('Current Ping', `${Math.floor(client.ping * 10) / 10} ms`, true)
.addField('Be careful with the Volume command! Volume is not recommended to be put over 3 with user volume at 100%!', 'Volume will reset to 1 always when a new song begins!', true)
.setAuthor(client.user.username, client.user.displayAvatarURL)
.setColor('#b50002')
return message.channel.send(embed);
}
};

View File

@@ -2,9 +2,23 @@ module.exports = {
name: 'nowplaying',
description: 'Now playing command.',
cooldown: 5,
execute(message, args, client, RichEmbed) {
async execute(message, args, client, RichEmbed) {
const ytdl = require('ytdl-core')
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
return message.channel.send(`🎶 Now playing: **${serverQueue.songs[0].title}**`);
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
let songtime = (data.length_seconds * 1000).toFixed(0);
let completed = (serverQueue.connection.dispatcher.time).toFixed(0);
let barlength = 30;
let completedpercent = ((completed / songtime) * barlength).toFixed(0);
let array = []; for (let i = 0; i < completedpercent - 1; i++) { array.push('⎯'); } array.push('⭗'); for (let i = 0; i < barlength - completedpercent - 1; i++) { array.push('⎯'); }
const totallength = Math.floor(data.length_seconds / 60) + ':' + (data.length_seconds - (Math.floor(data.length_seconds / 60) * 60))
const timeins = serverQueue.connection.dispatcher.time / 1000
const timepassed = Math.floor(timeins / 60) + ':' + Math.round(timeins - (Math.floor(timeins / 60) * 60))
const embed = new RichEmbed()
.setTitle("__Now playing__")
.setDescription(`🎶**Now playing:** ${serverQueue.songs[0].title}\n${array.join('')} | \`${timepassed} / ${totallength}\``)
.setColor("#b50002")
return message.channel.send(embed);
}
};

View File

@@ -2,9 +2,23 @@ module.exports = {
name: 'np',
description: 'Now playing command.',
cooldown: 5,
execute(message, args, client, RichEmbed) {
async execute(message, args, client, RichEmbed) {
const ytdl = require('ytdl-core')
const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
return message.channel.send(`🎶 Now playing: **${serverQueue.songs[0].title}**`);
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
let songtime = (data.length_seconds * 1000).toFixed(0);
let completed = (serverQueue.connection.dispatcher.time).toFixed(0);
let barlength = 30;
let completedpercent = ((completed / songtime) * barlength).toFixed(0);
let array = []; for (let i = 0; i < completedpercent - 1; i++) { array.push('⎯'); } array.push('⭗'); for (let i = 0; i < barlength - completedpercent - 1; i++) { array.push('⎯'); }
const totallength = Math.floor(data.length_seconds / 60) + ':' + (data.length_seconds - (Math.floor(data.length_seconds / 60) * 60))
const timeins = serverQueue.connection.dispatcher.time / 1000
const timepassed = Math.floor(timeins / 60) + ':' + Math.round(timeins - (Math.floor(timeins / 60) * 60))
const embed = new RichEmbed()
.setTitle("__Now playing__")
.setDescription(`🎶**Now playing:** ${serverQueue.songs[0].title}\n${array.join('')} | \`${timepassed} / ${totallength}\``)
.setColor("#b50002")
return message.channel.send(embed);
}
};

View File

@@ -1,5 +1,4 @@
const YouTube = require("simple-youtube-api");
const youtube = new YouTube(process.env.API_KEY);
module.exports = {
name: 'p',
@@ -8,6 +7,7 @@ module.exports = {
args: true,
cooldown: 3,
async execute(message, args, client, RichEmbed) {
const youtube = new YouTube(client.config.apikey);
const searchString = args.slice(1).join(" ");
const url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : "";
const serverQueue = client.queue.get(message.guild.id);

View File

@@ -6,11 +6,13 @@ module.exports = {
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (serverQueue && serverQueue.playing === true) {
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to pause the music!');
if (message.author.id !== '360363051792203779') {
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to pause the music!');
}
serverQueue.playing = false;
serverQueue.connection.dispatcher.pause();
return message.channel.send('⏸ Paused the music for you!');
}
return message.channel.send('There is nothing playing.');
return message.channel.send(':x: There is nothing playing.');
}
};

View File

@@ -1,5 +1,4 @@
const YouTube = require("simple-youtube-api");
const youtube = new YouTube(process.env.API_KEY);
module.exports = {
name: 'play',
@@ -8,6 +7,7 @@ module.exports = {
args: true,
cooldown: 3,
async execute(message, args, client, RichEmbed) {
const youtube = new YouTube(client.config.apikey);
const searchString = args.slice(1).join(" ");
const url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : "";
const serverQueue = client.queue.get(message.guild.id);

View File

@@ -6,7 +6,9 @@ module.exports = {
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (serverQueue && !serverQueue.playing) {
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to resume the music!');
if (message.author.id !== '360363051792203779') {
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to resume the music!');
}
serverQueue.playing = true;
serverQueue.connection.dispatcher.resume();
return message.channel.send('▶ Resumed the music for you!');

View File

@@ -6,9 +6,11 @@ module.exports = {
const { voiceChannel } = message.member;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to skip songs!');
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could skip for you.');
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to skip songs!');
if (message.author.id !== '360363051792203779') {
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to skip songs!');
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to skip songs!');
}
message.channel.send(':fast_forward: Skipped the song for you!');
serverQueue.connection.dispatcher.end('Skip command has been used!');
}

27
commands/settings.js Normal file
View File

@@ -0,0 +1,27 @@
module.exports = {
name: 'settings',
usage: '[setting]',
description: 'Change the settings',
cooldown: 5,
async execute(message, args, client, RichEmbed, prefix) {
const permissions = message.channel.permissionsFor(message.author);
if (message.author.id !== '360363051792203779') {
if (!permissions.has('MANAGE_GUILD')) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to change the settings!');
}
if (!args[1]) {
const embed = new RichEmbed()
.setTitle('Guild settings for Musix')
.addField('prefix', 'Change the guild specific prefix.', true)
.setFooter(`how to use: ${prefix}settings <Setting name> <value>`)
.setAuthor(client.user.username, client.user.displayAvatarURL)
.setColor('#b50002')
return message.channel.send(embed);
}
if (args[1] === 'prefix') {
if (!args[2]) return message.channel.send(':x: You need to define the prefix!');
if (args[2].length > 5) return message.channel.send(':x: The prefix must be less than or equal to 5 characters');
await client.setPrefix(args[2], message.guild.id);
message.channel.send(`:white_check_mark: New prefix set: \`${args[2]}\`\n${client.global.replies.fiveMinutes}`);
}
},
};

View File

@@ -6,9 +6,11 @@ module.exports = {
const { voiceChannel } = message.member;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to skip songs!');
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could skip for you.');
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to skip songs!');
if (message.author.id !== '360363051792203779') {
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to skip songs!');
if (!permissions.has('MANAGE_MESSAGES')) return message.channel.send(':x: You need the `MANAGE_MESSAGES` permission to skip songs!');
}
message.channel.send(':fast_forward: Skipped the song for you!');
serverQueue.connection.dispatcher.end('Skip command has been used!');
}

View File

@@ -6,9 +6,11 @@ module.exports = {
const { voiceChannel } = message.member;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to stop the music!');
if (!serverQueue) return message.channel.send(':x: There is nothing playing that I could stop for you.');
if (!permissions.has('MANAGE_CHANNELS')) return message.channel.send(':x: You need the `MANAGE_CHANNELS` permission to stop the music!');
if (message.author.id !== '360363051792203779') {
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to stop the music!');
if (!permissions.has('MANAGE_CHANNELS')) return message.channel.send(':x: You need the `MANAGE_CHANNELS` permission to stop the music!');
}
serverQueue.songs = [];
serverQueue.connection.dispatcher.end('Stop command has been used!');
message.channel.send(':stop_button: Stopped the music for you!')

View File

@@ -6,11 +6,13 @@ module.exports = {
const { voiceChannel } = message.member;
const serverQueue = client.queue.get(message.guild.id);
const permissions = message.channel.permissionsFor(message.author);
if (message.author.id === '384002606621655040') return msg.channel.send('You are not doying that!');
if (message.author.id === '384002606621655040') return message.channel.send('You are not doying that!');
if (!serverQueue) return message.channel.send(':x: There is nothing playing.');
if (!args[1]) return message.channel.send(`:loud_sound: The current volume is: **${serverQueue.volume}**`);
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to change the volume!');
if (!permissions.has('MANAGE_CHANNELS')) return message.channel.send(':x: You need the `MANAGE_CHANNELS` permission to change the volume!');
if (message.author.id !== '360363051792203779') {
if (!voiceChannel) return message.channel.send(':x: I\'m sorry but you need to be in a voice channel to change the volume!');
if (!permissions.has('MANAGE_CHANNELS')) return message.channel.send(':x: You need the `MANAGE_CHANNELS` permission to change the volume!');
}
if (isNaN(args[1])) return msg.channel.send(':x: I\'m sorry, But you need to enter a valid __number__.');
serverQueue.volume = args[1]; // eslint-disable-line
serverQueue.connection.dispatcher.setVolumeLogarithmic(args[1] / 5);