Skip to content

monkey-patches/node-telegram-bot-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ™ˆ node-telegram-bot-api πŸ™‰

monkey patch for https://github.com/yagop/node-telegram-bot-api

Install

npm i monkey-patches-node-telegram-bot-api --save --save-exact 

Usage

var options = {/* ... */}; TelegramBot = require('node-telegram-bot-api'); require('monkey-patches-node-telegram-bot-api')(TelegramBot, options); var token = 'YOUR_TELEGRAM_BOT_TOKEN'; var bot = new TelegramBot(token, {polling: true});

Options

all

with this option you can enable all patch.

options = {all: true}; // setup bot ...  // usage bot.stopPolling(); bot.kickChatMember(chatId, userId); // ...

stopPolling

With this option you can stop polling.

options = {stopPolling: true}; // setup bot ...  // usage bot.stopPolling(); // stop bot.initPolling(); // start bot.initPolling(); // restart

related pull request

emitUpdate

this path cause update-event emitted every time update received

options = {emitUpdate: true}; // setup bot ...  // usage bot.on('update', function(update){/* ... */})

emitCallbackQuery

this path add support for callback_query and cause callback_query-event emitted every time callback query received

options = {emitCallbackQuery: true}; // setup bot ...  // usage bot.on('callback_query', function(callbackQuery){/* ... */})

related pull request

sendVenue

With this option you can send venue.

options = {sendVenue: true}; // setup bot ...  // usage bot.sendVenue(chatID, lat, long, title, address);

related pull request

kickChatMember

This option provide kickChatMember method

options = {kickChatMember: true}; // setup bot ... // usage bot.kickChatMember(chatId, userId);

related pull request

unbanChatMember

This option provide unbanChatMember method

options = {unbanChatMember: true}; // setup bot ... // usage bot.unbanChatMember(chatId, userId);

related pull request

answerCallbackQuery

This option provide answerCallbackQuery method

options = {unbanChatMember: true}; // setup bot ... // usage bot.answerCallbackQuery(callbackQueryId, text, showAlert);

related pull request

editMessageText

This option provide editMessageText method

options = {editMessageText: true}; // setup bot ... // usage bot.editMessageText(text);

related pull request

editMessageCaption

This option provide editMessageCaption method

options = {editMessageCaption: true}; // setup bot ... // usage bot.editMessageCaption(caption);

related pull request

editMessageReplyMarkup

This option provide editMessageReplyMarkup method

options = {editMessageReplyMarkup: true}; // setup bot ... // usage bot.editMessageReplyMarkup(replyMarkup);

related pull request

Compatibility

I test this package with node-telegram-bot-api@0.21.1 and node@v5.3.0

Sem version, backward compatibility and ...

No. this is only 🐡 patch. so every time install this package with --save-exact option.