rubenn.db

0.1.3 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i rubenn.db

Weekly Downloads

4

Version

0.1.3

License

MIT

Unpacked Size

21.4 kB

Total Files

14

Last publish

Collaborators

  • ruben453