npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zeew-levels

v1.0.0

Published

NPM de niveles para creadores de bots de discord.js u otros en español - #ZeewDev

Downloads

5

Readme

¡Zeew Levels!

Zeew Api

Informacion

Yo se que quieres un sistema de niveles para tu bot de discord o tu app, a si que he pensando en ti 7w7 y he hecho este modulo.

Este modulo esta creado para usar con mysql, ya que es te no explotara cuando los datos sean demaciados.

Te recomiendo usar alwaysdata para tener una base de datos mysql de manera gratis.

#ZeewDEV #ZeewTEAM

Recuerda que si encuentras algun error, quieres aportar con una donacion o con codigo, puedes ingresar a nuestro servidor de discord o nuestra cuenta de twitter, github.

Si quieres ver un ejemplo puedes ir al github o ir a nuestra web.

Como usarlo

Todas las funciones de zeew levels son asyncronos, a si que no olvides el await y async

Primero debes hacer la conexion de mysql, te recomiendo usar mysql2. A qui te dejo el ejemplo. Se lo que necesitaras.

const mysql = require('mysql2');

const conexionMYSQL = mysql.createConnection({
    host,
    user,
    database
});

Una vez que lo tengas, pasa la conexion de mysql a zeewlevels.

NOTA Esta funcion solo debe existir una vez. Colocalo en el archivo principal.

zeewLevels.conexion(conexionMYSQL)

y ahora podras usar las funciones.

Metodos

La key es un indentificador. Por ejemplo la id del servidor, pero si sera global, pone algo que siempre tendran.

La id es el indentifacdor del usuario.

La amount es la cantidad que sera añadida o removida

El limit es para obtener cierta cantidad de datos

El limitXP es el limite de XP que necesita para que suba de nivel. Por defecto sera 1000.

El maxXP el maximo de XP random que pueden obtener. Por defecto sera de 5.

Principal

main: options

zeewLevels.main.options({limitXP, maxXP});

main: newLevel

Esta es la funcion que debes colocar en el evento de mensajes para que suban de nivel. Esta funcion tambien regresa el nivel subido.

zeewLevels.main.newLevel(id, key);

Obtener

Get: Level

zeewLevels.get.Level(id, key);

Get: XP

zeewLevels.get.XP(id, key);

Get: TOP

zeewLevels.get.TOP(key, limit);

Agregar

set: Level

zeewLevels.set.Level(id , key, amount);

set: XP

zeewLevels.set.XP(id , key, amount);

Eliminar

delete: User

zeewLevels.delete.user(id, id);

delete: All

Este elimina todo los datos en la base de datos, ten cuidado.

 zeewLevels.delete.all(key);