1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-16 18:56:00 +00:00

Update 3.0.3

All messages reworked.
This commit is contained in:
MatteZ02
2020-03-12 13:56:31 +02:00
parent f985744170
commit a64f9d2325
40 changed files with 249 additions and 157 deletions

View File

@ -9,14 +9,15 @@ module.exports = {
category: 'music',
execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
if (!args[1] && serverQueue) return msg.channel.send(`:loud_sound: The current bass is: **${serverQueue.bass}**`);
if (!args[1] && serverQueue) return msg.channel.send(`${client.messages.currentBass}**${serverQueue.bass}**`);
const bass = parseFloat(args[1]);
if (client.funcs.check(client, msg, command)) {
if (isNaN(bass)) return msg.channel.send('<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.');
if (bass > 100) return msg.channel.send('<:redx:674263474704220182> The max bass is `100`!');
if (bass < 0) return msg.channel.send('<:redx:674263474704220182> The volume needs to be a positive number!');
if (isNaN(bass)) return msg.channel.send(client.messages.validNumber);
if (bass > 100) return msg.channel.send(client.messages.maxBass);
if (bass < 0) return msg.channel.send(client.messages.positiveBass);
serverQueue.bass = bass;
return msg.channel.send(`<:volumehigh:674685637626167307> The bass level **${bass}** will be applied when the next song starts playing!`);
client.messages.bassApplied = client.messages.bassApplied.replace("%BASS%", bass);
return msg.channel.send(client.messages.bassApplied);
}
}
};

View File

@ -9,7 +9,7 @@ module.exports = {
async execute(msg, args, client, Discord, prefix) {
const embed = new Discord.MessageEmbed()
.setTitle(`Found a bug with ${client.user.username}?\nDM the core developer:`)
.setDescription(`Matte#0002\nOr join the support server: https://discord.gg/rvHuJtB`)
.setDescription(client.messages.bug)
.setColor(client.config.embedColor);
msg.channel.send(embed);
},

View File

@ -8,6 +8,6 @@ module.exports = {
category: 'util',
async execute(msg, args, client, Discord, prefix, command) {
client.queue.delete(msg.guild.id);
msg.channel.send('Queue deleted!');
msg.channel.send(client.messages.queueDeleted);
}
};

View File

@ -14,11 +14,11 @@ module.exports = {
if (serverQueue) {
serverQueue.connection = connection;
}
msg.channel.send(`<:green_check_mark:674265384777416705> Joined ${voiceChannel.name}!`);
msg.channel.send(`${client.messages.joined} ${voiceChannel.name}!`);
} catch (error) {
client.queue.delete(msg.guild.id);
client.channels.get(client.config.debug_channel).send("Error with connecting to voice channel: " + error);
return msg.channel.send(`<:redx:674263474704220182> An error occured: ${error}`);
client.channels.get(client.config.debug_channel).send(client.messages.errorConnecting + error);
return msg.channel.send(client.messages.error);
}
}
};

View File

@ -11,10 +11,10 @@ module.exports = {
if (client.funcs.check(client, msg, command)) {
if (!serverQueue.looping) {
serverQueue.looping = true;
msg.channel.send('<:repeat1:674685561377914892> Looping the queue now!');
msg.channel.send(client.messages.looping);
} else {
serverQueue.looping = false;
msg.channel.send('<:repeat1:674685561377914892> No longer looping the queue!');
msg.channel.send(client.messages.noLooping);
}
}
}

View File

@ -11,10 +11,11 @@ module.exports = {
if (client.funcs.check(client, msg, command)) {
if (!serverQueue.songLooping) {
serverQueue.songLooping = true;
msg.channel.send(`<:repeatsong:674685573419761716> Looping **${serverQueue.songs[0].title}** now!`);
client.messages.loopingSong = client.messages.loopingSong.replace("%TITLE%", serverQueue.songs[0].title);
msg.channel.send(client.messages.loopingSong);
} else {
serverQueue.songLooping = false;
msg.channel.send('<:repeatsong:674685573419761716> No longer looping the song!');
msg.channel.send(client.messages.noLoopingSong);
}
}
}

View File

@ -10,8 +10,7 @@ module.exports = {
const getThumb = require('video-thumbnail-url');
const ytdl = require('ytdl-core');
const serverQueue = client.queue.get(msg.guild.id);
if (!serverQueue) return msg.channel.send('<:redx:674263474704220182> There is nothing playing.');
if (!serverQueue.playing) return msg.channel.send('<:redx:674263474704220182> There is nothing playing.');
if (!serverQueue || !serverQueue.playing) return msg.channel.send(client.messages.noServerQueue);
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
let songtime = (data.length_seconds * 1000).toFixed(0);
serverQueue.time = serverQueue.connection.dispatcher.streamTime;
@ -21,7 +20,7 @@ module.exports = {
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 thumbnail = getThumb(serverQueue.songs[0].url);
const embed = new Discord.MessageEmbed()
.setTitle("__Now playing__")
.setTitle(client.messages.nowPlaying)
.setDescription(`<a:aNotes:674602408105476106>**Now playing:** ${serverQueue.songs[0].title}\n${array.join('')} | \`${client.funcs.msToTime(completed, "hh:mm:ss")} / ${client.funcs.msToTime(songtime, "hh:mm:ss")}\``)
.setFooter(`Queued by ${serverQueue.songs[0].author.tag}`)
.setURL(serverQueue.songs[0].url)

View File

@ -9,10 +9,10 @@ module.exports = {
execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (serverQueue.paused) return msg.channel.send('<:redx:674263474704220182> The music is already paused!');
if (serverQueue.paused) return msg.channel.send(client.messages.alreadyPaused);
serverQueue.paused = true;
serverQueue.connection.dispatcher.pause(true);
return msg.channel.send('<:pause:674685548610322462> Paused the music!');
return msg.channel.send(client.messages.paused);
}
}
};

View File

@ -15,31 +15,28 @@ module.exports = {
const serverQueue = client.queue.get(msg.guild.id);
const voiceChannel = msg.member.voice.channel;
if (!serverQueue) {
if (!msg.member.voice.channel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in a voice channel to play music!');
if (!msg.member.voice.channel) return msg.channel.send(client.messages.noVoiceChannel);
} else {
if (voiceChannel !== serverQueue.voiceChannel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in the same voice channel as Musix to play music!');
if (voiceChannel !== serverQueue.voiceChannel) return msg.channel.send(client.messages.wrongVoiceChannel);
}
if (!args[1]) return msg.channel.send('<:redx:674263474704220182> You need to use a link or search for a song!');
if (!args[1]) return msg.channel.send(client.messages.noQuery);
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has('CONNECT')) {
return msg.channel.send('<:redx:674263474704220182> I cannot connect to your voice channel, make sure I have the proper permissions!');
return msg.channel.send(client.messages.noPermsConnect);
}
if (!permissions.has('SPEAK')) {
return msg.channel.send('<:redx:674263474704220182> I cannot speak in your voice channel, make sure I have the proper permissions!');
return msg.channel.send(client.messages.noPermsSpeak);
}
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
const lmsg = await msg.channel.send('<a:loading:674284196700618783> Loading song(s)');
const lmsg = await msg.channel.send(client.messages.loadingSongs);
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id)
.catch(err => {
console.error(err);
return lmsg.edit(`<:redx:674263474704220182> Error loading songs!\nNot all songs we're loaded! This may have been caused by the playlist containing privated/deleted videos!`);
});
const video2 = await youtube.getVideoByID(video.id);
await client.funcs.handleVideo(video2, msg, voiceChannel, client, true);
}
return lmsg.edit(`<:green_check_mark:674265384777416705> Playlist: **${playlist.title}** has been added to the queue!`);
client.messages.playlistAdded = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
return lmsg.edit(client.messages.playlistAdded);
} else {
try {
var video = await youtube.getVideo(url);
@ -49,7 +46,7 @@ module.exports = {
var video = await youtube.getVideoByID(videos[0].id);
} catch (err) {
console.error(err);
return msg.channel.send('<:redx:674263474704220182> I could not obtain any search results!');
return msg.channel.send(client.messages.noResults);
}
}
return client.funcs.handleVideo(video, msg, voiceChannel, client, false);

View File

@ -8,9 +8,9 @@ module.exports = {
category: 'music',
async execute(msg, args, client, Discord, prefix) {
const serverQueue = client.queue.get(msg.guild.id);
if (!serverQueue) return msg.channel.send('<:redx:674263474704220182> There is nothing playing.');
if (!serverQueue) return msg.channel.send(client.messages.noServerQueue);
if (args[1]) {
if (isNaN(args[1])) return msg.channel.send('<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.');
if (isNaN(args[1])) return msg.channel.send(client.messages.validNumber);
}
let page = parseInt(args[1]);
if (!page) page = 1;

View File

@ -25,6 +25,6 @@ module.exports = {
/*fs.readdirSync(path.join(__dirname, 'funcs')).forEach(filename => {
this.funcs[filename.slice(0, -3)] = require(`../struct/funcs/${filename}`);
});*/
msg.channel.send('All files reloaded!');
msg.channel.send(client.messages.reloaded);
}
};

View File

@ -9,12 +9,14 @@ module.exports = {
execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!args[1]) return msg.channel.send('<:redx:674263474704220182> Please provide a song position in queue for me to remove!');
if (!args[1]) return msg.channel.send(client.messages.provideASong);
const pos = parseInt(args[1]);
if (isNaN(pos)) return msg.channel.send('<:redx:674263474704220182> You need to enter a number!');
if (pos < 1) return msg.channel.send('<:redx:674263474704220182> That songs does not exist!');
if (pos > serverQueue.songs.length) return msg.channel.send(`<:redx:674263474704220182> There is only ${serverQueue.songs.length} amount of songs in the queue!`);
msg.channel.send(`🗑️ removed \`${serverQueue.songs[pos].title}\` from the queue!`);
if (isNaN(pos)) return msg.channel.send(client.messages.validNumber);
if (pos < 1) return msg.channel.send(client.messages.noSongs);
client.messages.queueLength = client.messages.queueLength.replace("%LENGTH%", serverQueue.songs.length);
if (pos > serverQueue.songs.length) return msg.channel.send(client.messages.queueLength);
client.messages.removed = client.messages.removed.replace("%SONG%", serverQueue.songs[pos].title);
msg.channel.send(client.messages.removed);
return serverQueue.songs.splice(pos, 1);
}
}

View File

@ -9,6 +9,6 @@ module.exports = {
async execute(msg, args, client, Discord, prefix, command) {
client.destroy();
require('../index.js');
msg.channel.send('restarted!');
msg.channel.send(client.messages.restart);
}
};

View File

@ -9,10 +9,10 @@ module.exports = {
execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!serverQueue.paused) return msg.channel.send('<:redx:674263474704220182> The music in not paused!');
if (!serverQueue.paused) return msg.channel.send(client.messages.notPaused);
serverQueue.paused = false;
serverQueue.connection.dispatcher.resume(true);
return msg.channel.send('<:resume:674685585478254603> Resumed the music!');
return msg.channel.send(client.messages.resumed);
}
}
};

View File

@ -16,27 +16,28 @@ module.exports = {
const serverQueue = client.queue.get(msg.guild.id);
const voiceChannel = msg.member.voice.channel;
if (!serverQueue) {
if (!msg.member.voice.channel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in a voice channel to play music!');
if (!msg.member.voice.channel) return msg.channel.send(client.messages.noVoiceChannel);
} else {
if (voiceChannel !== serverQueue.voiceChannel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in the same voice channel as Musix to play music!');
if (voiceChannel !== serverQueue.voiceChannel) return msg.channel.send(client.messages.wrongVoiceChannel);
}
if (!args[1]) return msg.channel.send('<:redx:674263474704220182> You need to use a link or search for a song!');
if (!args[1]) return msg.channel.send(client.messages.noQuery);
const permissions = voiceChannel.permissionsFor(msg.client.user);
if (!permissions.has('CONNECT')) {
return msg.channel.send('<:redx:674263474704220182> I cannot connect to your voice channel, make sure I have the proper permissions!');
return msg.channel.send(client.messages.noPermsConnect);
}
if (!permissions.has('SPEAK')) {
return msg.channel.send('<:redx:674263474704220182> I cannot speak in your voice channel, make sure I have the proper permissions!');
return msg.channel.send(client.messages.noPermsSpeak);
}
if (url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)) {
const lmsg = await msg.channel.send('<a:loading:674284196700618783> Loading song(s)');
const lmsg = await msg.channel.send(client.messages.loadingSongs);
const playlist = await youtube.getPlaylist(url);
const videos = await playlist.getVideos();
for (const video of Object.values(videos)) {
const video2 = await youtube.getVideoByID(video.id);
await client.funcs.handleVideo(video2, msg, voiceChannel, client, true);
}
return lmsg.edit(`<:green_check_mark:674265384777416705> Playlist: **${playlist.title}** has been added to the queue!`);
client.messages.playlistAdded = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
return lmsg.edit(client.messages.playlistAdded);
} else {
try {
var video = await youtube.getVideo(url);
@ -45,9 +46,9 @@ module.exports = {
var videos = await youtube.searchVideos(searchString, 10);
let index = 0;
const embed = new Discord.MessageEmbed()
.setTitle("__Song Selection__")
.setTitle(client.messages.songSelection)
.setDescription(`${videos.map(video2 => `**${++index}** ${he.decode(video2.title)} `).join('\n')}`)
.setFooter("Please provide a number ranging from 1-10 to select one of the search results.")
.setFooter(client.messages.provideANumber)
.setColor(client.config.embedColor)
msg.channel.send(embed);
try {
@ -58,13 +59,13 @@ module.exports = {
});
} catch (err) {
console.error(err);
return msg.channel.send('<:redx:674263474704220182> Cancelling video selection');
return msg.channel.send(client.messages.cancellingVideoSelection);
}
const videoIndex = parseInt(response.first().content);
var video = await youtube.getVideoByID(videos[videoIndex - 1].id);
} catch (err) {
console.error(err);
return msg.channel.send('<:redx:674263474704220182> I could not obtain any search results!');
return msg.channel.send(client.messages.noResults);
}
}
return client.funcs.handleVideo(video, msg, voiceChannel, client, false);

View File

@ -1,7 +1,7 @@
module.exports = {
name: 'seek',
alias: 'none',
usage: '<point in song(seconds)>',
usage: '<point in song>',
description: 'Seek to a specific point in the currently playing song.',
onlyDev: true,
permission: 'MANAGE_MESSAGES',
@ -11,12 +11,13 @@ module.exports = {
const serverQueue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
let data = await Promise.resolve(ytdl.getInfo(serverQueue.songs[0].url));
if (!args[1]) return msg.channel.send(`<:redx:674263474704220182> Correct usage: \`${prefix}seek <seeking point in seconds>\``);
if (!args[1]) return msg.channel.send(`${client.messages.correctUsage}\`${prefix}seek ${command.usage}\``);
let point = args[1];
const pos = parseInt(args[1]);
if (isNaN(pos)) {
if (pos < 0) return msg.channel.send('<:redx:674263474704220182> The seeking point needs to be a positive number!');
if (pos > data.length_seconds) return msg.channel.send(`<:redx:674263474704220182> The lenght of this song is ${data.length_seconds} seconds! You can't seek further than that!`);
if (pos < 0) return msg.channel.send(client.messages.seekingPointPositive);
client.messages.seekMax = client.messages.seekMax.replace("%LENGTH%", data.length_seconds);
if (pos > data.length_seconds) return msg.channel.send(client.messages.seekMax);
point = pos;
}
serverQueue.connection.dispatcher.end();

View File

@ -20,7 +20,7 @@ module.exports = {
.setColor(client.embedColor)
const permissions = msg.channel.permissionsFor(msg.author);
if (msg.author.id !== client.config.devId) {
if (!permissions.has(command.permission)) return msg.channel.send('<:redx:674263474704220182> You need the `MANAGE_SERVER` permission to change the settings!');
if (!permissions.has(command.permission)) return msg.channel.send(client.messages.noPermsManageSettings);
}
if (args[1]) {
const optionName = args[1].toLowerCase();
@ -29,7 +29,7 @@ module.exports = {
try {
option.execute(msg, args, client, Discord, prefix);
} catch (error) {
msg.reply(`<:redx:674263474704220182> there was an error trying to execute that option! Please contact support with \`${prefix}bug\`!`);
msg.reply(client.messages.errorExeOpt);
const embed = new Discord.MessageEmbed()
.setTitle(`Musix ${error.toString()}`)
.setDescription(error.stack.replace(/at /g, '**at **'))

View File

@ -3,10 +3,10 @@ module.exports = {
async execute(msg, args, client, Discord, prefix) {
if (client.global.db.guilds[msg.guild.id].startPlaying) {
client.global.db.guilds[msg.guild.id].startPlaying = false;
return msg.channel.send('<:green_check_mark:674265384777416705> announcesongs now set to `false`!');
return msg.channel.send(client.messages.announceSongsFalse);
} else {
client.global.db.guilds[msg.guild.id].startPlaying = true;
return msg.channel.send('<:green_check_mark:674265384777416705> announcesongs now set to `true`!');
return msg.channel.send(client.messages.announceSongsTrue);
}
}
};

View File

@ -1,14 +1,14 @@
module.exports = {
name: 'bass',
async execute(msg, args, client, Discord, prefix) {
if (!args[2]) return msg.channel.send('Currect bass level: ' + client.global.db.guilds[msg.guild.id].bass);
if (!args[2]) return msg.channel.send(client.messages.currentDefaultBass + client.global.db.guilds[msg.guild.id].bass);
if (args[2] === "false") {
client.global.db.guilds[msg.guild.id].bass = false;
msg.channel.send(`Bass is now false!`);
msg.channel.send(client.messages.bassFalse);
}
const level = parseInt(args[2]);
if (isNaN(level)) return msg.channel.send('You need to provide a number?');
if (isNaN(level)) return msg.channel.send(client.messages.validNumber);
client.global.db.guilds[msg.guild.id].bass = level;
msg.channel.send(`Bass level is now ${level}!`);
msg.channel.send(`${client.messages.bassLevel} ${level}!`);
}
};

View File

@ -1,17 +1,17 @@
module.exports = {
name: 'permissions',
async execute(msg, args, client, Discord, prefix) {
if (!args[2]) return msg.channel.send(`🔒 Permission requirement: \`${client.global.db.guilds[msg.guild.id].permissions}\``);
if (!args[2]) return msg.channel.send(`${client.messages.permissions} \`${client.global.db.guilds[msg.guild.id].permissions}\``);
if (args[2] === 'true') {
if (!client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = true;
msg.channel.send(`<:green_check_mark:674265384777416705> Permissions requirement now set to: \`true\``);
} else return msg.channel.send('<:redx:674263474704220182> That value is already `true`!');
msg.channel.send(client.messages.permissionsSetTrue);
} else return msg.channel.send(client.messages.permissionsTrue);
} else if (args[2] === 'false') {
if (client.global.db.guilds[msg.guild.id].permissions) {
client.global.db.guilds[msg.guild.id].permissions = false;
msg.channel.send(`<:green_check_mark:674265384777416705> Permissions requirement now set to: \`false\``);
} else return msg.channel.send('<:redx:674263474704220182> That value is already `false`!');
} else return msg.channel.send('<:redx:674263474704220182> Please define a boolean! (true/false)');
msg.channel.send(client.messages.permissionsSetFalse);
} else return msg.channel.send(client.messages.permissionsFalse);
} else return msg.channel.send(client.messages.boolean);
}
};

View File

@ -3,6 +3,6 @@ module.exports = {
async execute(msg, args, client, Discord, prefix) {
if (!args[2]) return msg.channel.send(`Current prefix: \`${client.global.db.guilds[msg.guild.id].prefix}\``);
client.global.db.guilds[msg.guild.id].prefix = args[2];
msg.channel.send(`<:green_check_mark:674265384777416705> New prefix set to: \`${args[2]}\``);
msg.channel.send(`${client.messages.prefixSet} \`${args[2]}\``);
}
};

View File

@ -9,6 +9,6 @@ module.exports = {
dj: false,
djrole: null
};
msg.channel.send('<:green_check_mark:674265384777416705> Reset __all__ guild settings!');
msg.channel.send(client.messages.reset);
}
};

View File

@ -7,22 +7,22 @@ module.exports = {
}
if (msg.guild.roles.cache.find(x => x.name === "DJ")) {
client.global.db.guilds[msg.guild.id].djrole = msg.guild.roles.cache.find(x => x.name === "DJ").id;
msg.channel.send('<:green_check_mark:674265384777416705> I found a `DJ` role from this guild! This role is now the DJ role.');
msg.channel.send(client.messages.djRoleFound);
client.global.db.guilds[msg.guild.id].dj = true;
} else {
const permissions = msg.channel.permissionsFor(msg.client.user);
if (!permissions.has('MANAGE_ROLES')) return msg.channel.send('<:redx:674263474704220182> I cannot create roles (Manage roles), make sure I have the proper permissions! I will need this permission to create a `DJ` role since i did not find one!');
if (!permissions.has('MANAGE_ROLES')) return msg.channel.send(client.messages.noPermsManageRoles);
msg.guild.createRole({
name: 'DJ',
})
.then(role => client.global.db.guilds[msg.guild.id].djrole = role.id)
.catch(console.error)
client.global.db.guilds[msg.guild.id].dj = true;
msg.channel.send('<:green_check_mark:674265384777416705> I did not find a role `DJ` so i have created one for you!');
msg.channel.send(client.messages.djRoleCreated);
}
} else {
client.global.db.guilds[msg.guild.id].dj = false;
msg.channel.send('<:green_check_mark:674265384777416705> `DJ` now set to `false`');
msg.channel.send(client.messages.djFalse);
}
}
};

View File

@ -1,10 +1,10 @@
module.exports = {
name: 'volume',
async execute(msg, args, client, Discord, prefix) {
if (!args[2]) return msg.channel.send(`:speaker: Current default volume is: \`${client.global.db.guilds[msg.guild.id].defaultVolume}\``);
if (isNaN(args[2])) return msg.channel.send('<:redx:674263474704220182> I\'m sorry, But the default volume needs to be a valid __number__.');
if (args[2].length > 2) return msg.channel.send('<:redx:674263474704220182> The default volume must be below `100` for quality and safety resons.');
if (!args[2]) return msg.channel.send(`${client.messages.currentDefaultVolume} \`${client.global.db.guilds[msg.guild.id].defaultVolume}\``);
if (isNaN(args[2])) return msg.channel.send(client.messages.defaultVolumeNumber);
if (args[2].length > 2) return msg.channel.send(client.messages.defaultVolumeMax);
client.global.db.guilds[msg.guild.id].defaultVolume = args[2];
msg.channel.send(`<:green_check_mark:674265384777416705> Default volume set to: \`${args[2]}\``);
msg.channel.send(`${client.messages.defaultVolumeSet} \`${args[2]}\``);
}
};

View File

@ -10,7 +10,7 @@ module.exports = {
const serverQueue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
client.funcs.shuffle(serverQueue.songs);
msg.channel.send('<:shuffle:674685595980791871> Queue suffled!');
msg.channel.send(client.messages.shuffled);
}
}
};

View File

@ -9,33 +9,33 @@ module.exports = {
execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
if (!serverQueue || !serverQueue.playing) return msg.channel.send('<:redx:674263474704220182> There is nothing playing!');
if (!serverQueue || !serverQueue.playing) return msg.channel.send(client.messages.noServerQueue);
if (msg.author.id !== client.config.devId) {
if (msg.member.voice.channel !== serverQueue.voiceChannel) return msg.channel.send('<:redx:674263474704220182> I\'m sorry but you need to be in the same voice channel as Musix!');
if (msg.member.voice.channel !== serverQueue.voiceChannel) return msg.channel.send(client.messages.wrongVoiceChannel);
if (client.global.db.guilds[msg.guild.id].permissions) {
if (!msg.member.roles.cache.has(client.global.db.guilds[msg.guild.id].djrole) || !permissions.has(command.permission)) {
return vote(serverQueue, msg, client);
} else {
return skipSong(serverQueue, msg);
return skipSong(serverQueue, msg, client);
}
} else {
return skipSong(serverQueue, msg);
return skipSong(serverQueue, msg, client);
}
} else {
return skipSong(serverQueue, msg);
return skipSong(serverQueue, msg, client);
}
}
};
function skipSong(serverQueue, msg) {
msg.channel.send('<:skip:674685614221688832> Skipped the song!');
function skipSong(serverQueue, msg, client) {
msg.channel.send(client.messages.skipped);
serverQueue.endReason = "skip";
serverQueue.connection.dispatcher.end();
};
function vote(serverQueue, msg) {
function vote(serverQueue, msg, client) {
serverQueue.votesNeeded = Math.floor(serverQueue.voiceChannel.members.size / 2);
serverQueue.votesNeeded.toFixed();
if (serverQueue.voiceChannel.members.size > 2) {
if (serverQueue.voters.includes(msg.member.id)) return msg.channel.send('<:redx:674263474704220182> You have already voted to skip!');
if (serverQueue.voters.includes(msg.member.id)) return msg.channel.send(client.messages.alreadyVoted);
serverQueue.votes++;
serverQueue.voters.push(msg.member.id);
if (serverQueue.votes >= serverQueue.votesNeeded) {
@ -43,7 +43,7 @@ function vote(serverQueue, msg) {
serverQueue.votes = 0;
serverQueue.votesNeeded = null;
return skipSong(serverQueue, msg);
} else return msg.channel.send(`<:redx:674263474704220182> Not enough votes! ${serverQueue.votes} / ${serverQueue.votesNeeded}!`);
} else return msg.channel.send(`${client.messages.notEnoughVotes} ${serverQueue.votes} / ${serverQueue.votesNeeded}!`);
} else {
return skipSong(serverQueue, msg);
}

View File

@ -9,11 +9,11 @@ module.exports = {
async execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
if (client.funcs.check(client, msg, command)) {
if (!args[1]) return msg.channel.send(`<:redx:674263474704220182> correct usage: \`${command.usage}\``);
if (!args[1]) return msg.channel.send(`${client.messages.correctUsage}\`${command.usage}\``);
const point = parseInt(args[1] - 1);
if (isNaN(point)) return msg.channel.send('<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.');
if (point > serverQueue.songs.size) return msg.channel.send('<:redx:674263474704220182> That song does not exist!');
if (point < 1) return msg.channel.send('<:redx:674263474704220182> You can\'t skip to the song currently playing!');
if (isNaN(point)) return msg.channel.send(client.messages.validNumber);
if (point > serverQueue.songs.size) return msg.channel.send(client.messages.noSongs);
if (point < 1) return msg.channel.send(client.messages.cantSkipToCurrent);
let i = 0;
while (i < point) {
i++;

View File

@ -8,7 +8,7 @@ module.exports = {
category: 'info',
execute(msg, args, client, Discord, prefix) {
const uptime = client.funcs.msToTime(client.uptime, "dd:hh:mm:ss");
msg.channel.send('<a:loading:674284196700618783> Pinging...').then(m => {
msg.channel.send(client.messages.pinging).then(m => {
const latency = m.createdTimestamp - msg.createdTimestamp;
const embed = new Discord.MessageEmbed()

View File

@ -13,7 +13,7 @@ module.exports = {
serverQueue.looping = false;
serverQueue.endReason = "stop";
serverQueue.connection.dispatcher.end();
msg.channel.send('<:stop:674685626108477519> Stopped the music!')
msg.channel.send(client.messages.stop)
}
}
};

View File

@ -9,15 +9,15 @@ module.exports = {
category: 'music',
execute(msg, args, client, Discord, prefix, command) {
const serverQueue = client.queue.get(msg.guild.id);
if (!args[1] && serverQueue) return msg.channel.send(`:loud_sound: The current volume is: **${serverQueue.volume}**`);
if (!args[1] && serverQueue) return msg.channel.send(`${client.messages.currentVolume}**${serverQueue.volume}**`);
const volume = parseFloat(args[1]);
if (client.funcs.check(client, msg, command)) {
if (isNaN(volume)) return msg.channel.send('<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.');
if (volume > 100) return msg.channel.send('<:redx:674263474704220182> The max volume is `100`!');
if (volume < 0) return msg.channel.send('<:redx:674263474704220182> The volume needs to be a positive number!');
if (isNaN(volume)) return msg.channel.send(client.messages.validNumber);
if (volume > 100) return msg.channel.send(client.messages.maxVolume);
if (volume < 0) return msg.channel.send(client.messages.positiveVolume);
serverQueue.volume = volume;
serverQueue.connection.dispatcher.setVolume(volume / 5);
return msg.channel.send(`<:volumehigh:674685637626167307> I set the volume to: **${volume}**`);
return msg.channel.send(`${client.messages.setVolume}**${volume}**`);
}
}
};