Skip to content

Commit 00175bb

Browse files
committed
remove merged pull request
1 parent 2b89e8a commit 00175bb

File tree

3 files changed

+9
-231
lines changed

3 files changed

+9
-231
lines changed

README.md

Lines changed: 8 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ options = {all: true};
2626
// setup bot ...
2727
// usage
2828
bot.stopPolling();
29-
bot.kickChatMember(chatId, userId);
3029
// ...
3130
```
3231

@@ -55,16 +54,7 @@ bot.on('update', function(update){/* ... */})
5554

5655

5756
## emitCallbackQuery
58-
this path add support for callback_query and cause `callback_query`-event emitted every time callback query received
59-
```js
60-
options = {emitCallbackQuery: true};
61-
// setup bot ...
62-
// usage
63-
bot.on('callback_query', function(callbackQuery){/* ... */})
64-
```
65-
66-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/118)
67-
57+
Removed: update your node-telegram-bot-api
6858

6959
## sendVenue
7060
With this option you can send venue.
@@ -79,74 +69,26 @@ bot.sendVenue(chatID, lat, long, title, address);
7969

8070

8171
## kickChatMember
82-
This option provide `kickChatMember` method
83-
```js
84-
options = {kickChatMember: true};
85-
// setup bot ...
86-
// usage
87-
bot.kickChatMember(chatId, userId);
88-
```
89-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/102)
90-
72+
Removed: update your node-telegram-bot-api
9173

9274
## unbanChatMember
93-
This option provide `unbanChatMember` method
94-
```js
95-
options = {unbanChatMember: true};
96-
// setup bot ...
97-
// usage
98-
bot.unbanChatMember(chatId, userId);
99-
```
100-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/102)
75+
Removed: update your node-telegram-bot-api
10176

10277
## answerCallbackQuery
103-
This option provide `answerCallbackQuery` method
104-
```js
105-
options = {unbanChatMember: true};
106-
// setup bot ...
107-
// usage
108-
bot.answerCallbackQuery(callbackQueryId, text, showAlert);
109-
```
110-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/102)
111-
78+
Removed: update your node-telegram-bot-api
11279

11380
## editMessageText
114-
This option provide `editMessageText` method
115-
```js
116-
options = {editMessageText: true};
117-
// setup bot ...
118-
// usage
119-
bot.editMessageText(text);
120-
```
121-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/102)
122-
81+
Removed: update your node-telegram-bot-api
12382

12483
## editMessageCaption
125-
This option provide `editMessageCaption` method
126-
```js
127-
options = {editMessageCaption: true};
128-
// setup bot ...
129-
// usage
130-
bot.editMessageCaption(caption);
131-
```
132-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/102)
133-
84+
Removed: update your node-telegram-bot-api
13485

13586
## editMessageReplyMarkup
136-
This option provide `editMessageReplyMarkup` method
137-
```js
138-
options = {editMessageReplyMarkup: true};
139-
// setup bot ...
140-
// usage
141-
bot.editMessageReplyMarkup(replyMarkup);
142-
```
143-
[related pull request](https://github.com/yagop/node-telegram-bot-api/pull/102)
144-
145-
87+
Removed: update your node-telegram-bot-api
14688

14789
# Compatibility
14890

149-
I test this package with `node-telegram-bot-api@0.21.1` and `[email protected]`
91+
I test this package with `node-telegram-bot-api@0.23.3` and `[email protected]`
15092

15193
# Sem version, backward compatibility and ...
15294
No. this is only :monkey_face: patch. so every time install this package with `--save-exact` option.

index.js

Lines changed: 0 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,6 @@ function patchEmitUpdate(TelegramBot) {
1919
}
2020
}
2121

22-
function patchEmitCallbackQuery(TelegramBot) {
23-
var _processUpdate = TelegramBot.prototype._processUpdate;
24-
TelegramBot.prototype._processUpdate = function (update) {
25-
_processUpdate.call(this, update);
26-
var callbackQuery = update.callback_query;
27-
if (callbackQuery) {
28-
debug('Process Update callback_query %j', callbackQuery);
29-
this.emit('callback_query', callbackQuery);
30-
}
31-
32-
}
33-
}
34-
3522
function patchSendVenue(TelegramBot) {
3623
/**
3724
* Send venue.
@@ -57,136 +44,6 @@ function patchSendVenue(TelegramBot) {
5744
}
5845
}
5946

60-
function patchKickChatMember(TelegramBot) {
61-
/**
62-
* Use this method to kick a user from a group or a supergroup.
63-
* In the case of supergroups, the user will not be able to return
64-
* to the group on their own using invite links, etc., unless unbanned
65-
* first. The bot must be an administrator in the group for this to work.
66-
* Returns True on success.
67-
*
68-
* @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup
69-
* @param {String} userId Unique identifier of the target user
70-
* @return {Promise}
71-
* @see https://core.telegram.org/bots/api#kickchatmember
72-
*/
73-
TelegramBot.prototype.kickChatMember = function kickChatMember(chatId, userId) {
74-
const form = {
75-
chat_id: chatId,
76-
user_id: userId
77-
};
78-
return this._request('kickChatMember', {form: form});
79-
}
80-
}
81-
82-
function patchUnbanChatMember(TelegramBot) {
83-
/**
84-
* Use this method to unban a previously kicked user in a supergroup.
85-
* The user will not return to the group automatically, but will be
86-
* able to join via link, etc. The bot must be an administrator in
87-
* the group for this to work. Returns True on success.
88-
*
89-
* @param {Number|String} chatId Unique identifier for the target group or username of the target supergroup
90-
* @param {String} userId Unique identifier of the target user
91-
* @return {Promise}
92-
* @see https://core.telegram.org/bots/api#unbanchatmember
93-
*/
94-
TelegramBot.prototype.unbanChatMember = function unbanChatMember(chatId, userId) {
95-
const form = {
96-
chat_id: chatId,
97-
user_id: userId
98-
};
99-
return this._request('unbanChatMember', {form: form});
100-
}
101-
}
102-
103-
function pathAnswerCallbackQuery(TelegramBot) {
104-
/**
105-
* Use this method to send answers to callback queries sent from
106-
* inline keyboards. The answer will be displayed to the user as
107-
* a notification at the top of the chat screen or as an alert.
108-
* On success, True is returned.
109-
*
110-
* @param {Number|String} callbackQueryId Unique identifier for the query to be answered
111-
* @param {String} text Text of the notification. If not specified, nothing will be shown to the user
112-
* @param {Boolean} showAlert Whether to show an alert or a notification at the top of the screen
113-
* @param {Object} [options] Additional Telegram query options
114-
* @return {Promise}
115-
* @see https://core.telegram.org/bots/api#answercallbackquery
116-
*/
117-
TelegramBot.prototype.answerCallbackQuery = function answerCallbackQuery(callbackQueryId, text, showAlert, form) {
118-
form = form || {};
119-
form.callback_query_id = callbackQueryId;
120-
form.text = text;
121-
form.show_alert = showAlert;
122-
return this._request('answerCallbackQuery', {form: form});
123-
}
124-
}
125-
126-
function patchEditMessageText(TelegramBot) {
127-
/**
128-
* Use this method to edit text messages sent by the bot or via
129-
* the bot (for inline bots). On success, the edited Message is
130-
* returned.
131-
*
132-
* Note that you must provide one of chat_id, message_id, or
133-
* inline_message_id in your request.
134-
*
135-
* @param {String} text New text of the message
136-
* @param {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
137-
* @return {Promise}
138-
* @see https://core.telegram.org/bots/api#editmessagetext
139-
*/
140-
TelegramBot.prototype.editMessageText = function editMessageText(text, form) {
141-
form = form || {};
142-
form.text = text;
143-
return this._request('editMessageText', {form: form});
144-
}
145-
146-
}
147-
148-
149-
function patchEditMessageCaption(TelegramBot) {
150-
/**
151-
* Use this method to edit captions of messages sent by the
152-
* bot or via the bot (for inline bots). On success, the
153-
* edited Message is returned.
154-
*
155-
* Note that you must provide one of chat_id, message_id, or
156-
* inline_message_id in your request.
157-
*
158-
* @param {String} caption New caption of the message
159-
* @param {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
160-
* @return {Promise}
161-
* @see https://core.telegram.org/bots/api#editmessagecaption
162-
*/
163-
TelegramBot.prototype.editMessageCaption = function editMessageCaption(caption, form) {
164-
form = form || {};
165-
form.caption = caption;
166-
return this._request('editMessageCaption', {form: form});
167-
}
168-
}
169-
function patchEditMessageReplyMarkup(TelegramBot) {
170-
/**
171-
* Use this method to edit only the reply markup of messages
172-
* sent by the bot or via the bot (for inline bots).
173-
* On success, the edited Message is returned.
174-
*
175-
* Note that you must provide one of chat_id, message_id, or
176-
* inline_message_id in your request.
177-
*
178-
* @param {Object} replyMarkup A JSON-serialized object for an inline keyboard.
179-
* @param {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here)
180-
* @return {Promise}
181-
* @see https://core.telegram.org/bots/api#editmessagereplymarkup
182-
*/
183-
TelegramBot.prototype.editMessageReplyMarkup = function editMessageReplyMarkup(replyMarkup, form) {
184-
form = form || {};
185-
form.reply_markup = replyMarkup;
186-
return this._request('editMessageReplyMarkup', {form: form});
187-
}
188-
}
189-
19047
module.exports = function (TelegramBot, options) {
19148
options = options || {};
19249
if (options.all || options.stopPolling) {
@@ -195,28 +52,7 @@ module.exports = function (TelegramBot, options) {
19552
if (options.all || options.emitUpdate) {
19653
patchEmitUpdate(TelegramBot);
19754
}
198-
if (options.all || options.emitCallbackQuery) {
199-
patchEmitCallbackQuery(TelegramBot);
200-
}
20155
if (options.all || options.sendVenue) {
20256
patchSendVenue(TelegramBot);
20357
}
204-
if (options.all || options.kickChatMember) {
205-
patchKickChatMember(TelegramBot);
206-
}
207-
if (options.all || options.unbanChatMember) {
208-
patchUnbanChatMember(TelegramBot);
209-
}
210-
if (options.all || options.answerCallbackQuery) {
211-
pathAnswerCallbackQuery(TelegramBot);
212-
}
213-
if (options.all || options.editMessageText) {
214-
patchEditMessageText(TelegramBot);
215-
}
216-
if (options.all || options.editMessageCaption) {
217-
patchEditMessageCaption(TelegramBot);
218-
}
219-
if (options.all || options.editMessageReplyMarkup) {
220-
patchEditMessageReplyMarkup(TelegramBot);
221-
}
22258
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monkey-patches-node-telegram-bot-api",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "monkey patch for https://github.com/yagop/node-telegram-bot-api",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)