aboutsummaryrefslogtreecommitdiff
path: root/deprecated/daily.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-05-22 20:36:26 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-05-22 20:36:26 -0400
commitfc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab (patch)
tree0f4930fd8655e550c974bc404b93149cf7eab4ac /deprecated/daily.js
parentbbb982243b6564e526fb581f55946704cdf256a3 (diff)
downloadAleeBot-fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab.tar.gz
AleeBot-fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab.tar.bz2
AleeBot-fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab.zip
Added more ALP exclusive logs & cleaning up code
Diffstat (limited to 'deprecated/daily.js')
-rw-r--r--deprecated/daily.js63
1 files changed, 30 insertions, 33 deletions
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 <http://www.gnu.org/licenses/>.
- *
+ *
* *************************************/
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',
+};