1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 21:13:18 +00:00

Fixed some errors and messages

This commit is contained in:
MatteZ02 2020-03-13 16:20:23 +02:00
parent e15e81d9fe
commit 34a5d26829
14 changed files with 69 additions and 64 deletions

View File

@ -16,8 +16,9 @@ module.exports = {
if (bass > 100) return msg.channel.send(client.messages.maxBass);
if (bass < 0) return msg.channel.send(client.messages.positiveBass);
serverQueue.bass = bass;
client.messages.bassApplied = client.messages.bassApplied.replace("%BASS%", bass);
return msg.channel.send(client.messages.bassApplied);
let message;
message = client.messages.bassApplied.replace("%BASS%", bass);
return msg.channel.send(message);
}
}
};

View File

@ -25,11 +25,12 @@ module.exports = {
for (let i = 0; i < categories.length; i++) {
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp && !x.onlyDev).map(x => `\`${x.name}\``).join(', ')}\n`;
}
client.messages.help = client.messages.help.replace("%PREFIX%", prefix);
let message;
message = client.messages.helpFooter.replace("%PREFIX%", prefix);
const embed = new Discord.MessageEmbed()
.setTitle(`${client.user.username} ${client.messages.help}`)
.setTitle(`${client.user.username} ${client.messages.helpTitle}`)
.setDescription(commands)
.setFooter(client.messages.helpFooter)
.setFooter(message)
.setColor(client.config.embedColor)
msg.channel.send(embed);
}

View File

@ -11,11 +11,12 @@ module.exports = {
if (client.funcs.check(client, msg, command)) {
if (!serverQueue.songLooping) {
serverQueue.songLooping = true;
client.messages.loopingSong = client.messages.loopingSong.replace("%TITLE%", serverQueue.songs[0].title);
msg.channel.send(client.messages.loopingSong);
let message;
message = client.messages.loopingSong.replace("%TITLE%", serverQueue.songs[0].title);
msg.channel.send(message);
} else {
serverQueue.songLooping = false;
msg.channel.send(client.messages.noLoopingSong);
msg.channel.send(message);
}
}
}

View File

@ -10,7 +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 || !serverQueue.playing) return msg.channel.send(client.messages.noServerQueue);
if (!serverQueue) 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;

View File

@ -9,33 +9,23 @@ module.exports = {
async execute(msg, args, client, Discord, prefix) {
const serverQueue = client.queue.get(msg.guild.id);
if (!serverQueue) return msg.channel.send(client.messages.noServerQueue);
if (args[1]) {
if (isNaN(args[1])) return msg.channel.send(client.messages.validNumber);
}
let page = parseInt(args[1]);
if (!page) page = 1;
let pagetext = client.messages.queuePages;
if (page === 1) pagetext = client.messages.queueFirstPage;
const page = 1;
let queuesongs = serverQueue.songs.slice((page - 1) * 20 + 1, page * 20 + 1);
let queuemessage = `${queuesongs.map(song => `**#** ${song.title}`).join('\n')}`
const hashs = queuemessage.split('**#**').length;
for (let i = 0; i < hashs; i++) {
queuemessage = queuemessage.replace('**#**', `**${i + 1}**`);
}
client.messages.queueDesc = client.messages.queueDesc.replace("%SONG%", song.title);
if (!serverQueue.looping) {
const embed = new Discord.MessageEmbed()
.setTitle(client.messages.queueTitle)
.setDescription(`${client.messages.queueDesc}\n${pagetext}\n${queuemessage}`)
.setColor(client.config.embedColor)
return msg.channel.send(embed);
} else {
const embed = new Discord.MessageEmbed()
.setTitle(client.messages.queueTitle)
.setDescription(`${client.messages.queueDesc}\n${pagetext}\n${queuemessage}`)
.setFooter('<:repeat1:674685561377914892> Currently looping the queue!')
.setColor(client.config.embedColor)
return msg.channel.send(embed);
}
let message;
message = client.messages.queueDesc.replace("%SONG%", serverQueue.songs[0].title);
const embed = new Discord.MessageEmbed()
.setTitle(client.messages.queueTitle)
.setDescription(`${message}\n${queuemessage}`)
.setFooter(`${serverQueue.songs.size - 20} ${client.messages.queueFooter}`)
.setColor(client.config.embedColor)
/*if (serverQueue.songs.size > 20) {
embed.setFooter(`${serverQueue.songs.size - 20} ${client.messages.queueFooter}`)
}*/
return msg.channel.send(embed);
}
};

View File

@ -13,10 +13,12 @@ module.exports = {
const pos = parseInt(args[1]);
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);
let message1;
let message2;
message1 = client.messages.queueLength.replace("%LENGTH%", serverQueue.songs.length);
if (pos > serverQueue.songs.length) return msg.channel.send(message1);
message2 = client.messages.removed.replace("%SONG%", serverQueue.songs[pos].title);
msg.channel.send(message2);
return serverQueue.songs.splice(pos, 1);
}
}

View File

@ -36,8 +36,9 @@ module.exports = {
const video2 = await youtube.getVideoByID(video.id);
await client.funcs.handleVideo(video2, msg, voiceChannel, client, true);
}
client.messages.playlistAdded = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
return lmsg.edit(client.messages.playlistAdded);
let message;
message = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
return lmsg.edit(message);
} else {
try {
var video = await youtube.getVideo(url);

View File

@ -16,8 +16,9 @@ module.exports = {
const pos = parseInt(args[1]);
if (isNaN(pos)) {
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);
let message;
message = client.messages.seekMax.replace("%LENGTH%", data.length_seconds);
if (pos > data.length_seconds) return msg.channel.send(message);
point = pos;
}
serverQueue.connection.dispatcher.end();

View File

@ -17,7 +17,7 @@ module.exports = {
.addField(client.messages.settingsBass, client.messages.settingsBassDesc, true)
.setFooter(client.messages.settingsFooter)
.setAuthor(client.user.username, client.user.displayAvatarURL)
.setColor(client.embedColor)
.setColor(client.config.embedColor)
const permissions = msg.channel.permissionsFor(msg.author);
if (msg.author.id !== client.config.devId) {
if (!permissions.has(command.permission)) return msg.channel.send(client.messages.noPermsManageSettings);

View File

@ -22,7 +22,7 @@ module.exports = {
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(client.messages.notAllowed);
if (client.config.devMode && msg.member.id !== client.config.devId) return msg.channel.send(client.messages.devMode);
//if (client.config.devMode && msg.member.id !== client.config.devId) return msg.channel.send(client.messages.devMode);
client.funcs.exe(msg, args, client, Discord, prefix, command);
}
}

View File

@ -1,6 +1,6 @@
/*
THIS FILE CONTAINS ALL MESSAGES THAT MUSIX SENDS!
THIS IS MUSIX BRANDING AND YOU'RE NOT PERMITTED TO COPY ALL THE VISUALS FROM MUSIX!
THIS IS MUSIX BRANDING AND YOU'RE NOT PERMITTED TO COPY THE VISUALS OF MUSIX!
IF YOU CLONED THIS REPOSITORY PLEASE MODIFY THESE MESSAGES!
*/
module.exports = {
@ -14,18 +14,18 @@ module.exports = {
boolean: "<:redx:674263474704220182> Please define a boolean! (true/false)",
bugDesc: "Matte#0002\nOr join the support server: https://discord.gg/rvHuJtB",
bugTitle: "Found a bug with Musix?\nDM the core developer:",
cancellingVideoSelection: "'<:redx:674263474704220182> Cancelling video selection",
cantSkipToCurrent: "<:redx:674263474704220182> You can\'t skip to the song currently playing!",
cancellingVideoSelection: "<:redx:674263474704220182> Cancelling video selection",
cantSkipToCurrent: "<:redx:674263474704220182> You can't skip to the song currently playing!",
cmdUsesFooter: "These statistics are from the current uptime.",
cmdUsesTitle: "Musix Command Usage During Current Uptime",
correctUsage: "<:redx:674263474704220182> correct usage: ",
currentBass: ":loud_sound: The current bass is: ",
currentDefaultBass: ":speaker: Currect default bass level:",
currentDefaultBass: ":speaker: Currect default bass level: ",
currentDefaultVolume: ":speaker: Current default volume is:",
currentPrefix: "Current prefix:",
currentVolume: ":loud_sound: The current volume is: ",
defaultVolumeMax: "<:redx:674263474704220182> The default volume must be below `100` for quality and safety resons.",
defaultVolumeNumber: "<:redx:674263474704220182> I\'m sorry, But the default volume needs to be a valid __number__.",
defaultVolumeNumber: "<:redx:674263474704220182> I'm sorry, But the default volume needs to be a valid __number__.",
defaultVolumeSet: "<:green_check_mark:674265384777416705> Default volume set to:",
devMode: "<:redx:674263474704220182> Dev mode has been turned on! Commands are only available to developer(s)!",
dispatcherError: "Error with the dispatcher: ",
@ -36,8 +36,8 @@ module.exports = {
errorConnecting: "Error with connecting to voice channel: ",
errorDetected: "Error detected: ",
errorDispatcher: "<:redx:674263474704220182> An error has occured while playing music! The queue has been deleted.",
errorExe: "<:redx:674263474704220182> there was an error trying to execute that command! Please contact support with the \`bug\` command!",
errorExeOpt: "<:redx:674263474704220182> there was an error trying to execute that option! Please contact support with the \`bug\` command!",
errorExe: "<:redx:674263474704220182> there was an error trying to execute that command! Please contact support with the `bug` command!",
errorExeOpt: "<:redx:674263474704220182> there was an error trying to execute that option! Please contact support with the `bug` command!",
evalTitle: "Evaluation Command",
helpCmdFooter: "Command Alias:",
helpFooter: "\"%PREFIX%help <command>\" to see more information about a command.",
@ -67,13 +67,13 @@ module.exports = {
notAllowed: "<:redx:674263474704220182> You are not allowed to do that!",
notEnoughVotes: "<:redx:674263474704220182> Not enough votes!",
notPaused: "<:redx:674263474704220182> The music in not paused!",
noVoiceChannel: "<:redx:674263474704220182> I\'m sorry but you need to be in a voice channel to play music!",
noVoiceChannel: "<:redx:674263474704220182> I'm sorry but you need to be in a voice channel to play music!",
nowPlaying: "__Now playing__",
paused: "<:pause:674685548610322462> Paused the music!",
permission: "🔒 Permission requirement:",
permissionsFalse: "<:redx:674263474704220182> That value is already `false`!",
permissionsSetFalse: "<:green_check_mark:674265384777416705> Permissions requirement now set to: \`false\`",
permissionsSetTrue: "<:green_check_mark:674265384777416705> Permissions requirement now set to: \`true\`",
permissionsSetFalse: "<:green_check_mark:674265384777416705> Permissions requirement now set to: `false`",
permissionsSetTrue: "<:green_check_mark:674265384777416705> Permissions requirement now set to: `true`",
permissionsTrue: "<:redx:674263474704220182> That value is already `true`!",
pinging: "<a:loading:674284196700618783> Pinging...",
playlistAdded: "<:green_check_mark:674265384777416705> Playlist: **%TITLE%** has been added to the queue!",
@ -84,13 +84,12 @@ module.exports = {
provideANumber: "Please provide a number ranging from 1-10 to select one of the search results.",
provideASong: "<:redx:674263474704220182> Please provide a song position in queue for me to remove!",
queueDeleted: "Queue deleted!",
queueDesc: "**Now playing:** %SONG%<a:aNotes:674602408105476106>",
queueFirstPage: ":page_facing_up: Page: ${page} :page_facing_up:",
queueDesc: "**Now playing:** %SONG%<a:aNotes:674602408105476106>\n:arrow_down: Next in queue :arrow_down:",
queueFooter: "More songs in the queue!",
queueLength: "<:redx:674263474704220182> There are only %SONGS% amount of songs in the queue!",
queuePages: ":arrow_down: Next in queue :arrow_down:",
queueTitle: "__Song queue__",
reloaded: "All files reloaded!",
removed: "🗑 removed \`%SONG%\` from the queue!",
removed: "🗑 removed `%SONG%` from the queue!",
reset: "<:green_check_mark:674265384777416705> Reset __all__ guild settings!",
restart: "restarted!",
resumed: "<:resume:674685585478254603> Resumed the music!",
@ -121,6 +120,6 @@ module.exports = {
statusField3: ":stopwatch: Uptime",
statusTitle: "Status for Musix",
stop: "<:stop:674685626108477519> Stopped the music!",
validNumber: "<:redx:674263474704220182> I\'m sorry, But you need to enter a valid __number__.",
validNumber: "<:redx:674263474704220182> I'm sorry, But you need to enter a valid __number__.",
wrongVoiceChannel: "<:redx:674263474704220182> I'm sorry but you need to be in the same voice channel as Musix to use this command!",
};

View File

@ -1,9 +1,15 @@
module.exports = function (client, msg, command) {
const serverQueue = client.queue.get(msg.guild.id);
const permissions = msg.channel.permissionsFor(msg.author);
if (!serverQueue || !serverQueue.playing) return msg.channel.send(client.messages.noServerQueue);
if (!serverQueue || !serverQueue.playing) {
msg.channel.send(client.messages.noServerQueue);
return false;
}
if (msg.author.id !== client.config.devId) {
if (msg.member.voice.channel !== serverQueue.voiceChannel) return msg.channel.send(client.messages.wrongVoiceChannel);
if (msg.member.voice.channel !== serverQueue.voiceChannel) {
msg.channel.send(client.messages.wrongVoiceChannel);
return false;
}
if (client.global.db.guilds[msg.guild.id].permissions === true) {
if (client.global.db.guilds[msg.guild.id].dj) {
if (!msg.member.roles.cache.has(client.global.db.guilds[msg.guild.id].djrole)) {
@ -11,8 +17,9 @@ module.exports = function (client, msg, command) {
return false;
} else return true;
} else if (!permissions.has(command.permission)) {
client.messages.noPerms = client.messages.noPerms.replace("%PERMS%", commands.permissions);
msg.channel.send(client.messages.noPerms);
let message
message = client.messages.noPerms.replace("%PERMS%", commands.permissions);
msg.channel.send(message);
return false;
} else return true;
} else return true;

View File

@ -12,8 +12,9 @@ module.exports = async function (video, msg, voiceChannel, client, playlist = fa
if (serverQueue) {
serverQueue.songs.push(song);
if (playlist) return;
client.messages.songsAdded = client.messages.songAdded.replace("%TITLE%", song.title);
return msg.channel.send(client.messages.songAdded);
let message;
message = client.messages.songAdded.replace("%TITLE%", song.title);
return msg.channel.send(message);
}
const construct = require("../config/queueConfig.js");

View File

@ -7,8 +7,9 @@ module.exports = async function (client, msg, youtube, voiceChannel, url) {
const video2 = await youtube.getVideoByID(video.id);
await client.funcs.handleVideo(video2, msg, voiceChannel, client, true);
}
client.messages.playlistAdded = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
lmsg.edit(client.messages.playlistAdded);
let message;
message = client.messages.playlistAdded.replace("%TITLE%", playlist.title);
lmsg.edit(message);
return true;
} else {
return false;