node-telegram-utils 0.0.1-security → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of node-telegram-utils might be problematic. Click here for more details.
- package/.github/ISSUE_TEMPLATE.md +68 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- package/CHANGELOG.md +475 -0
- package/CODE_OF_CONDUCT.md +74 -0
- package/CONTRIBUTING.md +45 -0
- package/LICENSE.md +21 -0
- package/README.md +128 -3
- package/doc/api.hbs +19 -0
- package/doc/api.md +0 -0
- package/doc/experimental.md +28 -0
- package/doc/help.md +151 -0
- package/doc/tutorials.md +12 -0
- package/doc/usage.md +269 -0
- package/index.js +13 -0
- package/lib/errors.js +104 -0
- package/lib/telegram.js +1356 -0
- package/lib/telegramPolling.js +237 -0
- package/lib/telegramWebHook.js +187 -0
- package/lib/utils.js +7 -0
- package/package.json +77 -3
- package/src/errors.js +65 -0
- package/src/telegram.js +2998 -0
- package/src/telegramPolling.js +202 -0
- package/src/telegramWebHook.js +158 -0
- package/src/utils.js +3 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
<!--
|
2
|
+
This template includes three sections:
|
3
|
+
1. Bug reporting
|
4
|
+
2. Feature request
|
5
|
+
3. Question
|
6
|
+
|
7
|
+
Please remove sections that do not apply to your issue
|
8
|
+
-->
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
<!--********************************************************************
|
13
|
+
Reporting a Bug.
|
14
|
+
*********************************************************************-->
|
15
|
+
|
16
|
+
> Bug Report
|
17
|
+
|
18
|
+
I have read:
|
19
|
+
|
20
|
+
* [Usage information](https://github.com/yagop/node-telegram-bot-api/tree/master/doc/usage.md)
|
21
|
+
* [Help information](https://github.com/yagop/node-telegram-bot-api/tree/master/doc/help.md)
|
22
|
+
|
23
|
+
I am using the latest version of the library.
|
24
|
+
|
25
|
+
### Expected Behavior
|
26
|
+
|
27
|
+
<!-- Explain what you are trying to achieve -->
|
28
|
+
|
29
|
+
### Actual Behavior
|
30
|
+
|
31
|
+
<!-- Explain what happens, contrary to what you expected -->
|
32
|
+
|
33
|
+
### Steps to reproduce the Behavior
|
34
|
+
|
35
|
+
<!-- Explain how we can reproduce the bug -->
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
<!--********************************************************************
|
40
|
+
Feature Request.
|
41
|
+
*********************************************************************-->
|
42
|
+
|
43
|
+
> Feature Request
|
44
|
+
|
45
|
+
I have:
|
46
|
+
|
47
|
+
* searched for such a feature request (https://github.com/yagop/node-telegram-bot-api/labels/enhancement) and found none
|
48
|
+
|
49
|
+
### Introduction
|
50
|
+
|
51
|
+
<!-- Describe what value this feature would add, and in which use case,
|
52
|
+
or scenario -->
|
53
|
+
|
54
|
+
### Example
|
55
|
+
|
56
|
+
<!-- A code snippet of how this feature would work, were it already
|
57
|
+
implemented -->
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<!--********************************************************************
|
62
|
+
Question.
|
63
|
+
*********************************************************************-->
|
64
|
+
|
65
|
+
> Question
|
66
|
+
|
67
|
+
<!-- Ask your question here. Please be precise, adding as much detail
|
68
|
+
as necessary. Also, add a code snippet(s) if possible. -->
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!--
|
2
|
+
Mark whichever option below applies to this PR.
|
3
|
+
For example, if your PR passes all tests, you would mark the option as so:
|
4
|
+
- [x] All tests pass
|
5
|
+
Note the 'x' in between the square brackets '[]'
|
6
|
+
-->
|
7
|
+
- [ ] All tests pass
|
8
|
+
- [ ] I have run `npm run doc`
|
9
|
+
|
10
|
+
### Description
|
11
|
+
|
12
|
+
<!-- Explain what you are trying to achieve with this PR -->
|
13
|
+
|
14
|
+
### References
|
15
|
+
|
16
|
+
<!--
|
17
|
+
Add references to other documents/pages that are relevant to this
|
18
|
+
PR, such as related issues, documentation, etc.
|
19
|
+
|
20
|
+
For example,
|
21
|
+
* Issue #1: https://github.com/yagop/node-telegram-bot-api/issues/1
|
22
|
+
* Telegram Bot API - Getting updates: https://core.telegram.org/bots/api#getting-updates
|
23
|
+
-->
|
package/CHANGELOG.md
ADDED
@@ -0,0 +1,475 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
|
+
|
6
|
+
## [0.64.0][0.64.0] - 2023-10-25
|
7
|
+
|
8
|
+
1. Replace `request` with a maintained version (@danielperez9430)
|
9
|
+
* Change `request` to `@cypress/request`
|
10
|
+
* Change `request-promise` to `@cypress/request-promise`
|
11
|
+
|
12
|
+
## [0.63.0][0.63.0] - 2023-08-23
|
13
|
+
|
14
|
+
1. Support Telegram Bot API v6.8 (@danielperez9430)
|
15
|
+
* unpinAllGeneralForumTopicMessages
|
16
|
+
|
17
|
+
## [0.62.0][0.62.0] - 2023-03-19
|
18
|
+
|
19
|
+
1. Support Telegram Bot API v6.6 & v6.7 (@danielperez9430)
|
20
|
+
* setMyDescription
|
21
|
+
* getMyDescription
|
22
|
+
* setMyShortDescription
|
23
|
+
* getMyShortDescription
|
24
|
+
* setCustomEmojiStickerSetThumbnail
|
25
|
+
* setStickerSetTitle
|
26
|
+
* deleteStickerSet
|
27
|
+
* setStickerEmojiList
|
28
|
+
* setStickerKeywords
|
29
|
+
* setStickerMaskPosition
|
30
|
+
|
31
|
+
## [0.61.0][0.61.0] - 2022-12-30
|
32
|
+
|
33
|
+
1. Support Telegram Bot API v6.4 (@danielperez9430)
|
34
|
+
* editGeneralForumTopic
|
35
|
+
* closeGeneralForumTopic
|
36
|
+
* reopenGeneralForumTopic
|
37
|
+
* hideGeneralForumTopic
|
38
|
+
* unhideGeneralForumTopic
|
39
|
+
|
40
|
+
2. Minor changes: (@danielperez9430)
|
41
|
+
* The parameters `name` and `icon_custom_emoji_id` of the method `editForumTopic` are now optional.
|
42
|
+
* Fix add thumb in sendAudio, sendVideo and sendVideoNote
|
43
|
+
* Fix getMyCommands and setMyCommands
|
44
|
+
* Suggested tip amounts stringify in sendInvoice
|
45
|
+
## [0.60.0][0.60.0] - 2022-10-06
|
46
|
+
|
47
|
+
1. Support Telegram Bot API v6.3 (@danielperez9430)
|
48
|
+
* createForumTopic
|
49
|
+
* closeForumTopic
|
50
|
+
* reopenForumTopic
|
51
|
+
* deleteForumTopic
|
52
|
+
* unpinAllForumTopicMessages
|
53
|
+
* getForumTopicIconStickers
|
54
|
+
|
55
|
+
2. Fix test getMyDefaultAdministratorRights (@danielperez9430)
|
56
|
+
|
57
|
+
3. Fix parse entities - (@toniop99)
|
58
|
+
|
59
|
+
## [0.59.0][0.59.0] - 2022-08-15
|
60
|
+
|
61
|
+
1. Support Telegram Bot API v6.2 (@danielperez9430)
|
62
|
+
* getCustomEmojiStickers
|
63
|
+
|
64
|
+
2. Support test enviroment (@tinsaeDev & @kamikazechaser)
|
65
|
+
|
66
|
+
3. Remove dependencies: (@danielperez9430)
|
67
|
+
* Remove *bluebird* => Use NodeJS Native Promises
|
68
|
+
* Remove *depd* => Use node native deprecate util for warnings
|
69
|
+
* Remove contributor dev dependency and add list of contributors in the readme
|
70
|
+
|
71
|
+
4. Remove legacy methods: (@danielperez9430)
|
72
|
+
* getChatMembersCount
|
73
|
+
* kickChatMember
|
74
|
+
|
75
|
+
5. Docs: (@danielperez9430)
|
76
|
+
* Update the docs of the methods
|
77
|
+
* Order methods follow the Telegram bot API docs in src/telegram.js
|
78
|
+
* Update README
|
79
|
+
|
80
|
+
6. Fix: (@danielperez9430)
|
81
|
+
* addStickerToSet() -> Allow to send tgs_sticker + webm_sticker
|
82
|
+
* Remove mandatory param “start_parameter” from sendInvoice, because in the docs is a optional param
|
83
|
+
* getStickerSet test fix deprecated response value "contains_masks" change to "sticker_type"
|
84
|
+
* Fix some other tests
|
85
|
+
|
86
|
+
7. New Test: (@danielperez9430)
|
87
|
+
* deleteStickerFromSet
|
88
|
+
* setStickerPositionInSet
|
89
|
+
* getCustomEmojiStickers
|
90
|
+
|
91
|
+
## [0.58.0][0.58.0] - 2022-06-22
|
92
|
+
|
93
|
+
1. Support Bot API v6.1: (@danielperez9430)
|
94
|
+
* Add method *createInvoiceLink()*
|
95
|
+
|
96
|
+
2. Support for setStickerSetThumb (@elihaidv)
|
97
|
+
|
98
|
+
3. Add new test (@danielperez9430)
|
99
|
+
* createInvoiceLink
|
100
|
+
|
101
|
+
4. Test fixes (@danielperez9430)
|
102
|
+
* sendVideoNote
|
103
|
+
* createNewStickerSet
|
104
|
+
* setStickerSetThumb
|
105
|
+
* getChatMenuButton
|
106
|
+
* setWebHook
|
107
|
+
|
108
|
+
5. Bug fixes (@danielperez9430)
|
109
|
+
* answerWebAppQuery
|
110
|
+
* Support for send thumb in sendAudio
|
111
|
+
|
112
|
+
## [0.57.0][0.57.0] - 2022-04-23
|
113
|
+
|
114
|
+
Added:
|
115
|
+
|
116
|
+
1. Support Bot API v6: (@danielperez9430)
|
117
|
+
|
118
|
+
* Add method *setChatMenuButton()*
|
119
|
+
* Add method *getChatMenuButton()*
|
120
|
+
* Add method *setMyDefaultAdministratorRights()*
|
121
|
+
* Add method *getMyDefaultAdministratorRights()*
|
122
|
+
* Add method *answerWebAppQuery()*
|
123
|
+
* Renamed the fields voice_chat_scheduled, voice_chat_started, voice_chat_ended, and voice_chat_participants_invited to video_chat_scheduled, video_chat_started, video_chat_ended, and video_chat_participants_invited
|
124
|
+
|
125
|
+
|
126
|
+
Tests:
|
127
|
+
|
128
|
+
* answerWebAppQuery
|
129
|
+
* setChatMenuButton
|
130
|
+
* getChatMenuButton
|
131
|
+
* setMyDefaultAdministratorRights
|
132
|
+
* getMyDefaultAdministratorRights
|
133
|
+
|
134
|
+
## [0.56.0][0.56.0] - 2021-12-07
|
135
|
+
|
136
|
+
Added:
|
137
|
+
|
138
|
+
1. Support Bot API v5.5: (@danielperez9430)
|
139
|
+
|
140
|
+
* Add method *banChatSenderChat()*
|
141
|
+
* Add method *unbanChatSenderChat()*
|
142
|
+
|
143
|
+
Fixes:
|
144
|
+
|
145
|
+
* Tests for support with new invite link format
|
146
|
+
|
147
|
+
## [0.55.0][0.55.0] - 2021-11-06
|
148
|
+
|
149
|
+
Added:
|
150
|
+
|
151
|
+
1. Support Bot API v5.4: (@danielperez9430)
|
152
|
+
|
153
|
+
* Add method *approveChatJoinRequest()*
|
154
|
+
* Add method *declineChatJoinRequest()*
|
155
|
+
* Add support for new updates:
|
156
|
+
* *chat_join_request*
|
157
|
+
|
158
|
+
Fixes:
|
159
|
+
|
160
|
+
* Method *editMessageMedia*: Now you can send a local file (`"attach://" + filePatch`)
|
161
|
+
|
162
|
+
## [0.54.0][0.54.0] - 2021-06-29
|
163
|
+
|
164
|
+
Added:
|
165
|
+
|
166
|
+
1. Support Bot API v5.3: (@danielperez9430)
|
167
|
+
|
168
|
+
* Add method *deleteMyCommands()*
|
169
|
+
* Add method *banChatMember()*
|
170
|
+
* Add method *getChatMemberCount()*
|
171
|
+
|
172
|
+
New Test:
|
173
|
+
|
174
|
+
* deleteMyCommands
|
175
|
+
* banChatMember
|
176
|
+
* getChatMemberCount
|
177
|
+
|
178
|
+
Deprecated:
|
179
|
+
* Method *kickChatMember()*
|
180
|
+
* Method *getChatMembersCount()*
|
181
|
+
|
182
|
+
## [0.53.0][0.53.0] - 2021-04-26
|
183
|
+
|
184
|
+
Added:
|
185
|
+
|
186
|
+
1. Support Bot API v5.2:(@danielperez9430)
|
187
|
+
|
188
|
+
* Add support for new messageTypes:
|
189
|
+
* *voice_chat_scheduled*
|
190
|
+
|
191
|
+
## [0.52.0][0.52.0] - 2021-03-20
|
192
|
+
|
193
|
+
Added:
|
194
|
+
|
195
|
+
1. Support Bot API v5.1: (by @danielperez9430)
|
196
|
+
|
197
|
+
* Add method *createChatInviteLink()*
|
198
|
+
* Add method *editChatInviteLink()*
|
199
|
+
* Add method *revokeChatInviteLink()*
|
200
|
+
* Add support for new messageTypes:
|
201
|
+
* *voice_chat_started*
|
202
|
+
* *voice_chat_ended*
|
203
|
+
* *voice_chat_participants_invited*
|
204
|
+
* *message_auto_delete_timer_changed*
|
205
|
+
* *chat_invite_link*
|
206
|
+
* *chat_member_updated*
|
207
|
+
* Add support for new updates:
|
208
|
+
* *my_chat_member*
|
209
|
+
* *chat_member*
|
210
|
+
|
211
|
+
New Test: (by @danielperez9430)
|
212
|
+
|
213
|
+
* createChatInviteLink
|
214
|
+
* editChatInviteLink
|
215
|
+
* revokeChatInviteLink
|
216
|
+
|
217
|
+
## [0.51.0][0.51.0] - 2020-11-04
|
218
|
+
|
219
|
+
Added:
|
220
|
+
|
221
|
+
1. Support Bot API v5.0: (by @danielperez9430)
|
222
|
+
|
223
|
+
* Add method *copyMessage()*
|
224
|
+
* Add method *unpinAllChatMessages()*
|
225
|
+
* Add method *close()*
|
226
|
+
* Add method *logOut()*
|
227
|
+
|
228
|
+
Changed: (by @danielperez9430)
|
229
|
+
|
230
|
+
* Remove trailing-spaces
|
231
|
+
* Fix Bugs in Test
|
232
|
+
|
233
|
+
New Test: (by @danielperez9430)
|
234
|
+
|
235
|
+
* copyMessage
|
236
|
+
* unpinAllChatMessages
|
237
|
+
|
238
|
+
## [0.50.0][0.50.0] - 2020-05-2020
|
239
|
+
|
240
|
+
Added:
|
241
|
+
|
242
|
+
1. Support Bot API v4.8: (by @danielperez9430)
|
243
|
+
* Add methods: *sendDice()*
|
244
|
+
2. Support Bot API v4.7: (by @danielperez9430)
|
245
|
+
* Add methods: *getMyCommands()*,*setMyCommands()*
|
246
|
+
3. Support Bot API v4.5: (by @danielperez9430)
|
247
|
+
* Add methods: *setChatAdministratorCustomTitle()*
|
248
|
+
4. Support Bot API v4.4: (by @danielperez9430)
|
249
|
+
* Add methods: *setChatPermissions()*
|
250
|
+
5. Support for poll_answer (by @JieJiSS)
|
251
|
+
6. Add request options in file stream (by @zhangpanyi )
|
252
|
+
|
253
|
+
Changed: (by @danielperez9430)
|
254
|
+
|
255
|
+
* New message type: *dice*
|
256
|
+
* Fix Bugs in tests
|
257
|
+
* Fix regex compare (by @ledamint)
|
258
|
+
* Fix listening for error events when downloading files (by @Kraigo)
|
259
|
+
|
260
|
+
New Test: (by @danielperez9430)
|
261
|
+
|
262
|
+
* sendDice
|
263
|
+
* getMyCommands
|
264
|
+
* setMyCommands
|
265
|
+
* setChatAdministratorCustomTitle
|
266
|
+
* setChatPermissions
|
267
|
+
|
268
|
+
## [0.40.0][0.40.0] - 2019-05-04
|
269
|
+
|
270
|
+
Added:
|
271
|
+
|
272
|
+
1. Support Bot API v4.2: (by @kamikazechaser)
|
273
|
+
* Add methods: *TelegramBot#sendPoll()*, *TelegramBot#stopPoll()*
|
274
|
+
* Support events: *poll*
|
275
|
+
2. Support Bot API v4.0: (by @kamikazechaser)
|
276
|
+
* Add methods: *TelegramBot#editMessageMedia()*, *TelegramBot#sendAnimation()*
|
277
|
+
* Support new message types: *passport_data*, *animation*
|
278
|
+
|
279
|
+
* * *
|
280
|
+
|
281
|
+
## [0.30.0][0.30.0] - 2017-12-21
|
282
|
+
|
283
|
+
Added:
|
284
|
+
|
285
|
+
1. Support Bot API v3.5: (by @GochoMugo)
|
286
|
+
* Allow `provider_data` parameter in *TelegramBot#sendInvoice*
|
287
|
+
* Add method *TelegramBot#sendMediaGroup()*
|
288
|
+
2. Support Bot API v3.4: (by @kamikazechaser)
|
289
|
+
* Add methods *TelegramBot#editMessageLiveLocation*, *TelegramBot#stopMessageLiveLocation* (#439)
|
290
|
+
* Add methods *TelegramBot#setChatStickerSet*, *TelegramBot#deleteChatStickerSet* (#440)
|
291
|
+
3. Add methods:
|
292
|
+
* *TelegramBot#getFileStream* (#442) (by @GochoMugo, requested-by @Xaqron)
|
293
|
+
4. Add options to *TelegramBot#stopPolling()* (by @GochoMugo)
|
294
|
+
5. Add `metadata` argument in `message` event (and friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo)
|
295
|
+
6. Add forward-compatibility i.e. support future additional Telegram options (by @GochoMugo)
|
296
|
+
7. Add support for Node.js v9 (by @GochoMugo)
|
297
|
+
8. Document *TelegramBot.errors*, *TelegramBot.messageTypes* (by @GochoMugo)
|
298
|
+
|
299
|
+
Changed:
|
300
|
+
|
301
|
+
1. Update *TelegramBot#answerCallbackQuery()* signature (by @GochoMugo)
|
302
|
+
2. Improve default error logging of `polling_error` and `webhook_error` (#377)
|
303
|
+
3. Update dependencies
|
304
|
+
|
305
|
+
Deprecated:
|
306
|
+
|
307
|
+
1. Sending files: *(See [usage guide][usage-sending-files])* (by @hufan-akari, @GochoMugo)
|
308
|
+
* Error will **not** be thrown if `Buffer` is used and file-type could **not** be detected.
|
309
|
+
* Filename will **not** be set to `data.${ext}` if `Buffer` is used
|
310
|
+
* Content type will **not** default to `null` or `undefined`
|
311
|
+
|
312
|
+
Fixed:
|
313
|
+
|
314
|
+
1. Fix the offset infinite loop bug (#265, #36) (by @GochoMugo)
|
315
|
+
2. Fix game example (#449, #418) (by @MCSH)
|
316
|
+
|
317
|
+
* * *
|
318
|
+
|
319
|
+
## [0.29.0][0.29.0] - 2017-10-22
|
320
|
+
|
321
|
+
Added:
|
322
|
+
|
323
|
+
1. Add Bot API v3.2 methods:
|
324
|
+
* (#429) *TelegramBot#getStickerSet* (by @CapacitorSet, @LibertyLocked)
|
325
|
+
* (#430) *TelegramBot#uploadStickerFile* (by @CapacitorSet)
|
326
|
+
* *TelegramBot#createNewStickerSet*, *TelegramBot#addStickerToSet*, *TelegramBot#setStickerPositionInSet*, *TelegramBot#deleteStickerFromSet* (by @GochoMugo)
|
327
|
+
2. Supports API v3.3
|
328
|
+
|
329
|
+
Deprecated:
|
330
|
+
|
331
|
+
1. Auto-enabling Promise cancellation (#319) (by @GochoMugo)
|
332
|
+
|
333
|
+
* * *
|
334
|
+
|
335
|
+
## [0.28.0][0.28.0] - 2017-08-06
|
336
|
+
|
337
|
+
Added:
|
338
|
+
|
339
|
+
1. (#361) Support Bot API v3.1 (by @Lord-Protector, @kamikazechaser)
|
340
|
+
2. (#332) Support Bot API v3.0 (by @kamikazechaser, @GochoMugo)
|
341
|
+
3. Add *TelegramBot#removeTextListener()* (by @GochoMugo)
|
342
|
+
4. (#342) Add game example (by @MCSH)
|
343
|
+
5. (#315) List 'bot-brother' project in community section in README (by @saeedhei)
|
344
|
+
|
345
|
+
Changed:
|
346
|
+
|
347
|
+
1. (#367) Update *TelegramBot#answerCallbackQuery()* signature (by @mnb3000)
|
348
|
+
|
349
|
+
Fixed:
|
350
|
+
|
351
|
+
1. (#325) Fix global regexp state reset (by @Sirius-A)
|
352
|
+
2. (#363) Fix download file path on windows (by @kucherenkovova)
|
353
|
+
3. (#346) Fix anchor webhook link in docs (by @Coac)
|
354
|
+
|
355
|
+
* * *
|
356
|
+
|
357
|
+
## [0.27.1][0.27.1] - 2017-04-07
|
358
|
+
|
359
|
+
Added:
|
360
|
+
|
361
|
+
1. (#287) Add Express WebHook example (by @kamikazechaser)
|
362
|
+
|
363
|
+
Fixed:
|
364
|
+
|
365
|
+
1. (#291) Improve docs (by @preco21)
|
366
|
+
2. (#298) Fix running on Node v5 (by @jehy)
|
367
|
+
3. (#307) Fix badge links in README (by @JaakkoLipsanen)
|
368
|
+
4. Fix defaulting value of `options.polling.params.timeout` (by @GochoMugo)
|
369
|
+
5. Fix typos in Github issue template (by @GochoMugo, requested-by @GingerPlusPlus)
|
370
|
+
|
371
|
+
* * *
|
372
|
+
|
373
|
+
## [0.27.0][0.27.0] - 2017-02-10
|
374
|
+
|
375
|
+
Added:
|
376
|
+
|
377
|
+
1. Add constructor options:
|
378
|
+
* (#243) `options.polling.params` (by @GochoMugo, requested-by @sidelux)
|
379
|
+
2. Add methods:
|
380
|
+
* (#74) *TelegramBot#removeReplyListener()* (by @githugger)
|
381
|
+
3. (#283) Add proper error handling (by @GochoMugo)
|
382
|
+
4. (#272) Add health-check endpoint (by @mironov)
|
383
|
+
* `options.webHook.healthEndpoint`
|
384
|
+
5. (#152) Add test for TelegramBot#sendDocument() using 'fileOpts'
|
385
|
+
param (by @evolun)
|
386
|
+
6. Document `options.webHook.host` (by @GochoMugo)
|
387
|
+
7. (#264) Add Bot API version to README (by @kamikazechaser)
|
388
|
+
8. Add examples:
|
389
|
+
- (#271) WebHook on Heroku (by @TheBeastOfCaerbannog)
|
390
|
+
- (#274) WebHook on Zeit Now (by @Ferrari)
|
391
|
+
|
392
|
+
Changed:
|
393
|
+
|
394
|
+
1. (#147) Use *String#indexOf()*, instead of *RegExp#test()*, to
|
395
|
+
find token in webhook request (by @AVVS)
|
396
|
+
|
397
|
+
Fixed:
|
398
|
+
|
399
|
+
* Fix bug:
|
400
|
+
- (#275, #280) fix es6 syntax error on Node.js v4.x (by @crazyabdul)
|
401
|
+
- (#276) promise.warning from `request-promise` (by @GochoMugo,
|
402
|
+
reported-by @preco21)
|
403
|
+
- (#281) fix handling error during polling (by @GochoMugo,
|
404
|
+
reported-by @dimawebmaker)
|
405
|
+
- (#284) fix error during deletion of already-set webhook, during
|
406
|
+
polling (by @GochoMugo, reported-by @dcparga)
|
407
|
+
1. Fix links in documentation (by @Ni2c2k)
|
408
|
+
|
409
|
+
* * *
|
410
|
+
|
411
|
+
## [0.26.0][0.26.0] - 2017-01-20
|
412
|
+
|
413
|
+
Added:
|
414
|
+
|
415
|
+
1. Add *TelegramBot* constructor options:
|
416
|
+
* `options.https`
|
417
|
+
* `options.baseApiUrl`
|
418
|
+
* `options.filepath`
|
419
|
+
2. Add methods:
|
420
|
+
* *TelegramBot#stopPolling()*
|
421
|
+
* *TelegramBot#isPolling()*
|
422
|
+
* *TelegramBot#openWebHook()*
|
423
|
+
* *TelegramBot#closeWebHook()*
|
424
|
+
* *TelegramBot#hasOpenWebHook()*
|
425
|
+
* *TelegramBot#deleteWebHook()*
|
426
|
+
* *TelegramBot#getWebHookInfo()*
|
427
|
+
|
428
|
+
Changed:
|
429
|
+
|
430
|
+
1. Use POST requests by default
|
431
|
+
2. Ensure all relevant methods return Promises
|
432
|
+
3. Document auto-deletion of webhook during polling
|
433
|
+
4. Deprecate support for Node.js v0.12
|
434
|
+
5. Fix consistency of methods signatures
|
435
|
+
6. Rename *TelegramBot#initPolling()* to *TelegramBot#startPolling()*
|
436
|
+
* Deprecate *TelegramBot#initPolling()*
|
437
|
+
|
438
|
+
Fixed:
|
439
|
+
|
440
|
+
1. Handle error during formatting `formData`
|
441
|
+
2. Fix ES6 syntax
|
442
|
+
|
443
|
+
*Credits/Blames: Unless explicitly stated otherwise, above work was
|
444
|
+
done by @GochoMugo*
|
445
|
+
|
446
|
+
* * *
|
447
|
+
|
448
|
+
## [0.25.0][0.25.0] - 2016-12-21
|
449
|
+
|
450
|
+
Added:
|
451
|
+
|
452
|
+
1. Supports the API v2.3 updates (by @kamikazechaser)
|
453
|
+
2. Add *TelegramBot* constructor option:
|
454
|
+
* `options.request`: proxy extra request options (by @tarmolov)
|
455
|
+
* `options.onlyFirstMatch` (by @GingerPlusPlus)
|
456
|
+
3. Add methods:
|
457
|
+
* *TelegramBot#sendVenue()* (by Tketa)
|
458
|
+
* *TelegramBot#sendContact()* (by @GochoMugo)
|
459
|
+
* *TelegramBot#getGameHighScores()* (by @jishnu7)
|
460
|
+
|
461
|
+
Fixed:
|
462
|
+
|
463
|
+
1. Fix request performance issue (by @preco21)
|
464
|
+
2. Fix typos (by oflisback)
|
465
|
+
|
466
|
+
[usage-sending-files]:https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files-options
|
467
|
+
|
468
|
+
[0.25.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.25.0
|
469
|
+
[0.26.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.26.0
|
470
|
+
[0.27.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.27.0
|
471
|
+
[0.27.1]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.27.1
|
472
|
+
[0.28.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.28.0
|
473
|
+
[0.29.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.29.0
|
474
|
+
[0.30.0]:https://github.com/yagop/node-telegram-bot-api/releases/tag/v0.30.0
|
475
|
+
[Unreleased]:https://github.com/yagop/node-telegram-bot-api/compare/v0.30.0...master
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at mugo@forfuture.co.ke. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
package/CONTRIBUTING.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
> If you are willing to contribute, first you should know that
|
4
|
+
> I will love you and so will the Telegram Bot community.
|
5
|
+
|
6
|
+
Before proceeding any further, read the following documents:
|
7
|
+
|
8
|
+
1. [Code of Conduct][coc]
|
9
|
+
1. [License][license]
|
10
|
+
|
11
|
+
## General Information
|
12
|
+
|
13
|
+
### Creating a Github issue:
|
14
|
+
|
15
|
+
1. Ensure that your issue does **not** already exist. [Do a search](https://github.com/yagop/node-telegram-bot-api/issues).
|
16
|
+
2. Browse through [StackOverflow](https://stackoverflow.com/search?q=telegram+nodejs) and other similar platforms.
|
17
|
+
3. Should you open your issue, ensure you use the English language for
|
18
|
+
the wider target audience.
|
19
|
+
4. Be patient please.
|
20
|
+
|
21
|
+
|
22
|
+
### Updating API Reference i.e. generating `doc/api.md`
|
23
|
+
|
24
|
+
Run:
|
25
|
+
|
26
|
+
```bash
|
27
|
+
$ npm run doc
|
28
|
+
```
|
29
|
+
|
30
|
+
|
31
|
+
### Running tests
|
32
|
+
|
33
|
+
Please read `test/README.md` for more information.
|
34
|
+
|
35
|
+
|
36
|
+
### Transpiling ES2015 for older Node.js versions
|
37
|
+
|
38
|
+
We use babel to transpile the code:
|
39
|
+
|
40
|
+
```bash
|
41
|
+
$ npm run build
|
42
|
+
```
|
43
|
+
|
44
|
+
[coc]:https://github.com/yagop/node-telegram-bot-api/blob/master/CODE_OF_CONDUCT.md
|
45
|
+
[license]:https://github.com/yagop/node-telegram-bot-api/blob/master/LICENSE.md
|
package/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Yago
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|