Compare commits
2 commits
27fc1c55bf
...
f4ffcbebde
Author | SHA1 | Date | |
---|---|---|---|
f4ffcbebde | |||
2073a46715 |
1 changed files with 2 additions and 3 deletions
|
@ -9,8 +9,7 @@ module.exports = {
|
||||||
"Usage: <prefix>dl <url>"
|
"Usage: <prefix>dl <url>"
|
||||||
],
|
],
|
||||||
async execute({message, args}) {
|
async execute({message, args}) {
|
||||||
|
const downloadsDir = path.resolve(process.cwd(), 'data', 'downloads', Date.now().toString());
|
||||||
const downloadsDir = path.resolve(process.cwd(), 'data', 'downloads', Math.floor(new Date).toString());
|
|
||||||
const cookieFilepath = path.resolve(process.cwd(), 'data', 'cookies.txt')
|
const cookieFilepath = path.resolve(process.cwd(), 'data', 'cookies.txt')
|
||||||
if(!fs.existsSync(cookieFilepath)) {
|
if(!fs.existsSync(cookieFilepath)) {
|
||||||
message.channel.send("Some dependencies are needed for the command to work properly. Please let the bot's owner know.")
|
message.channel.send("Some dependencies are needed for the command to work properly. Please let the bot's owner know.")
|
||||||
|
@ -46,7 +45,7 @@ module.exports = {
|
||||||
|
|
||||||
|
|
||||||
let files = fs.readdirSync(downloadsDir);
|
let files = fs.readdirSync(downloadsDir);
|
||||||
if(files < 1) {
|
if(files.length < 1) {
|
||||||
this.cleanUp(downloadsDir);
|
this.cleanUp(downloadsDir);
|
||||||
originalMessage.edit("Something went wrong when downloading the video.")
|
originalMessage.edit("Something went wrong when downloading the video.")
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue