Фиксики

This commit is contained in:
JonnyBro 2022-03-29 18:18:32 +05:00
parent 29a89d59c9
commit 6964ec9e47
3 changed files with 21 additions and 27 deletions

View file

@ -25,13 +25,11 @@ class Playlists extends Command {
let playlist; let playlist;
for (const pl of playlists) { for (const pl of playlists) {
if (pl.name === name) { if (!pl.name === name) return message.error("music/removeplaylist:NOT_FOUND", {
playlist = pl; name
} else { });
message.error("music/removeplaylist:NOT_FOUND", {
name playlist = pl;
});
}
} }
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()

View file

@ -23,13 +23,11 @@ class PlayPlaylists extends Command {
const name = args.join(" "); const name = args.join(" ");
let playlist; let playlist;
for (const pl of data.userData.playlists) { for (const pl of data.userData.playlists) {
if (pl.name === name) { if (!pl.name === name) return message.error("music/removeplaylist:NOT_FOUND", {
playlist = new DisTube.Playlist(pl); name
} else { });
return message.error("music/removeplaylist:NOT_FOUND", {
name playlist = new DisTube.Playlist(pl);
});
}
} }
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL"); if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");

View file

@ -22,21 +22,19 @@ class RemovePlaylist extends Command {
const playlists = data.userData.playlists; const playlists = data.userData.playlists;
for (const playlist of playlists) { for (const playlist of playlists) {
if (playlist.name === name) { if (!playlist.name === name) return message.error("music/removeplaylist:NOT_FOUND", {
const index = playlists.indexOf(playlist); name
playlists.splice(index, 1); });
data.userData.markModified("playlists"); const index = playlists.indexOf(playlist);
data.userData.save(); playlists.splice(index, 1);
message.success("music/removeplaylist:REMOVED", { data.userData.markModified("playlists");
name data.userData.save();
});
} else { message.success("music/removeplaylist:REMOVED", {
message.error("music/removeplaylist:NOT_FOUND", { name
name });
});
}
} }
} }
} }