discord-warns

0.5.7 • Public • Published

Tired of not finding a good warning system? Here you have the solution

Information

Discord Warns is a module that facilitates developers to improve their applications or bots

Dev: Esponjosin

INSTALLATION

To install we simply do

$ npm i discord-warns@latest

NOTE

All npm has been restructured and is now more modular, you can now interact more effectively with the data Update to 0.5.7 mandatory

USE

const Warns = require('discord-warns')
 
const warns = new Warns({
  dir: __dirname
})
 
//If it is in discord you can do the warns by server adding an extra parameter called table, example
 
const warns = new Warns({
  dir: __dirname
  table: <guild>.id
})
 

Datebase Functions

Create

Create is a function that allows you to create a user's base data if they do not exist

 
/**
@param {string} [id] - Id where the data will be stored
*/
 
warns.create(id)
 

Get

Get is a function that allows you to get base data from an id

/**
@param {string} [id] - Id where the data will be get
*/
 
warns.get(id)
 

Delete

Delete is a function that deletes the data of an id

/**
@param {string} [id] - Id where the data will be deleted
*/
 
warns.delete(id)
 

All

All is a function that returns an array with all the data stored in the database

warns.all()
 

Find

Find is a function that allows obtaining data outside the current table, it only works with the unique identifier

 
/**
@param {string} [_id] - Unique identifier that is created when data is created
*/
 
warns.delete(id)
 

Data Functions

Data is a constructor that is returned when getting / creating data from an id

Add

Add is a function that adds a warning

 
/**
@param {string/object} [moderator] - ID of the creator of the notice or User object of discord.js
@param {string} [reason] - Reason for warning (default: Misbehavior)
*/
 
<Data>.add(moderator, reason)
 

Get

Get is a function that allows you to obtain the data of x warn

 
/**
@param {string} [id] - Unique creator identifier when adding a warn
*/
 
<Data>.get(id)
 

Delete

Delete is a function that allows you to delete a notice using its unique identifier

 
/**
@param {string} [id] - Unique creator identifier when adding a warn
*/
 
<Data>.delete(id)
 

Package Sidebar

Install

npm i discord-warns

Weekly Downloads

6

Version

0.5.7

License

ISC

Unpacked Size

9.67 kB

Total Files

6

Last publish

Collaborators

  • esponjosin