Modules@robinpath/telegram

@robinpath/telegram

0.1.0Public

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

@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

npm install @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.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/telegram
Version0.1.0
LicenseMIT
Unpacked Size5.9 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday