Update (v6.0.0)

This commit is contained in:
Zerio
2021-09-23 22:22:33 +02:00
parent 4c2069cdf9
commit 5dcf2affc8
45 changed files with 418 additions and 465 deletions

View File

@@ -1,48 +1,25 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: 'help',
aliases: ['h'],
category: 'Core',
utilisation: '{prefix}help <command name>',
showHelp: false,
utilisation: '{prefix}help',
execute(client, message, args) {
if (!args[0]) {
const infos = message.client.commands.filter(x => x.category == 'Infos').map((x) => '`' + x.name + '`').join(', ');
const music = message.client.commands.filter(x => x.category == 'Music').map((x) => '`' + x.name + '`').join(', ');
const embed = new MessageEmbed();
message.channel.send({
embed: {
color: 'ORANGE',
author: { name: 'Help pannel' },
footer: { text: 'This bot uses a Github project made by Zerio (ZerioDev/Music-bot)' },
fields: [
{ name: 'Bot', value: infos },
{ name: 'Music', value: music },
{ name: 'Filters', value: client.filters.map((x) => '`' + x + '`').join(', ') },
],
timestamp: new Date(),
description: `To use filters, ${client.config.discord.prefix}filter (the filter). Example : ${client.config.discord.prefix}filter 8D.`,
},
});
} else {
const command = message.client.commands.get(args.join(" ").toLowerCase()) || message.client.commands.find(x => x.aliases && x.aliases.includes(args.join(" ").toLowerCase()));
embed.setColor('RED');
embed.setAuthor(client.user.username, client.user.displayAvatarURL({ size: 1024, dynamic: true }));
if (!command) return message.channel.send(`${client.emotes.error} - I did not find this command !`);
const commands = client.commands.filter(x => x.showHelp !== false);
message.channel.send({
embed: {
color: 'ORANGE',
author: { name: 'Help pannel' },
footer: { text: 'This bot uses a Github project made by Zerio (ZerioDev/Music-bot)' },
fields: [
{ name: 'Name', value: command.name, inline: true },
{ name: 'Category', value: command.category, inline: true },
{ name: 'Aliase(s)', value: command.aliases.length < 1 ? 'None' : command.aliases.join(', '), inline: true },
{ name: 'Utilisation', value: command.utilisation.replace('{prefix}', client.config.discord.prefix), inline: true },
],
timestamp: new Date(),
description: 'Find information on the command provided.\nMandatory arguments `[]`, optional arguments `<>`.',
}
});
};
embed.setDescription('This code comes from a GitHub project (ZerioDev/Music-bot).\nThe use of this one is possible while keeping the credits for free.\nIf you want to remove the credits join the Discord support server.');
embed.addField(`Enabled - ${commands.size}`, commands.map(x => `\`${x.name}${x.aliases[0] ? ` (${x.aliases.map(y => y).join(', ')})\`` : '\`'}`).join(' | '));
embed.setTimestamp();
embed.setFooter('Music comes first - Made with heart by Zerio ❤️', message.author.avatarURL({ dynamic: true }));
message.channel.send({ embeds: [embed] });
},
};

11
commands/core/ping.js Normal file
View File

@@ -0,0 +1,11 @@
const ms = require('ms');
module.exports = {
name: 'ping',
aliases: [],
utilisation: '{prefix}ping',
execute(client, message) {
message.channel.send(`Last heartbeat calculated ${ms(Date.now() - client.ws.shards.first().lastPingTimestamp, { long: true })} ago **${client.ws.ping}ms** 🛰️`);
},
};

View File

@@ -1,10 +0,0 @@
module.exports = {
name: 'debug',
aliases: [],
category: 'Infos',
utilisation: '{prefix}debug',
execute(client, message) {
message.channel.send(`${client.emotes.success} - ${client.user.username} connected in **${client.voice.connections.size}** channels !`);
},
};

View File

@@ -1,10 +0,0 @@
module.exports = {
name: 'ping',
aliases: [],
category: 'Infos',
utilisation: '{prefix}ping',
execute(client, message) {
message.channel.send(`${client.emotes.success} - Ping : **${client.ws.ping}ms** !`);
},
};

18
commands/music/back.js Normal file
View File

@@ -0,0 +1,18 @@
module.exports = {
name: 'back',
aliases: ['previous'],
utilisation: '{prefix}back',
voiceChannel: true,
async execute(client, message) {
const queue = player.getQueue(message.guild.id);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!queue.previousTracks[1]) return message.channel.send(`There was no music played before ${message.author}... try again ? ❌`);
await queue.back();
message.channel.send(`Playing the **previous** track ✅`);
},
};

View File

@@ -1,20 +0,0 @@
module.exports = {
name: 'clear-queue',
aliases: ['cq'],
category: 'Music',
utilisation: '{prefix}clear-queue',
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
if (client.player.getQueue(message).tracks.length <= 1) return message.channel.send(`${client.emotes.error} - There is only one song in the queue.`);
client.player.clearQueue(message);
message.channel.send(`${client.emotes.success} - The queue has just been **removed** !`);
},
};

18
commands/music/clear.js Normal file
View File

@@ -0,0 +1,18 @@
module.exports = {
name: 'clear',
aliases: ['cq'],
utilisation: '{prefix}clear',
voiceChannel: true,
async execute(client, message) {
const queue = player.getQueue(message.guild.id);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!queue.tracks[0]) return message.channel.send(`No music in the queue after the current one ${message.author}... try again ? ❌`);
await queue.clear();
message.channel.send(`The queue has just been cleared 🗑️`);
},
};

View File

@@ -1,29 +1,33 @@
module.exports = {
name: 'filter',
aliases: [],
category: 'Music',
utilisation: '{prefix}filter [filter name]',
voiceChannel: true,
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
async execute(client, message, args) {
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const actualFilter = queue.getFiltersEnabled()[0];
if (!args[0]) return message.channel.send(`${client.emotes.error} - Please specify a valid filter to enable or disable !`);
if (!args[0]) return message.channel.send(`Please specify a valid filter to enable or disable ${message.author}... try again ? ❌\n${actualFilter ? `Filter currently active ${actualFilter} (${client.config.app.px}filter ${actualFilter} to disable it).\n` : ''}`);
const filterToUpdate = client.filters.find((x) => x.toLowerCase() === args[0].toLowerCase());
const filters = [];
if (!filterToUpdate) return message.channel.send(`${client.emotes.error} - This filter doesn't exist, try for example (8D, vibrato, pulsator...) !`);
queue.getFiltersEnabled().map(x => filters.push(x));
queue.getFiltersDisabled().map(x => filters.push(x));
const filter = filters.find((x) => x.toLowerCase() === args[0].toLowerCase());
if (!filter) return message.channel.send(`This filter doesn't exist ${message.author}... try again ? ❌\n${actualFilter ? `Filter currently active ${actualFilter}.\n` : ''}List of available filters ${filters.map(x => `**${x}**`).join(', ')}.`);
const filtersUpdated = {};
filtersUpdated[filterToUpdate] = client.player.getQueue(message).filters[filterToUpdate] ? false : true;
filtersUpdated[filter] = queue.getFiltersEnabled().includes(filter) ? false : true;
client.player.setFilters(message, filtersUpdated);
await queue.setFilters(filtersUpdated);
if (filtersUpdated[filterToUpdate]) message.channel.send(`${client.emotes.music} - I'm **adding** the filter to the music, please wait... Note : the longer the music is, the longer this will take.`);
else message.channel.send(`${client.emotes.music} - I'm **disabling** the filter on the music, please wait... Note : the longer the music is playing, the longer this will take.`);
message.channel.send(`The filter ${filter} is now **${queue.getFiltersEnabled().includes(filter) ? 'enabled' : 'disabled'}** ✅\n*Reminder the longer the music is, the longer this will take.*`);
},
};

View File

@@ -1,32 +1,28 @@
const { QueueRepeatMode } = require('discord-player');
module.exports = {
name: 'loop',
aliases: ['lp', 'repeat'],
category: 'Music',
utilisation: '{prefix}loop',
utilisation: '{prefix}loop <queue>',
voiceChannel: true,
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
if (args.join('').toLowerCase() === 'queue') {
if (queue.repeatMode === 1) return message.channel.send(`You must first disable the current music in the loop mode (${client.config.app.px}loop) ${message.author}... try again ? ❌`);
if (args.join(" ").toLowerCase() === 'queue') {
if (client.player.getQueue(message).loopMode) {
client.player.setLoopMode(message, false);
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
} else {
client.player.setLoopMode(message, true);
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** the whole queue will be repeated endlessly !`);
};
const success = queue.setRepeatMode(queue.repeatMode === 0 ? QueueRepeatMode.QUEUE : QueueRepeatMode.OFF);
return message.channel.send(success ? `Repeat mode **${queue.repeatMode === 0 ? 'disabled' : 'enabled'}** the whole queue will be repeated endlessly 🔁` : `Something went wrong ${message.author}... try again ? ❌`);
} else {
if (client.player.getQueue(message).repeatMode) {
client.player.setRepeatMode(message, false);
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
} else {
client.player.setRepeatMode(message, true);
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** the current music will be repeated endlessly !`);
};
if (queue.repeatMode === 2) return message.channel.send(`You must first disable the current queue in the loop mode (${client.config.app.px}loop queue) ${message.author}... try again ? ❌`);
const success = queue.setRepeatMode(queue.repeatMode === 0 ? QueueRepeatMode.TRACK : QueueRepeatMode.OFF);
return message.channel.send(success ? `Repeat mode **${queue.repeatMode === 0 ? 'disabled' : 'enabled'}** the current music will be repeated endlessly (you can loop the queue with the <queue> option) 🔂` : `Something went wrong ${message.author}... try again ? ❌`);
};
},
};

View File

@@ -1,44 +1,31 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: 'nowplaying',
aliases: ['np'],
category: 'Music',
utilisation: '{prefix}nowplaying',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const track = queue.current;
const track = client.player.nowPlaying(message);
const filters = [];
const embed = new MessageEmbed();
Object.keys(client.player.getQueue(message).filters).forEach((filterName) => client.player.getQueue(message).filters[filterName]) ? filters.push(filterName) : false;
embed.setColor('RED');
embed.setThumbnail(track.thumbnail);
embed.setAuthor(track.title, client.user.displayAvatarURL({ size: 1024, dynamic: true }));
message.channel.send({
embed: {
color: 'RED',
author: { name: track.title },
footer: { text: 'This bot uses a Github project made by Zerio (ZerioDev/Music-bot)' },
fields: [
{ name: 'Channel', value: track.author, inline: true },
{ name: 'Requested by', value: track.requestedBy.username, inline: true },
{ name: 'From playlist', value: track.fromPlaylist ? 'Yes' : 'No', inline: true },
const methods = ['disabled', 'track', 'queue'];
{ name: 'Views', value: track.views, inline: true },
{ name: 'Duration', value: track.duration, inline: true },
{ name: 'Filters activated', value: filters.length + '/' + client.filters.length, inline: true },
embed.setDescription(`Volume **${queue.volume}**%\nDuration **${track.duration}**\nLoop mode **${methods[queue.repeatMode]}**\nRequested by ${track.requestedBy}`);
{ name: 'Volume', value: client.player.getQueue(message).volume, inline: true },
{ name: 'Repeat mode', value: client.player.getQueue(message).repeatMode ? 'Yes' : 'No', inline: true },
{ name: 'Currently paused', value: client.player.getQueue(message).paused ? 'Yes' : 'No', inline: true },
embed.setTimestamp();
embed.setFooter('Music comes first - Made with heart by Zerio ❤️', message.author.avatarURL({ dynamic: true }));
{ name: 'Progress bar', value: client.player.createProgressBar(message, { timecodes: true }), inline: true }
],
thumbnail: { url: track.thumbnail },
timestamp: new Date(),
},
});
message.channel.send({ embeds: [embed] });
},
};

View File

@@ -1,20 +1,16 @@
module.exports = {
name: 'pause',
aliases: [],
category: 'Music',
utilisation: '{prefix}pause',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const success = queue.setPaused(true);
if (client.player.getQueue(message).paused) return message.channel.send(`${client.emotes.error} - The music is already paused !`);
const success = client.player.pause(message);
if (success) message.channel.send(`${client.emotes.success} - Song ${client.player.getQueue(message).playing.title} paused !`);
return message.channel.send(success ? `Current music ${queue.current.title} paused ✅` : `Something went wrong ${message.author}... try again ? ❌`);
},
};

View File

@@ -1,16 +1,36 @@
const { QueryType } = require('discord-player');
module.exports = {
name: 'play',
aliases: ['p'],
category: 'Music',
utilisation: '{prefix}play [name/URL]',
utilisation: '{prefix}play [song name/URL]',
voiceChannel: true,
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
async execute(client, message, args) {
if (!args[0]) return message.channel.send(`Please enter a valid search ${message.author}... try again ? ❌`);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
const res = await player.search(args.join(' '), {
requestedBy: message.member,
searchEngine: QueryType.AUTO
});
if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song !`);
if (!res || !res.tracks.length) return message.channel.send(`No results found ${message.author}... try again ? ❌`);
client.player.play(message, args.join(" "), { firstResult: true });
const queue = await player.createQueue(message.guild, {
metadata: message.channel
});
try {
if (!queue.connection) await queue.connect(message.member.voice.channel);
} catch {
await player.deleteQueue(message.guild.id);
return message.channel.send(`I can't join the voice channel ${message.author}... try again ? ❌`);
}
await message.channel.send(`Loading your ${res.playlist ? 'playlist' : 'track'}... 🎧`);
res.playlist ? queue.addTracks(res.tracks) : queue.addTrack(res.tracks[0]);
if (!queue.playing) await queue.play();
},
};

View File

@@ -1,20 +1,35 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: 'queue',
aliases: [],
category: 'Music',
aliases: ['q'],
utilisation: '{prefix}queue',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
const queue = client.player.getQueue(message);
if (!queue.tracks[0]) return message.channel.send(`No music in the queue after the current one ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No songs currently playing !`);
const embed = new MessageEmbed();
const methods = ['', '🔁', '🔂'];
message.channel.send(`**Server queue - ${message.guild.name} ${client.emotes.queue} ${client.player.getQueue(message).loopMode ? '(looped)' : ''}**\nCurrent : ${queue.playing.title} | ${queue.playing.author}\n\n` + (queue.tracks.map((track, i) => {
return `**#${i + 1}** - ${track.title} | ${track.author} (requested by : ${track.requestedBy.username})`
}).slice(0, 5).join('\n') + `\n\n${queue.tracks.length > 5 ? `And **${queue.tracks.length - 5}** other songs...` : `In the playlist **${queue.tracks.length}** song(s)...`}`));
embed.setColor('RED');
embed.setThumbnail(message.guild.iconURL({ size: 2048, dynamic: true }));
embed.setAuthor(`Server queue - ${message.guild.name} ${methods[queue.repeatMode]}`, client.user.displayAvatarURL({ size: 1024, dynamic: true }));
const tracks = queue.tracks.map((track, i) => `**${i + 1}** - ${track.title} | ${track.author} (requested by : ${track.requestedBy.username})`);
const songs = queue.tracks.length;
const nextSongs = songs > 5 ? `And **${songs - 5}** other song(s)...` : `In the playlist **${songs}** song(s)...`;
embed.setDescription(`Current ${queue.current.title}\n\n${tracks.slice(0, 5).join('\n')}\n\n${nextSongs}`);
embed.setTimestamp();
embed.setFooter('Music comes first - Made with heart by Zerio ❤️', message.author.avatarURL({ dynamic: true }));
message.channel.send({ embeds: [embed] });
},
};

View File

@@ -1,20 +1,16 @@
module.exports = {
name: 'resume',
aliases: [],
category: 'Music',
aliases: ['rs'],
utilisation: '{prefix}resume',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const success = queue.setPaused(false);
if (!client.player.getQueue(message).paused) return message.channel.send(`${client.emotes.error} - The music is already playing !`);
const success = client.player.resume(message);
if (success) message.channel.send(`${client.emotes.success} - Song ${client.player.getQueue(message).playing.title} resumed !`);
return message.channel.send(success ? `Current music ${queue.current.title} resumed ✅` : `Something went wrong ${message.author}... try again ? ❌`);
},
};

18
commands/music/save.js Normal file
View File

@@ -0,0 +1,18 @@
module.exports = {
name: 'save',
aliases: ['sv'],
utilisation: '{prefix}save',
voiceChannel: true,
async execute(client, message) {
const queue = player.getQueue(message.guild.id);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
message.author.send(`You saved the track ${queue.current.title} | ${queue.current.author} from the server ${message.guild.name}`).then(() => {
message.channel.send(`I have sent you the title of the music by private messages ✅`);
}).catch(error => {
message.channel.send(`Unable to send you a private message ${message.author}... try again ? ❌`);
});
},
};

View File

@@ -1,16 +0,0 @@
module.exports = {
name: 'search',
aliases: ['sr'],
category: 'Music',
utilisation: '{prefix}search [name/URL]',
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song !`);
client.player.play(message, args.join(" "));
},
};

22
commands/music/seek.js Normal file
View File

@@ -0,0 +1,22 @@
const ms = require('ms');
module.exports = {
name: 'seek',
aliases: [],
utilisation: '{prefix}seek [time]',
voiceChannel: true,
async execute(client, message, args) {
const queue = player.getQueue(message.guild.id);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
const timeToMS = ms(args.join(' '));
if (timeToMS >= queue.current.durationMS) return message.channel.send(`The indicated time is higher than the total time of the current song ${message.author}... try again ? ❌\n*Try for example a valid time like **5s, 10s, 20 seconds, 1m**...*`);
await queue.seek(timeToMS);
message.channel.send(`Time set on the current song **${ms(timeToMS, { long: true })}** ✅`);
},
};

View File

@@ -1,18 +1,18 @@
module.exports = {
name: 'shuffle',
aliases: ['sh'],
category: 'Music',
utilisation: '{prefix}shuffle',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
async execute(client, message) {
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
if (!queue.tracks[0]) return message.channel.send(`No music in the queue after the current one ${message.author}... try again ? ❌`);
const success = client.player.shuffle(message);
await queue.shuffle();
if (success) message.channel.send(`${client.emotes.success} - Queue shuffled **${client.player.getQueue(message).tracks.length}** song(s) !`);
return message.channel.send(`Queue shuffled **${queue.tracks.length}** song(s) !`);
},
};

View File

@@ -1,18 +1,16 @@
module.exports = {
name: 'skip',
aliases: ['sk'],
category: 'Music',
utilisation: '{prefix}skip',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const success = queue.skip();
const success = client.player.skip(message);
if (success) message.channel.send(`${client.emotes.success} - The current music has just been **skipped** !`);
return message.channel.send(success ? `Current music ${queue.current.title} skipped ✅` : `Something went wrong ${message.author}... try again ? ❌`);
},
};

View File

@@ -1,19 +1,16 @@
module.exports = {
name: 'stop',
aliases: ['dc'],
category: 'Music',
utilisation: '{prefix}stop',
voiceChannel: true,
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
queue.destroy();
client.player.setRepeatMode(message, false);
const success = client.player.stop(message);
if (success) message.channel.send(`${client.emotes.success} - Music **stopped** into this server !`);
message.channel.send(`Music stopped into this server, see you next time ✅`);
},
};

View File

@@ -1,22 +1,26 @@
const maxVol = client.config.opt.maxVol;
module.exports = {
name: 'volume',
aliases: [],
category: 'Music',
utilisation: '{prefix}volume [1-100]',
aliases: ['vol'],
utilisation: `{prefix}volume [1-${maxVol}]`,
voiceChannel: true,
execute(client, message, args) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
const queue = player.getQueue(message.guild.id);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!queue || !queue.playing) return message.channel.send(`No music currently playing ${message.author}... try again ? ❌`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const vol = parseInt(args[0]);
if (!args[0] || isNaN(args[0]) || args[0] === 'Infinity') return message.channel.send(`${client.emotes.error} - Please enter a valid number !`);
if (!vol) return message.channel.send(`The current volume is ${queue.volume} 🔊\n*To change the volume enter a valid number between **1** and **${maxVol}**.*`);
if (Math.round(parseInt(args[0])) < 1 || Math.round(parseInt(args[0])) > 100) return message.channel.send(`${client.emotes.error} - Please enter a valid number (between 1 and 100) !`);
if (queue.volume === vol) return message.channel.send(`The volume you want to change is already the current one ${message.author}... try again ? ❌`);
const success = client.player.setVolume(message, parseInt(args[0]));
if (vol < 0 || vol > maxVol) return message.channel.send(`The specified number is not valid. Enter a number between **1** and **${maxVol}** ${message.author}... try again ? ❌`);
if (success) message.channel.send(`${client.emotes.success} - Volume set to **${parseInt(args[0])}%** !`);
const success = queue.setVolume(vol);
return message.channel.send(success ? `The volume has been modified to **${vol}**/**${maxVol}**% 🔊` : `Something went wrong ${message.author}... try again ? ❌`);
},
};

View File

@@ -1,34 +0,0 @@
module.exports = {
name: 'w-filters',
aliases: ['filters'],
category: 'Music',
utilisation: '{prefix}w-filters',
execute(client, message) {
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
const filtersStatuses = [[], []];
client.filters.forEach((filterName) => {
const array = filtersStatuses[0].length > filtersStatuses[1].length ? filtersStatuses[1] : filtersStatuses[0];
array.push(filterName.charAt(0).toUpperCase() + filterName.slice(1) + " : " + (client.player.getQueue(message).filters[filterName] ? client.emotes.success : client.emotes.off));
});
message.channel.send({
embed: {
color: 'ORANGE',
footer: { text: 'This bot uses a Github project made by Zerio (ZerioDev/Music-bot)' },
fields: [
{ name: 'Filters', value: filtersStatuses[0].join('\n'), inline: true },
{ name: '** **', value: filtersStatuses[1].join('\n'), inline: true },
],
timestamp: new Date(),
description: `List of all filters enabled or disabled.\nUse \`${client.config.discord.prefix}filter\` to add a filter to a song.`,
},
});
},
};