mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-03 16:24:28 +00:00
remove setkey
This commit is contained in:
@ -42,88 +42,86 @@ module.exports = {
|
||||
if (!voiceChannel.speakable)
|
||||
return msg.channel.send(client.messages.noPermsSpeak);
|
||||
if (url.match(/^https?:\/\/(open.spotify.com|spotify.com)(.*)$/)) {
|
||||
if (!client.global.db.guilds[msg.guild.id].premium)
|
||||
return msg.channel.send(client.messages.notPremium);
|
||||
const playlistId = url.split("/playlist/")[1].split("?")[0];
|
||||
spotify.getPlaylist(playlistId).then(
|
||||
async function (data) {
|
||||
const lmsg = await msg.channel.send(client.messages.loadingSongs);
|
||||
let failed = 0;
|
||||
for (let i = 0; data.body.tracks.items.length > i; i++) {
|
||||
const track = await data.body.tracks.items[i].track;
|
||||
await client.funcs.sleep(250);
|
||||
await search(
|
||||
`${track.artists[0].name} ${track.name} audio`,
|
||||
async function (err, res) {
|
||||
if (err) return console.log(err);
|
||||
if (res.videos.length === 0) {
|
||||
await search(
|
||||
`${track.artists[0].name} ${track.name} lyrics`,
|
||||
async function (err, res) {
|
||||
if (err) return console.log(err);
|
||||
if (res.videos.length === 0) {
|
||||
await search(
|
||||
`${track.artists[0].name} ${track.name}`,
|
||||
async function (err, res) {
|
||||
if (err) return console.log(err);
|
||||
if (res.videos.length === 0) {
|
||||
failed++;
|
||||
return;
|
||||
}
|
||||
await client.funcs.handleVideo(
|
||||
res.videos[0],
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
true,
|
||||
"ytdl"
|
||||
);
|
||||
const lmsg = await msg.channel.send(client.messages.loadingSongs);
|
||||
let failed = 0;
|
||||
for (let i = 0; data.body.tracks.items.length > i; i++) {
|
||||
const track = await data.body.tracks.items[i].track;
|
||||
await client.funcs.sleep(250);
|
||||
await search(
|
||||
`${track.artists[0].name} ${track.name} audio`,
|
||||
async function (err, res) {
|
||||
if (err) return console.log(err);
|
||||
if (res.videos.length === 0) {
|
||||
await search(
|
||||
`${track.artists[0].name} ${track.name} lyrics`,
|
||||
async function (err, res) {
|
||||
if (err) return console.log(err);
|
||||
if (res.videos.length === 0) {
|
||||
await search(
|
||||
`${track.artists[0].name} ${track.name}`,
|
||||
async function (err, res) {
|
||||
if (err) return console.log(err);
|
||||
if (res.videos.length === 0) {
|
||||
failed++;
|
||||
return;
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
await client.funcs.handleVideo(
|
||||
res.videos[0],
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
true,
|
||||
"ytdl"
|
||||
await client.funcs.handleVideo(
|
||||
res.videos[0],
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
true,
|
||||
"ytdl"
|
||||
);
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
);
|
||||
failed++;
|
||||
return;
|
||||
}
|
||||
await client.funcs.handleVideo(
|
||||
res.videos[0],
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
true,
|
||||
"ytdl"
|
||||
await client.funcs.handleVideo(
|
||||
res.videos[0],
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
true,
|
||||
"ytdl"
|
||||
);
|
||||
}
|
||||
);
|
||||
failed++;
|
||||
return;
|
||||
}
|
||||
);
|
||||
}
|
||||
let message;
|
||||
if (failed === 0) {
|
||||
message = client.messages.playlistAdded.replace(
|
||||
"%TITLE%",
|
||||
data.body.name
|
||||
);
|
||||
} else {
|
||||
message = `${client.messages.playlistAdded.replace(
|
||||
await client.funcs.handleVideo(
|
||||
res.videos[0],
|
||||
msg,
|
||||
voiceChannel,
|
||||
client,
|
||||
true,
|
||||
"ytdl"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
let message;
|
||||
if (failed === 0) {
|
||||
message = client.messages.playlistAdded.replace(
|
||||
"%TITLE%",
|
||||
data.body.name
|
||||
);
|
||||
} else {
|
||||
message = `${client.messages.playlistAdded.replace(
|
||||
"%TITLE%",
|
||||
data.body.name
|
||||
)}\n${client.messages.failedToLoad + failed}`;
|
||||
}
|
||||
lmsg.edit(message);
|
||||
},
|
||||
function (err) {
|
||||
console.log(err);
|
||||
msg.channel.send(client.messages.noResultsSpotify);
|
||||
}
|
||||
lmsg.edit(message);
|
||||
},
|
||||
function (err) {
|
||||
console.log(err);
|
||||
msg.channel.send(client.messages.noResultsSpotify);
|
||||
}
|
||||
);
|
||||
} else if (
|
||||
url.match(/^https?:\/\/(www.youtube.com|youtube.com)\/playlist(.*)$/)
|
||||
@ -164,4 +162,4 @@ module.exports = {
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -48,11 +48,6 @@ module.exports = {
|
||||
client.messages.settingsBassDesc,
|
||||
true
|
||||
)
|
||||
.addField(
|
||||
client.messages.settingsSetKey,
|
||||
client.messages.settingsSetKeyDesc,
|
||||
true
|
||||
)
|
||||
.setFooter(footer)
|
||||
.setAuthor(client.user.username, client.user.displayAvatarURL)
|
||||
.setColor(client.config.embedColor);
|
||||
@ -87,4 +82,4 @@ module.exports = {
|
||||
return msg.channel.send(embed);
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
name: "setkey",
|
||||
async execute(msg, args, client) {
|
||||
msg.channel.send(client.messages.setKeyUsage);
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user