forked from Supositware/Haha-Yes
use attachment
This commit is contained in:
parent
c5f2e2d39f
commit
0e079683cb
1 changed files with 9 additions and 2 deletions
|
@ -28,6 +28,13 @@ class vidshittifierCommand extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
async exec(message, args) {
|
async exec(message, args) {
|
||||||
|
let Attachment = (message.attachments).array();
|
||||||
|
let url = args.link;
|
||||||
|
// Get attachment link
|
||||||
|
if (Attachment[0] && !args.link) {
|
||||||
|
url = Attachment[0].url;
|
||||||
|
}
|
||||||
|
|
||||||
let input = `${os.tmpdir()}/${message.id}.mp4`;
|
let input = `${os.tmpdir()}/${message.id}.mp4`;
|
||||||
let output = `${os.tmpdir()}/Shittifyed${message.id}.mp4`;
|
let output = `${os.tmpdir()}/Shittifyed${message.id}.mp4`;
|
||||||
let compression;
|
let compression;
|
||||||
|
@ -42,8 +49,8 @@ class vidshittifierCommand extends Command {
|
||||||
|
|
||||||
let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>');
|
let loadingmsg = await message.channel.send('Processing <a:loadingmin:527579785212329984>');
|
||||||
|
|
||||||
if (args.link) {
|
if (url) {
|
||||||
return youtubedl.exec(args.link, ['-o', input], {}, function(err) {
|
return youtubedl.exec(url, ['-o', input], {}, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
loadingmsg.delete();
|
loadingmsg.delete();
|
||||||
|
|
Loading…
Reference in a new issue