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

syntax-sdk

v1.0.0

Published

SDK oficial para integração de bots com a economia e telemetria da Syntax

Readme

Syntax SDK (Node.js & Bun)

O SDK oficial para integração de bots de Discord com a API da Syntax Bot List & Economia.

Com esta biblioteca, você pode facilmente verificar se os usuários votaram no seu bot (para liberar recompensas ou comandos exclusivos) e enviar pings de telemetria/uptime ativos para atualizar o status e exibir gráficos de latência no painel da Syntax.

🔗 Links Úteis

📦 Instalação

Instale o pacote usando seu gerenciador de pacotes favorito:

npm install syntax-sdk
# ou
yarn add syntax-sdk
# ou
bun add syntax-sdk

🚀 Como Usar

1. Inicialização

Obtenha a sua Chave Secreta do SDK na aba de configurações do seu bot no Dashboard da Syntax e configure no construtor:

import { SyntaxClient } from "syntax-sdk";

const syntax = new SyntaxClient({
  token: "SUA_CHAVE_SECRETA_DO_SDK", // Mantenha isso em segredo (env vars)
  guildId: "724823792794337301",      // ID do servidor da botlist
  appId: "847178737010344006"        // ID do seu bot
});

2. Verificar Voto de Usuário

Use o método checkVote para verificar se o usuário votou recentemente. Isso é ideal para bloquear comandos VIP ou recompensar usuários ativos.

try {
  const vote = await syntax.checkVote("ID_DO_USUARIO_DISCORD");
  
  if (vote.voted) {
    console.log("Usuário já votou!");
    console.log(`Cooldown expira em: ${vote.cooldownExpiresAt}`);
    console.log(`Tempo restante: ${vote.timeRemaining}ms`);
  } else {
    console.log("Usuário ainda não votou.");
  }
} catch (error) {
  console.error("Erro ao validar voto:", error.message);
}

3. Enviar Telemetria Ativa (Opcional)

Você pode enviar pings de telemetria periódicos para registrar a latência em tempo real e atualizar a quantidade de servidores do bot na vitrine. Isso garante o status online no monitor de uptime!

// Exemplo em um evento 'ready' ou com setInterval a cada 2 minutos:
setInterval(async () => {
  try {
    await syntax.sendPing({
      latency: client.ws.ping,      // Latência em milissegundos
      guildCount: client.guilds.cache.size // Quantidade total de servidores
    });
    console.log("Telemetria enviada com sucesso para a Syntax!");
  } catch (error) {
    console.error("Falha ao enviar telemetria:", error.message);
  }
}, 120_000);

💰 Economia de Syntax Coins

A Syntax Bot List conta com um sistema ativo de moedas! Ao votar no seu bot pelo site ou pelo Discord, o usuário recebe Syntax Coins diretamente na carteira dele como recompensa. Divulgar o link de votação do seu bot ajuda a impulsionar sua aplicação e distribui recompensas para sua comunidade!

📄 Licença

Distribuído sob a licença MIT.