discord-motto
Version:
Welcome to Discord Motto, a simple and easy to use package to set a server motto.
15 lines (10 loc) • 450 B
JavaScript
// Require Packages
const get = require('./lg');
module.exports = function(db, params, options) {
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
if (!fetched) return false;
else fetched = JSON.parse(fetched.json);
try { fetched = JSON.parse(fetched) } catch (e) {}
if (params.ops.target) fetched = get(fetched, params.ops.target);
return (typeof fetched != 'undefined');
}