diff options
| author | Justin <jtsshieh@outlook.com> | 2019-11-02 11:02:19 -0400 |
|---|---|---|
| committer | Justin <jtsshieh@outlook.com> | 2019-11-02 11:02:19 -0400 |
| commit | 7031fa12ba79281edc49df972311c13ad0e8fa53 (patch) | |
| tree | 60410a33fe45add85a9dc962c975be478f3f8cff /plugins/economy.js | |
| parent | 106530d5dc53166632a6a0ecc8930eb2b1ed4bfd (diff) | |
| download | PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.gz PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.tar.bz2 PokeBot-7031fa12ba79281edc49df972311c13ad0e8fa53.zip | |
es-lint settings added + linted all files
Diffstat (limited to 'plugins/economy.js')
| -rw-r--r-- | plugins/economy.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/economy.js b/plugins/economy.js index 3658ce8..a1273d7 100644 --- a/plugins/economy.js +++ b/plugins/economy.js @@ -12,10 +12,9 @@ exports.get = async (userid) => { const amount = await db.fetch(`money_${userid}`); if (amount) { return amount; - } - else { + } else { await db.set(`money_${userid}`, 0); - return await db.fetch(`money_${userid}`); + return db.fetch(`money_${userid}`); } }; @@ -23,8 +22,7 @@ exports.add = async (userid, money) => { const amount = await db.fetch(`money_${userid}`); if (amount) { await db.set(`money_${userid}`, amount + money); - } - else { + } else { await db.set(`money_${userid}`, money); } }; @@ -33,8 +31,7 @@ exports.subtract = async (userid, money) => { const amount = await db.fetch(`money_${userid}`); if (amount) { await db.set(`money_${userid}`, amount - money); - } - else { + } else { await db.set(`money_${userid}`, 0 - money); } }; |
