rubenn.db
v0.1.3
Published
A simple JSON database that allows you to interact with it.
Readme
A JSON database that allows users to interact with it easy
Current functions are:
.ensure(userid) basically prepares an ID for an user.
.get(userid) returns the value of given user id.
.inc(userid) increases the variable value of given user id by 1.
.add(userid, value) adds a value to the variable of given user id.
Change Log:
-Added .add(userid, value) and .inc(userid).
-Now if there something missing in the function it will return an error on the console.
Heres an example by using .ensure and .get functions:
const Discord = require('discord.js')
const client = new Discord.Client()
client.on('message', message => {
if (message.content.startsWith("!total")) {
db.ensure(message.author.id)
let messages = db.get(message.author.id)
message.channel.send(`${message.author.username} you have ${messages} messages sent`)
}});rubenn.db is used for Discord.js, for beginners in Discord.js or without knowledge about Databases.
If you need any kind of help, join to our support server.
