UNPKG

discord-motto

Version:

Welcome to Discord Motto, a simple and easy to use package to set a server motto.

14 lines (9 loc) 402 B
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 null; fetched = JSON.parse(fetched.json) try { fetched = JSON.parse(fetched) } catch (e) {} if (params.ops.target) fetched = get(fetched, params.ops.target); return fetched; }