Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@busshi/telegram-api

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@busshi/telegram-api

Basic Telegram API to interact with your bot

  • 2.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

publish

npm-telegram-api

Node package for the Telegram API

Installation

yarn add @busshi/telegram-api or npm install @busshi/telegram-api

Functionnalities

MethodParameters
sendMessage
  • chatId: string
  • text: string
  • disableNotification: boolean (optional, default: false)
editMessage
  • chatId: string
  • messageId: string
  • text: string
deleteMessage
  • chatId: string
  • messageId: string
sendPhoto
  • chatId: string
  • picUrl: string
  • disableNotification: boolean (optional, default: false)
sendDocument
  • chatId: string
  • fileUrl: string
  • disableNotification: boolean (optional, default: false)
sendVideoNote
  • chatId: string
  • videoUrl: string
  • disableNotification: boolean (optional, default: false)
sendPoll
  • chatId: string
  • question: string
  • options: string[]
  • disableNotification: boolen (optional, default: false)
  • isAnonymous: boolean (optional, default: false)
sendSticker
  • chatId: string
  • stickerId: string
sendDice
  • chatId: string (get a random number from 1 to 6)

Usage

import Telegram from '@busshi/telegram-api';

const telegram = new Telegram(BOT_TOKEN);

const req = await telegram.sendMessage(CHAT_ID, 'Hello world!');
const messageId = req.dat.result.message_id;

telegram.editMessage(CHAT_ID, messageId, 'Edited message');

telegram.deleteMessage(CHAT_ID, messageId);

telegram.sendPhoto(CHAT_ID, PICTURE_URL);

telegram.sendDocument(CHAT_ID, DOCUMENT_URL);

telegram.sendVideoNote(CHAT_ID, VIDEO_URL);

telegram.sendPoll(CHAT_ID, QUESTION, OPTIONS);
telegram.sendPoll(CHAT_ID, 'Is it working?', ['yes', 'no']);

telegram.sendSticker(CHAT_ID, STICKER_ID);
telegram.sendSticker(CHAT_ID, 'CAACAgIAAxkBAAI6GV6vP_F6BaWapEmBZ2k8e8yBi2xMAAICAwACusCVBTRFBuRNlNodGQQ');

telegram.sendDice(CHAT_ID);

Keywords

FAQs

Package last updated on 12 Dec 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc