0.66.0 • Published 6 months ago

node-telegram-bot-api v0.66.0

Weekly downloads
76,965
License
MIT
Repository
github
Last release
6 months ago

Node.js module to interact with the official Telegram Bot API.

Bot API npm package Build Status Coverage Status

https://telegram.me/node_telegram_bot_api https://t.me/+nc3A9Hs1S81mYzdk https://telegram.me/Yago_Perez

📦 Install

npm i node-telegram-bot-api

✍️ Note: If you use Typescript you can install this package that contains type definitions for this library

npm install --save-dev @types/node-telegram-bot-api

🚀 Usage

const TelegramBot = require('node-telegram-bot-api');

// replace the value below with the Telegram token you receive from @BotFather
const token = 'YOUR_TELEGRAM_BOT_TOKEN';

// Create a bot that uses 'polling' to fetch new updates
const bot = new TelegramBot(token, {polling: true});

// Matches "/echo [whatever]"
bot.onText(/\/echo (.+)/, (msg, match) => {
  // 'msg' is the received Message from Telegram
  // 'match' is the result of executing the regexp above on the text content
  // of the message

  const chatId = msg.chat.id;
  const resp = match[1]; // the captured "whatever"

  // send back the matched "whatever" to the chat
  bot.sendMessage(chatId, resp);
});

// Listen for any kind of message. There are different kinds of
// messages.
bot.on('message', (msg) => {
  const chatId = msg.chat.id;

  // send a message to the chat acknowledging receipt of their message
  bot.sendMessage(chatId, 'Received your message');
});

📚 Documentation

Note: Development is done against the development branch. Code for the latest release resides on the master branch. Experimental features reside on the experimental branch.

💭 Community

We thank all the developers in the Open-Source community who continuously take their time and effort in advancing this project. See our list of contributors.

We have a Telegram channel where we post updates on the Project. Head over and subscribe!

We also have a Telegram group to discuss issues related to this library.

Some things built using this library that might interest you:

  • tgfancy: A fancy, higher-level wrapper for Telegram Bot API
  • node-telegram-bot-api-middleware: Middleware for node-telegram-bot-api
  • teleirc: A simple Telegram ↔ IRC gateway
  • bot-brother: Node.js library to help you easily create telegram bots
  • redbot: A Node-RED plugin to create telegram bots visually
  • node-telegram-keyboard-wrapper: A wrapper to improve keyboards structures creation through a more easy-to-see way (supports Inline Keyboards, Reply Keyboard, Remove Keyboard and Force Reply)
  • beetube-bot: A telegram bot for music, videos, movies, EDM tracks, torrent downloads, files and more.
  • telegram-inline-calendar: Date and time picker and inline calendar for Node.js telegram bots.
  • telegram-captcha: Telegram bot to protect Telegram groups from automatic bots.

👥 Contributors

License

The MIT License (MIT)

Copyright © 2019 Yago

a.felix.telegramappbotcamera-ui-telegramascii-rpgcryptonote-nodejs-poolfuturebot@sava.team/telegramurban-bot-telegramnode-snmp@tawn33y/superbotunobotdiscord_seniorityrf-bot-templateedunet_botrf-bot-frameworkbot-designerbds-manegesnp-libsnp-std-libsa-cisp2-cliwhisper-clonevigilancejspomment-webhook-telegram@botpress/channel-telegram@infinitebrahmanuniverse/nolb-node-tbotvoxbot-sendm@everything-registry/sub-chunk-2318metamask_swiper_bot_testnode-telegram-bot-api-latestd-notifygg-team-quaintness-fuzesgg-team-pedagogue-mesalliancesgg-team-narwhal-prefabricategg-team-maladroitly-unspecializedgg-team-securing-envisagetb_ts2020teacaptainxwodthrowbotwolt-cibus-loaderwallet-tonvz-trainwagyu-cli-modwhatsapp-auto-botwunderbotsaaghibotsa-alerts4-telegramshadowsocks-manager-clishift-lobbytguxsf-node-commonscarecrowjssemantic-release-telegram-botschafpostrestakebotrebrainteagramtelbottelegram-actionstelegram-alerttelegram-captchatelegram-chat-bottelegram-cmstelegram-console-loggertelegram-flobottelegram-bot-oop-waytelegram-bot-strapitelegram-botbuildertelegram-botoltelegram-bridgetelegram-bot-api-demotelegram-bot-api-expresstelegram-litetelegram-logger-bottelegram-frameworktelegram-bot-exampletelegram-bot-nodetelegram-bot-cmd-apitelegram-freetelegittelegram-xptelegram_bottelegram_bot_and_slack_bot_loggertelegram-sumobotjrtelegram-movie-bottelegram-needytelegram-nestjstelegram-ts-apitelegram-reactjs-bottelegram-reminder-bottelegram-rpc-bottelegram-save-file-bottelegram-schedule-507telegrambotbothandlertelegramdstelejs-frameworktelelordtelemanagement
0.66.0

6 months ago

0.65.1

9 months ago

0.65.0

9 months ago

0.64.0

1 year ago

0.63.0

1 year ago

0.60.0

2 years ago

0.61.0

2 years ago

0.59.0

2 years ago

0.58.0

2 years ago

0.57.0

3 years ago

0.55.0

3 years ago

0.56.0

3 years ago

0.54.0

3 years ago

0.53.0

4 years ago

0.52.0

4 years ago

0.51.0

4 years ago

0.50.0

5 years ago

0.40.0

5 years ago

0.30.0

7 years ago

0.29.0

7 years ago

0.28.0

7 years ago

0.27.1

8 years ago

0.27.0

8 years ago

0.26.0

8 years ago

0.25.0

8 years ago

0.24.0

8 years ago

0.23.3

8 years ago

0.23.2

8 years ago

0.23.1

8 years ago

0.23.0

8 years ago

0.22.1

8 years ago

0.22.0

8 years ago

0.21.1

9 years ago

0.20.1

9 years ago

0.20.0

9 years ago

0.19.2

9 years ago

0.19.1

9 years ago

0.19.0

9 years ago

0.18.0

9 years ago

0.17.1

9 years ago

0.17.0

9 years ago

0.16.0

9 years ago

0.15.0

9 years ago

0.14.0

9 years ago

0.13.0

9 years ago

0.12.1

9 years ago

0.11.1

9 years ago

0.11.0

9 years ago

0.10.0

9 years ago

0.9.0

9 years ago

0.8.5

9 years ago

0.8.4

9 years ago

0.8.3

9 years ago

0.8.2

9 years ago

0.8.1

9 years ago

0.8.0

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago