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

galaxy-tm

v0.0.37

Published

una api de gifs y con algunas funciones

Downloads

11

Readme

Galaxy

Un npm de gifs para bots de discord

Instalación

$ npm install --save galaxy-tm

Modo de uso

Gifs: eat,punch.shoot,hug,kiss,pat,slap,poke,dance
Imagenes: Proximamente
Funciones: Niveles
const Galaxy = require('galaxy-tm');

Galaxy.Getgif('kiss').then(x => console.log(x));

//Resultado:
"https://media1.tenor.com/images/a47469a428c7ff57d89a8118f801619a/tenor.gif?itemid=19055016"

Funcion de niveles

const Galaxy = require('galaxy-tm');

//<-----------------------------XP-------------------------------->
Galaxy.addxp(message,member.id,number)//añade xp a los usuarios
Galaxy.removexp(message,member.id,number || all)//remueve xp a los usuarios
Galaxy.setxp(message,member.id,number)//coloca xp a los usarios

//<-----------------------------LEVEL----------------------------------------->

Galaxy.addlevel(message,member.id,number)//añade nivel a los usuarios
Galaxy.removelevel(message,member.id,number || all)//remueve nivel a los usuarios
Galaxy.setlevel(message,member.id,number)//coloca nivel a los usarios

//<-----------------------------otros----------------------------------------->

Galaxy.getrank(message, member.id)//muestra el rango del usuario
Galaxy.fetch(message, member.id)//muestra el nivel y xp del usuario
Galaxy.leaderboard(message)// muestra la leaderboard del servidor(array)

Ejemplo en un bot

const Galaxy = require('galaxy-tm');

const Discord = require('discord.js');

const client = new Discord.Client();

const settings = {
  prefix: 'PREFIX',
  token: 'YOUR TOKEN'
}

client.on('message', async message => {


const {
xp, nivel
} =  Galaxy.fetch(message, message.author.id)


let randomxp = Math.floor(Math.random() * 35) + 1 + nivel * 2;

let levelup = 5 * (nivel ** 2) + 50 * nivel + 100;

if((xp + randomxp) >= levelup) {
Galaxy.addlevel(message,message.author.id,1)
Galaxy.removexp(message,message.author.id,'all')
console.log('Subio de nivel')
} else{
  
Galaxy.addxp(message,message.author.id,randomxp)
    console.log('Subio de xp')
}

});

Ejemplos

//<----------------------------LEADERBOARD----------------------------->

const Galaxy = require('galaxy-tm');// el npm

let usuarios = Galaxy.leaderboard(message) // la leaderboard en un array 

let b = 1;

let us = usuarios.map((usuario, index) => usuario[index] = `${b++}.- ${client.users.cache.get(usuario['id']).username} | Nivel: ${usuario['Nivel']} |Xp: ${usuario['xp']}/${5 * (usuario['Nivel'] ** 2) + 50 * usuario['Nivel'] + 100}` )// mapeamos los objetos para que nos de un resultado como : 1.- <usuario> | Nivel: <nivel> | Xp: <xp>


let paginas = []; // la paginas pero solo usaremos la 1

while(us.length>0){ // metemos los usuarios a un 2 array

paginas.push(us.splice(0,10))

}
 

const embed = new Discord.MessageEmbed()// el embed

.setAuthor(message.author.username,message.author.displayAvatarURL())
.setTitle('Lederboard '+message.guild.name+' Top: 10')
.setDescription(paginas[0].join('\n\n')) // los usuarios
.setColor('RANDOM')
.setThumbnail(message.guild.iconURL())
.setFooter('Tu ranking: ' +Galaxy.getrank(message,message.author.id))// el ranking de quien uso el comando

message.channel.send(embed)

//RESULTADO:

Resultado de leaderboard

Agradecimientos/Informacion

agradesco a
匚丹尺ㄥ口ち 乃)#3845 -> Hiso la mayoria de interaciones

⚔🗡🛡 𝓣𝓱𝓮 𝓰𝓸𝓭🛡🗡 ⚔#0254 -> Owner

Invita al bot oficial Click y entra al server de soporte Click