🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/telegram

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/telegram

Telegram Bot API client for sending messages, photos, documents, locations, polls, stickers, and managing chats

latest
npmnpm
Version
0.3.0
Version published
Weekly downloads
12
-7.69%
Maintainers
4
Weekly downloads
 
Created
Source

@robinpath/telegram

Telegram Bot API client for sending messages, photos, documents, locations, polls, stickers, and managing chats

Category Functions Auth License

Why use this module?

The telegram module lets you:

  • Get info about the bot (id, first_name, username)
  • Send a text message to a chat
  • Send a photo from a local file to a chat
  • Send a document/file from a local path to a chat
  • Send a GPS location to a chat

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

robinpath add @robinpath/telegram

Quick Start

1. Set up credentials

telegram.setToken "default" "123456:ABC-DEF..."

2. Get info about the bot (id, first_name, username)

telegram.getMe "default"

Available Functions

FunctionDescription
telegram.setTokenStore a Telegram bot token for subsequent API calls
telegram.getMeGet info about the bot (id, first_name, username)
telegram.sendSend a text message to a chat
telegram.sendPhotoSend a photo from a local file to a chat
telegram.sendDocumentSend a document/file from a local path to a chat
telegram.sendLocationSend a GPS location to a chat
telegram.sendPollSend a poll to a chat
telegram.editMessageEdit the text of an existing message
telegram.deleteMessageDelete a message from a chat
telegram.getUpdatesReceive incoming updates via long polling
telegram.sendStickerSend a sticker by file_id to a chat
telegram.getChatGet up-to-date information about a chat

Examples

Get info about the bot (id, first_name, username)

telegram.getMe "default"

Send a text message to a chat

telegram.send "default" "-100123456" "Hello from RobinPath!"

Send a photo from a local file to a chat

telegram.sendPhoto "default" "-100123456" "/tmp/photo.jpg" {"caption": "Look at this!"}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/telegram";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  telegram.setToken "default" "123456:ABC-DEF..."
  telegram.getMe "default"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

License

MIT

Keywords

telegram

FAQs

Package last updated on 06 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts