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

bot-perms

v1.2.1

Published

Gerenciador de perms

Downloads

2

Readme

Bot perms, uma sub-livraria compacta.

Porém, mas o que ela faz?

A package é um simples e compacta sobre permissões de bots, ela retorna caso o bot não tiver uma certa permissão ou o usuario que executou o comando

Exemplo

Obs: Para você usar essa package, você precisará da package: discord.js

const discord = require("discord.js")
const client = new discord.Client();

client.on('message', msg => {
    if(msg.content === "diga oi") {

       const api = require("bot-perms") 

        class codeClass {
         constructor() {
            msg.channel.send("oi")
        }
    }

  new api.requestPerm("BAN_MEMBERS",msg.channel.id,msg.member,client,codeClass) // ele irá retornar caso o bot ou o membro não tenha a permissão de banir membros. (todos argumentos são obrigátorios)

  }
})


client.login("token")

Você também pode costumizar suas mensagens

const discord = require("discord.js")
const client = new discord.Client();

client.on('message', msg => {
    if(msg.content === "diga oi") {

       const api = require("bot-perms") 

        class codeClass {
         constructor() {
            msg.channel.send("oi")
        }
    }

  new api.requestPerm("BAN_MEMBERS",msg.channel.id,msg.member,client,codeClass,{
    textUser: "vc precisa da perm {perm}",
    textBot = "eu preciso da perm {perm}"
  }) // ele irá retornar caso o bot ou o membro não tenha a permissão de banir membros. (todos argumentos são obrigátorios, menos o do objeto ( {} ).)

  }
})


client.login("token")

Opções

options = Object
options.textBot = "texto do que o bot vai falar que não tem permissão(opcional) - String"
options.textUser = "texto do que o bot vai falar caso o usuario não tenha permissão - String"
options.color = "Cor da embed em código hex - String"
options.ignoreUser = "Se pode ignorar o usuario - Boolean"
options.ignoreBot = "Se pode ignorar o bot, caso ele não tenha perm ele vai retornar o  comando normal. - Boolean"

Todas opções não são obrigátorias

Todas as permissões estão aqui:

ADMINISTRATOR
CREATE_INSTANT_INVITE
KICK_MEMBERS
BAN_MEMBERS
MANAGE_CHANNELS
MANAGE_GUILD
ADD_REACTIONS
VIEW_AUDIT_LOG
PRIORITY_SPEAKER
STREAM
VIEW_CHANNEL
SEND_MESSAGES
SEND_TTS_MESSAGES
MANAGE_MESSAGES
EMBED_LINKS
ATTACH_FILES
READ_MESSAGE_HISTORY
MENTION_EVERYONE
USE_EXTERNAL_EMOJIS
VIEW_GUILD_INSIGHTS
CONNECT 
SPEAK 
MUTE_MEMBERS 
DEAFEN_MEMBERS
MOVE_MEMBERS
USE_VAD 
CHANGE_NICKNAME
MANAGE_NICKNAMES
MANAGE_ROLES
MANAGE_WEBHOOKS
MANAGE_EMOJIS