Skip to content

Commit

Permalink
Add alias for playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
eritislami committed Jun 12, 2020
1 parent c92fe53 commit ad8fcff
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions commands/playlist.js
Expand Up @@ -6,7 +6,7 @@ const youtube = new YouTubeAPI(YOUTUBE_API_KEY);

module.exports = {
name: "playlist",
aliases: ['pl'],
aliases: ["pl"],
description: "Play a playlist from youtube",
async execute(message, args) {
const { PRUNING } = require("../config.json");
Expand Down Expand Up @@ -79,20 +79,21 @@ module.exports = {
}
});

if (!PRUNING) {
let playlistEmbed = new MessageEmbed()
.setTitle(`${playlist.title}`)
.setDescription(queueConstruct.songs.map((song, index) => `${index + 1}. ${song.title}`))
.setURL(playlist.url)
.setColor("#F8AA2A");
let playlistEmbed = new MessageEmbed()
.setTitle(`${playlist.title}`)
.setURL(playlist.url)
.setColor("#F8AA2A")
.setTimestamp();

playlistEmbed.setTimestamp();
if (!PRUNING) {
playlistEmbed.setDescription(queueConstruct.songs.map((song, index) => `${index + 1}. ${song.title}`));
if (playlistEmbed.description.length >= 2048)
playlistEmbed.description =
playlistEmbed.description.substr(0, 2007) + "\nPlaylist larger than character limit...";
message.channel.send(`${message.author} Started a playlist`, playlistEmbed);
}

message.channel.send(`${message.author} Started a playlist`, playlistEmbed);

if (!serverQueue) message.client.queue.set(message.guild.id, queueConstruct);

if (!serverQueue) {
Expand Down

0 comments on commit ad8fcff

Please sign in to comment.