Thanks to this module, you can bring many features by a single module.
First install Node.JS. Then:
npm install discord.lux
// Using Node.js `require()`
const lux = require("discord.lux");
// Using ES6 imports
import lux from "discord.lux";
- luxDB - simple way to store data into mongodb
const { luxDB } = require("discord.lux");
// or
import { luxDB } from "discord.lux";
const db = new luxDB(client, {
uri: "your mongodb connection string",
});
module.exports = db;
const db = require("./db.js"); // replace db.js with your file path to the setup of luxDB
db.set("numbers", "123");
// saves data to database
db.set("key", "value");
// gets value from key
db.get("key"); // returns => value
// returns boolean
db.has("key"); // returns => true
// deletes data
db.delete("key");
// checking for data
db.has("key"); // returns => false