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

gl.telegram-bot

v1.9.9

Published

Telegram bot API for easy access on typescript/javascript

Readme

Table of Contents

Must have

Before you get start make sure you already have a telegram bot

How to create a telegram bot

  1. Access BotFather: Open the Telegram app and search for "@BotFather"
  2. Start a conversation: Click "Start" to begin interacting with BotFather.
  3. Create a new bot: Send the command "/newbot".
  4. Provide details: Enter a name for your bot and a unique username that must end with "bot".
  5. Receive your token: Once created, BotFather will provide you with your bot's access token, which is necessary to interact with your bot using code.

Get started

Installation

Using npm:

$ npm install gl.telegram-bot

Creating instance of bot

You can use this bot instance to call its bot actions

import TelegramBot from "gl.telegram-bot";

const botInstance = new TelegramBot('1234567:ASJHR24-93145uASJHF-ASDIRFJ3158');

Bot Actions

sendMessage

tip: to get channel the channel id you can enter the following url on your browser
https://api.telegram.org/bot$BOT_TOKEN/getUpdates \

if your token is something like this: 123456-78910
you should add bot as prefix and the ouput should be like this: bot123456-78910

This action sends a message to an individual group

// send to 1 group id
botInstance.sendMessage('test message', '-100123456789');

// send to multiple groups
botInstance.sendMessage('test message', ['-100123456789', '-100987654321']);

getUpdates

@return_type - object;
It gets the recent updates on your bot

const updates = await botInstance.getUpdates();

// this is 
console.log(updates);

getGroupIDs

@return_type - number[];
Basically, it uses getUpdates and then get all its channel id's

const groupIDs = await botInstance.getGroupIDs();

// this is 
console.log(updates);