From a607a598160a780b44577a46b2833f4b456d007f Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 29 Feb 2020 17:16:00 +0100 Subject: [PATCH] Change compress message to be a nice embed --- commands/utility/download.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/commands/utility/download.js b/commands/utility/download.js index 8f459924..b247f298 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -58,6 +58,12 @@ class DownloadCommand extends Command { .setFooter(`You can get the original video by clicking on the "downloaded by ${message.author.username}" message!`); + let compressEmbed = this.client.util.embed() + .setColor(message.member.displayHexColor) + .setTitle('This one will need compression!') + .setDescription('Starting compression now!') + .setFooter('Want it to go faster? Donate to the dev with the donate command, so i can get a better server and do it faster!'); + if (link.includes('http') || link.includes('www')) { let loadingmsg = await message.channel.send('Downloading '); @@ -89,7 +95,7 @@ class DownloadCommand extends Command { //Compress vid if bigger than 8MB if (fileSize > 8) { - let compressmsg = await message.channel.send('Video bigger than 8MB compressing now (This can take a long time!)\nWant it to go faster? Donate to the dev with the donate command, so i can get a better server and do it faster!'); + let compressmsg = await message.channel.send(compressEmbed); loadingmsg.delete(); const options = { @@ -117,7 +123,8 @@ class DownloadCommand extends Command { // Every 5 seconds update the compress message with the % let editmsg = setInterval(() => { - compressmsg.edit(`Compression status: Percent complete: ${percentComplete}, ETA: ${eta}\nWant it to go faster? Donate to the dev with the donate command, so i can get a better server and do it faster!`); + compressEmbed.setDescription(`Ready in ${eta == '' ? 'soon enough' : eta}. ${percentComplete}% complete.`); + compressmsg.edit(compressEmbed); }, 5000); handbrake.on('end', async function () {