Compare commits

..

2 commits

Author SHA1 Message Date
8863fa6050 Handle error 2021-03-04 13:34:49 +01:00
57ad39102f Fixed the 1 year attachment requirement 2021-03-04 13:34:14 +01:00
2 changed files with 7 additions and 3 deletions

View file

@ -48,8 +48,8 @@ class tweetCommand extends Command {
}
// If account is less than 1 year old don't accept attachment
if (Attachment[0] && message.author.createdAt > date.setMonth(date.getMonth() - 12)) {
return message.channel.send('Your account need to be 6 months or older to be able to send attachment!');
if (Attachment[0] && message.author.createdAt > date.setFullYear(date.getFullYear() - 1 )) {
return message.channel.send('Your account need to be 1 year or older to be able to send attachment!');
}
if (args.text) {

View file

@ -114,6 +114,10 @@ class DownloadCommand extends Command {
message.channel.send({
embed: Embed,
files: [`${os.tmpdir()}/${message.id}compressed.mp4`]
})
.catch(err => {
console.error(err);
return message.channel.send(`${err.name}: ${err.message} ${err.message === 'Request entity too large' ? 'The file size is too big' : ''}`);
});
});
} else {