diff options
| author | Trey <trey6979@gmail.com> | 2018-04-06 13:37:22 -0400 |
|---|---|---|
| committer | Trey <trey6979@gmail.com> | 2018-04-06 13:37:22 -0400 |
| commit | 20b860bb2299d4a45aa9899fcab2b340cbe9a0b5 (patch) | |
| tree | 4022b84287f9df17854947a6f6ae98665719f209 /plugins/whitelist.js | |
| parent | b85b686829798f29f5f19fe919ae8807ef9ad69c (diff) | |
| parent | e39d116465334ce84ee06267e8defb6007dddf22 (diff) | |
| download | PokeBot-20b860bb2299d4a45aa9899fcab2b340cbe9a0b5.tar.gz PokeBot-20b860bb2299d4a45aa9899fcab2b340cbe9a0b5.tar.bz2 PokeBot-20b860bb2299d4a45aa9899fcab2b340cbe9a0b5.zip | |
Merge branch 'master' of https://github.com/PokeWorld/PokeBot
Diffstat (limited to 'plugins/whitelist.js')
| -rw-r--r-- | plugins/whitelist.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/plugins/whitelist.js b/plugins/whitelist.js new file mode 100644 index 0000000..41b4398 --- /dev/null +++ b/plugins/whitelist.js @@ -0,0 +1,28 @@ +/** ************************************** + * + * Whittelist: Plugin for PokeBot that let's the owners whitelist servers. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +const db = require('quick.db'); +exports.whitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, true); +}; + +exports.unwhitelist = async (guildID) => { + await db.set(`whitelist_${guildID}`, false); +}; + +exports.isWhitelist = async (guildID) => { + const value = await db.fetch(`whitelist_${guildID}`); + if (value) { + return value; + } + else { + await db.set(`whitelist_${guildID}`, false); + return await db.fetch(`whitelist_${guildID}`); + } +}; |
