1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 00:23:17 +00:00

some fixes and updates

This commit is contained in:
MatteZ02 2020-06-04 17:46:43 +03:00
parent 35dba3b137
commit 2b60f0ec12
7 changed files with 13 additions and 15 deletions

View File

@ -1,6 +1,4 @@
const { const { getLyrics } = require("genius-lyrics-api");
getLyrics
} = require("genius-lyrics-api");
module.exports = { module.exports = {
name: "lyrics", name: "lyrics",
@ -26,9 +24,8 @@ module.exports = {
if (lyrics === null) if (lyrics === null)
return msg.channel.send(client.messages.noResultsLyrics); return msg.channel.send(client.messages.noResultsLyrics);
for (let i = 0; i < lyrics.length; i += 2000) { for (let i = 0; i < lyrics.length; i += 2000) {
let toi = "" let toi = "";
toi = toi = lyrics.substring(i, Math.min(lyrics.length, i + 2000));
lyrics.substring(i, Math.min(lyrics.length, i + 2000));
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(client.messages.lyricsTitle) .setTitle(client.messages.lyricsTitle)
.setDescription(toi) .setDescription(toi)
@ -37,4 +34,4 @@ module.exports = {
} }
}); });
}, },
}; };

View File

@ -7,6 +7,9 @@ module.exports = {
permission: 'dev', permission: 'dev',
category: 'util', category: 'util',
async execute(msg, args, client, Discord, command) { async execute(msg, args, client, Discord, command) {
lient.funcs.saveDB(client);
msg.channel.send(client.messages.dbSaved);
msg.channel.send(client.messages.restart);
client.shard.respawnAll(client.config.shardDelay, client.config.respawnDelay, client.config.spawnTimeout); client.shard.respawnAll(client.config.shardDelay, client.config.respawnDelay, client.config.spawnTimeout);
} }
}; };

View File

@ -36,7 +36,7 @@ function getCommand(client, args, msg, Discord) {
); );
if (!command) return; if (!command) return;
if (command.onlyDev && msg.author.id !== client.config.devId) return; if (command.onlyDev && msg.author.id !== client.config.devId) return;
if (client.config.devMode && msg.member.id !== client.config.devId) if (client.config.devMode && msg.member.id !== client.config.devId && msg.guild.id !== "718081535240306738")
return msg.channel.send(client.messages.devMode); return msg.channel.send(client.messages.devMode);
client.funcs.exe(msg, args, client, Discord, command); client.funcs.exe(msg, args, client, Discord, command);
} }

View File

@ -19,9 +19,6 @@ module.exports = {
} }
} }
if (oldState.channel.members.size === 1 && oldState.channel === queue.voiceChannel || change) { if (oldState.channel.members.size === 1 && oldState.channel === queue.voiceChannel || change) {
queue.textChannel.send(client.messages.leftAlonePaused);
queue.paused = true;
queue.connection.dispatcher.pause(true);
setTimeout(() => { setTimeout(() => {
if (!queue || !queue.connection.dispatcher || queue.connection.dispatcher === null) return; if (!queue || !queue.connection.dispatcher || queue.connection.dispatcher === null) return;
if (queue.voiceChannel.members.size === 1) { if (queue.voiceChannel.members.size === 1) {

View File

@ -63,8 +63,7 @@ module.exports = {
joined: emojis.green_check_mark + "Joined", joined: emojis.green_check_mark + "Joined",
joinSupport: "Join the musix support server: ", joinSupport: "Join the musix support server: ",
keySet: emojis.green_check_mark + "Key set!", keySet: emojis.green_check_mark + "Key set!",
leftAlone: "Music has been stopped since i was left alone for too long.", leftAlone: "I have left the channel as i was left alone.",
leftAlonePaused: emojis.pause + "Paused the music as i have been left alone!",
loadingSongs: emojis.loading + "Loading song(s)", loadingSongs: emojis.loading + "Loading song(s)",
looping: emojis.repeat + "Looping the queue now!", looping: emojis.repeat + "Looping the queue now!",
loopingSong: emojis.repeatSong + "Looping **%TITLE%** now!", loopingSong: emojis.repeatSong + "Looping **%TITLE%** now!",

View File

@ -48,6 +48,7 @@ module.exports = async function (
votesNeeded: null, votesNeeded: null,
time: 0, time: 0,
endReason: null, endReason: null,
exists: true
}; };
construct.songs.push(song); construct.songs.push(song);

View File

@ -9,17 +9,18 @@ module.exports = async function (guild, song, client, seek, play) {
const queue = client.queue.get(guild.id); const queue = client.queue.get(guild.id);
if (!song) { if (!song) {
queue.voiceChannel.leave(); queue.voiceChannel.leave();
queue.exists = false;
client.queue.delete(guild.id); client.queue.delete(guild.id);
return; return;
} }
setTimeout(() => { setTimeout(() => {
if (!queue.playing && queue) { if (!queue.playing && queue.exists) {
queue.textChannel.send(client.messages.tookTooLong); queue.textChannel.send(client.messages.tookTooLong);
queue.voiceChannel.leave(); queue.voiceChannel.leave();
client.queue.delete(guild.id); client.queue.delete(guild.id);
return; return;
} }
}, 45000); }, 10000);
streamConfig.options.seek = seek; streamConfig.options.seek = seek;