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 🙏

© 2025 – Pkg Stats / Ryan Hefner

telbit

v2.0.9

Published

```markdown # Telbit 2.0.0

Downloads

46

Readme

# Telbit 2.0.0

**Telbit** es una librería asincrónica y simplificada para la creación de bots de Telegram. Ya no depende de Telegraf: ahora utiliza métodos propios para comunicarse directamente con la API de Telegram y es compatible con las últimas versiones de Node.js.

> 🚀 Instalación:

```bash
npm install telbit

Ejemplo básico

const bot = await telbit(TOKEN_KEY);
const chat = await bot.chat(1234556789);

const message = await chat.message("my text");

await message.edit("another text");
await message.delete();

bot.onMessage = async (message, chat, user) => {
    if(message.text === "super bad word") {
        await chat.ban(user);
        setTimeout(() => chat.unban(user), 100000);
    }
    else if(message.text === "soft bad word") {
        await chat.permisions(user, { write: false });
        setTimeout(() => chat.permisions(user, { write: true }), 100000);
    }
    else {
        await chat.send("Hello world!");
    }
}

✨ No olvides envolver tus llamadas con try/catch para manejar errores adecuadamente.


API

bot

  • onMessage: Setter para manejar todos los mensajes.
  • onLeftChatMember: Setter para cuando un miembro sale de cualquier chat.
  • onNewChatMember: Setter para cuando entra un nuevo miembro a cualquier chat.
  • chat(id): Crea una instancia chat a partir de un ID.
  • me: Retorna el user correspondiente a tu bot.
  • permissionsFactory: Atajo para crear objetos de permisos fácilmente reutilizables. Útil para restrictUser o restrictAllChatUsers.

chat

  • id: ID del chat.
  • onMessage: Setter específico para mensajes de este chat.
  • onLeftChatMember: Evento para miembros que se van de este chat.
  • onNewChatMember: Evento para nuevos miembros en este chat.
  • message(text): Envía un mensaje y retorna una instancia message.
  • ban(user): Banea un usuario del chat.
  • unban(user): Desbanea un usuario.
  • kick(user): Echa a un usuario del grupo.
  • restrictUser(user, permissions): Modifica los permisos de un usuario.
  • restrictAllChatUsers(permissions): Modifica los permisos de todos los usuarios del chat.

message

  • id: ID del mensaje.
  • edit(text): Edita el contenido del mensaje.
  • delete(): Elimina el mensaje.
  • text: Texto original del mensaje.
  • user: Usuario que envió el mensaje (telbit.user).
  • time: Timestamp de emisión.

user

Todos son getters:

  • id
  • username
  • firstname
  • lastname
  • bot: Booleano que indica si es un bot.

Licencia

MIT © 2025 — Hecho con cariño ✨

¿Tienes sugerencias o errores? ¡Haz un issue o pull request!