1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-06-17 01:16:00 +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

@ -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;