diff options
| author | Alee <Alee14498@gmail.com> | 2019-10-21 04:53:18 +0000 |
|---|---|---|
| committer | Alee <Alee14498@gmail.com> | 2019-10-21 04:53:18 +0000 |
| commit | b6d9e3305107c221741108a8de7559c9d7f59f14 (patch) | |
| tree | 695881f957dd9071f73c48ad6614499151b02b0a | |
| parent | 95917207f3ac60f9849dd2010d9a632b480d26db (diff) | |
| download | PokeBot-b6d9e3305107c221741108a8de7559c9d7f59f14.tar.gz PokeBot-b6d9e3305107c221741108a8de7559c9d7f59f14.tar.bz2 PokeBot-b6d9e3305107c221741108a8de7559c9d7f59f14.zip | |
Got economy back + removed outdated help
| -rw-r--r-- | bot.js | 2 | ||||
| -rw-r--r-- | commands/Getting Started/help.js | 2 | ||||
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | plugins/economy.js | 40 |
4 files changed, 43 insertions, 3 deletions
@@ -17,7 +17,7 @@ bot.aliases = new Discord.Collection(); bot.categories = new Discord.Collection(); bot.queue = new Discord.Collection(); bot.plugins = { - //economy : require('./plugins/economy.js'), + economy : require('./plugins/economy.js'), settings : require('./plugins/settings.js'), whitelist: require('./plugins/whitelist.js'), gyms : require('./plugins/gyms.js')}; diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js index 1e5ebdb..8c05e40 100644 --- a/commands/Getting Started/help.js +++ b/commands/Getting Started/help.js @@ -14,7 +14,7 @@ exports.run = (bot, msg, args) => { embed .setColor (0x36393e) .setTitle('PokeBot Command List') - .setDescription('Our main VPS just died, so now we host PokeBot on a RPI with pings of over 2000 MS. Therefore, we need to rely on you for our funding. Please support us using the below links to keep this project alive!\nhttps://patreon.com/pallet\nhttps://fiverr.com/universedg') + .setDescription('PokeBot is back :D') .setFooter('PokeBot v1.0'); const categories = Array.from(bot.categories.keys()); diff --git a/package.json b/package.json index 1851abe..139a221 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "", "main": "bot.js", "scripts": { - "test": "node test.js" + "start": "node bot.js" }, "author": "Alee, Justin, and Trey", "license": "GPL-3.0", diff --git a/plugins/economy.js b/plugins/economy.js new file mode 100644 index 0000000..3658ce8 --- /dev/null +++ b/plugins/economy.js @@ -0,0 +1,40 @@ +/** ************************************** + * + * Economy: Plugin for PokeBot that enables economy features. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.get = async (userid) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + return amount; + } + else { + await db.set(`money_${userid}`, 0); + return await db.fetch(`money_${userid}`); + } +}; + +exports.add = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount + money); + } + else { + await db.set(`money_${userid}`, money); + } +}; + +exports.subtract = async (userid, money) => { + const amount = await db.fetch(`money_${userid}`); + if (amount) { + await db.set(`money_${userid}`, amount - money); + } + else { + await db.set(`money_${userid}`, 0 - money); + } +}; |
