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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@botgate/sdk

v1.0.1

Published

SDK oficial do BotGate para integrar configurações de servidor no seu bot.

Readme

@botgate/sdk

SDK oficial do BotGate para integrar as configurações do Dashboard diretamente no seu bot.

Instalação

npm install @botgate/sdk

Como funciona

Quando um dono de servidor configura seu bot pelo BotGate Dashboard, as preferências dele (prefixo, canal de boas-vindas, etc.) ficam salvas no banco de dados do BotGate.

Esta lib permite que o seu bot leia essas configs em tempo real, com cache local automático para não sobrecarregar a API.


Uso rápido

import { BotGateSDK } from "@botgate/sdk";

// 1. Inicializar uma vez (no arquivo principal do bot)
const botgate = new BotGateSDK({
  apiKey: "sua-api-key-do-botgate",
  debug: true, // opcional: mostra logs no console
});

// 2. Usar em qualquer evento
client.on("messageCreate", async (message) => {
  if (!message.guild) return;

  // Busca configs do servidor (com cache de 5 minutos automático)
  const settings = await botgate.getGuildSettings(message.guild.id);

  const prefix = settings.prefix ?? "!";
  if (!message.content.startsWith(prefix)) return;

  // ... lógica do seu bot
  console.log(`Prefixo usado: ${prefix}`);
});

// 3. Módulo de boas-vindas
client.on("guildMemberAdd", async (member) => {
  const settings = await botgate.getGuildSettings(member.guild.id);

  if (!settings.welcome_enabled) return;

  const channel = member.guild.channels.cache.get(
    settings.welcome_channel_id ?? "",
  );
  if (!channel?.isTextBased()) return;

  const msg = (settings.welcome_message ?? "Bem-vindo, {user}!").replace(
    "{user}",
    member.toString(),
  );

  channel.send(msg);
});

// 4. Módulo de logs de auditoria
client.on("messageDelete", async (message) => {
  if (!message.guild) return;
  const settings = await botgate.getGuildSettings(message.guild.id);

  if (!settings.logs_enabled) return;

  const logChannel = message.guild.channels.cache.get(
    settings.logs_channel_id ?? "",
  );
  if (!logChannel?.isTextBased()) return;

  logChannel.send(
    `🗑️ Mensagem deletada em ${message.channel}: ${message.content}`,
  );
});

Configurações disponíveis

| Campo | Tipo | Descrição | | -------------------- | --------- | ---------------------------------------------------- | | prefix | string | Prefixo dos comandos do bot | | welcome_enabled | boolean | Liga/desliga o módulo de boas-vindas | | welcome_channel_id | string | ID do canal de boas-vindas | | welcome_message | string | Mensagem personalizada. Use {user} para mencionar. | | logs_enabled | boolean | Liga/desliga o módulo de auditoria | | logs_channel_id | string | ID do canal de logs |


API

new BotGateSDK(config)

| Opção | Tipo | Padrão | Descrição | | ---------- | --------- | ------- | -------------------------------------------- | | apiKey | string | — | API Key do bot no BotGate (obrigatório) | | cacheTtl | number | 300 | Segundos que as configs ficam em cache local | | debug | boolean | false | Ativa logs detalhados no console |

getGuildSettings(guildId, forceRefresh?)

Busca as configs de um servidor. Retorna {} vazio se o servidor ainda não foi configurado (nunca vai quebrar o bot).

const settings = await botgate.getGuildSettings("123456789");

clearCache(guildId?)

Limpa o cache de um servidor específico ou de todos.

botgate.clearCache("123456789"); // limpa um servidor
botgate.clearCache(); // limpa tudo

Licença

MIT