From fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 22 May 2020 20:36:26 -0400 Subject: Added more ALP exclusive logs & cleaning up code --- deprecated/daily.js | 63 +++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 33 deletions(-) (limited to 'deprecated/daily.js') diff --git a/deprecated/daily.js b/deprecated/daily.js index 0d844a2..efb6c2e 100644 --- a/deprecated/daily.js +++ b/deprecated/daily.js @@ -1,5 +1,5 @@ -/**************************************** - * +/** ************************************** + * * Daily: Command for AleeBot * Copyright (C) 2018 AleeCorp * @@ -15,45 +15,42 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * *************************************/ const db = require('quick.db'); - ms = require('parse-ms'); +ms = require('parse-ms'); module.exports.run = async (client, message) => { + const cooldown = 8.64e+7; + const amount = 100; - let cooldown = 8.64e+7, - amount = 100; - - let lastDaily = await db.fetch(`lastDaily_${message.author.id}`); - - if (lastDaily !== null && cooldown - (Date.now() - lastDaily) > 0) { - let timeObj = ms(cooldown - (Date.now() - lastDaily)); + const lastDaily = await db.fetch(`lastDaily_${message.author.id}`); - message.reply(`You already collected your money, please wait **${timeObj.hours}h ${timeObj.minutes}m**!`) - } else { - message.channel.send(`You have successfully collected $${amount} dollars!`); + if (lastDaily !== null && cooldown - (Date.now() - lastDaily) > 0) { + const timeObj = ms(cooldown - (Date.now() - lastDaily)); - let balance = await db.fetch(`userBalance_${message.author.id}`); + message.reply(`You already collected your money, please wait **${timeObj.hours}h ${timeObj.minutes}m**!`); + } else { + message.channel.send(`You have successfully collected $${amount} dollars!`); - if (balance == null) { - db.set(`userBalance_${message.author.id}`, 0); - } + const balance = await db.fetch(`userBalance_${message.author.id}`); - db.set(`lastDaily_${message.author.id}`, Date.now()); - db.add(`userBalance_${message.author.id}`, 100); + if (balance == null) { + db.set(`userBalance_${message.author.id}`, 0); } - }; - - exports.conf = { - aliases: [], - guildOnly: false, - }; - exports.help = { - name: 'daily', - description: 'This gives you money everyday.', - usage: 'daily', - category: '- Economy Commands', - }; - \ No newline at end of file + db.set(`lastDaily_${message.author.id}`, Date.now()); + db.add(`userBalance_${message.author.id}`, 100); + } +}; + +exports.conf = { + aliases: [], + guildOnly: false, +}; +exports.help = { + name: 'daily', + description: 'This gives you money everyday.', + usage: 'daily', + category: '- Economy Commands', +}; -- cgit v1.2.3