From e185d2278a07aa42714eaf47153abfaffc2e2cd8 Mon Sep 17 00:00:00 2001 From: Alee Date: Sun, 24 Jun 2018 09:35:34 -0400 Subject: Fixes the daily command and added the pay command --- commands/daily.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'commands/daily.js') diff --git a/commands/daily.js b/commands/daily.js index d5db462..0d844a2 100644 --- a/commands/daily.js +++ b/commands/daily.js @@ -21,7 +21,7 @@ const db = require('quick.db'); ms = require('parse-ms'); module.exports.run = async (client, message) => { -/* + let cooldown = 8.64e+7, amount = 100; @@ -34,11 +34,16 @@ module.exports.run = async (client, message) => { } else { message.channel.send(`You have successfully collected $${amount} dollars!`); + let balance = await db.fetch(`userBalance_${message.author.id}`); + + if (balance == null) { + db.set(`userBalance_${message.author.id}`, 0); + } + db.set(`lastDaily_${message.author.id}`, Date.now()); db.add(`userBalance_${message.author.id}`, 100); } -*/ - message.reply('This command is broken for now.'); + }; exports.conf = { -- cgit v1.2.3