forked from Supositware/Haha-Yes
Use event for download
This commit is contained in:
parent
e956ac6d2f
commit
dcf299bcf2
3 changed files with 6 additions and 6 deletions
|
@ -60,11 +60,11 @@ class midifyCommand extends Command {
|
|||
|
||||
if (url) {
|
||||
downloader(url, null, input)
|
||||
.catch((err) => {
|
||||
.on('error', (err) => {
|
||||
loadingmsg.delete();
|
||||
return message.channel.send(err, { code: true });
|
||||
})
|
||||
.then(output => {
|
||||
.on('end', output => {
|
||||
// Convert to wav
|
||||
ffmpeg()
|
||||
.input(output)
|
||||
|
|
|
@ -57,11 +57,11 @@ class vidshittifierCommand extends Command {
|
|||
|
||||
if (url) {
|
||||
downloader(args.link, null, input)
|
||||
.catch((err) => {
|
||||
.on('error', (err) => {
|
||||
loadingmsg.delete();
|
||||
return message.channel.send(err, { code: true });
|
||||
})
|
||||
.then(() => {
|
||||
.on('end', () => {
|
||||
shittifie();
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -137,11 +137,11 @@ class ytpCommand extends Command {
|
|||
|
||||
if (url) {
|
||||
return downloader(url, ['--format=mp4'], `./asset/ytp/userVid/${message.id}.mp4`)
|
||||
.catch((err) => {
|
||||
.on('error', (err) => {
|
||||
loadingmsg.delete();
|
||||
return message.channel.send(err, { code: true });
|
||||
})
|
||||
.then(async output => {
|
||||
.on('end', async output => {
|
||||
const hash = md5File.sync(output);
|
||||
const ytphash = await ytpHash.findOne({where: {hash: hash}});
|
||||
|
||||
|
|
Loading…
Reference in a new issue