abeya-tg-api 0.0.1-security → 1.0.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 abeya-tg-api 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 +565 -0
- package/CODE_OF_CONDUCT.md +74 -0
- package/CONTRIBUTING.md +45 -0
- package/FORK_GUIDE.md +223 -0
- package/LICENSE.md +21 -0
- package/PUBLISHING_CHECKLIST.md +167 -0
- package/QUICK_START.md +96 -0
- package/README.md +129 -3
- package/README_FORK_SETUP.md +156 -0
- package/START_HERE.md +231 -0
- package/bot.js +36 -0
- package/doc/api.hbs +19 -0
- package/doc/api.md +2772 -12
- 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 +112 -0
- package/lib/extract.js +219 -0
- package/lib/telegram.js +4741 -0
- package/lib/telegramPolling.js +245 -0
- package/lib/telegramWebHook.js +192 -0
- package/lib/utils.js +7 -0
- package/package.json +75 -4
- package/publish-helper.ps1 +179 -0
- package/src/errors.js +68 -0
- package/src/extract.js +212 -0
- package/src/telegram.js +3838 -0
- package/src/telegramPolling.js +202 -0
- package/src/telegramWebHook.js +158 -0
- package/src/utils.js +3 -0
- package/test-bot-example.js +71 -0
package/doc/api.md
ADDED
|
@@ -0,0 +1,2772 @@
|
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
**Note:** If you are looking for available [events](usage.md#events) or usage of api, please refer [`usage.md`](usage.md).
|
|
4
|
+
|
|
5
|
+
<a name="TelegramBot"></a>
|
|
6
|
+
|
|
7
|
+
## TelegramBot
|
|
8
|
+
TelegramBot
|
|
9
|
+
|
|
10
|
+
**Kind**: global class
|
|
11
|
+
**See**: https://core.telegram.org/bots/api
|
|
12
|
+
|
|
13
|
+
* [TelegramBot](#TelegramBot)
|
|
14
|
+
* [new TelegramBot(token, [options])](#new_TelegramBot_new)
|
|
15
|
+
* _instance_
|
|
16
|
+
* [.on(event, listener)](#TelegramBot+on)
|
|
17
|
+
* [.startPolling([options])](#TelegramBot+startPolling) ⇒ <code>Promise</code>
|
|
18
|
+
* ~~[.initPolling([options])](#TelegramBot+initPolling) ⇒ <code>Promise</code>~~
|
|
19
|
+
* [.stopPolling([options])](#TelegramBot+stopPolling) ⇒ <code>Promise</code>
|
|
20
|
+
* [.getFileLink(fileId, [options])](#TelegramBot+getFileLink) ⇒ <code>Promise</code>
|
|
21
|
+
* [.getFileStream(fileId, [options])](#TelegramBot+getFileStream) ⇒ <code>stream.Readable</code>
|
|
22
|
+
* [.downloadFile(fileId, downloadDir, [options])](#TelegramBot+downloadFile) ⇒ <code>Promise</code>
|
|
23
|
+
* [.onText(regexpRexecuted, callback)](#TelegramBot+onText)
|
|
24
|
+
* [.removeTextListener(regexp)](#TelegramBot+removeTextListener) ⇒ <code>Object</code>
|
|
25
|
+
* [.clearTextListeners()](#TelegramBot+clearTextListeners)
|
|
26
|
+
* [.onReplyToMessage(chatId, messageId, callback)](#TelegramBot+onReplyToMessage) ⇒ <code>Number</code>
|
|
27
|
+
* [.removeReplyListener(replyListenerId)](#TelegramBot+removeReplyListener) ⇒ <code>Object</code>
|
|
28
|
+
* [.clearReplyListeners()](#TelegramBot+clearReplyListeners) ⇒ <code>Array</code>
|
|
29
|
+
* [.isPolling()](#TelegramBot+isPolling) ⇒ <code>Boolean</code>
|
|
30
|
+
* [.openWebHook()](#TelegramBot+openWebHook) ⇒ <code>Promise</code>
|
|
31
|
+
* [.closeWebHook()](#TelegramBot+closeWebHook) ⇒ <code>Promise</code>
|
|
32
|
+
* [.hasOpenWebHook()](#TelegramBot+hasOpenWebHook) ⇒ <code>Boolean</code>
|
|
33
|
+
* [.processUpdate(update)](#TelegramBot+processUpdate)
|
|
34
|
+
* [.getUpdates([options])](#TelegramBot+getUpdates) ⇒ <code>Promise</code>
|
|
35
|
+
* [.setWebHook(url, [options], [fileOptions])](#TelegramBot+setWebHook) ⇒ <code>Promise</code>
|
|
36
|
+
* [.deleteWebHook([options])](#TelegramBot+deleteWebHook) ⇒ <code>Promise</code>
|
|
37
|
+
* [.getWebHookInfo([options])](#TelegramBot+getWebHookInfo) ⇒ <code>Promise</code>
|
|
38
|
+
* [.getMe([options])](#TelegramBot+getMe) ⇒ <code>Promise</code>
|
|
39
|
+
* [.logOut([options])](#TelegramBot+logOut) ⇒ <code>Promise</code>
|
|
40
|
+
* [.close([options])](#TelegramBot+close) ⇒ <code>Promise</code>
|
|
41
|
+
* [.sendMessage(chatId, text, [options])](#TelegramBot+sendMessage) ⇒ <code>Promise</code>
|
|
42
|
+
* [.forwardMessage(chatId, fromChatId, messageId, [options])](#TelegramBot+forwardMessage) ⇒ <code>Promise</code>
|
|
43
|
+
* [.forwardMessages(chatId, fromChatId, messageIds, [options])](#TelegramBot+forwardMessages) ⇒ <code>Promise</code>
|
|
44
|
+
* [.copyMessage(chatId, fromChatId, messageId, [options])](#TelegramBot+copyMessage) ⇒ <code>Promise</code>
|
|
45
|
+
* [.copyMessages(chatId, fromChatId, messageIds, [options])](#TelegramBot+copyMessages) ⇒ <code>Promise</code>
|
|
46
|
+
* [.sendPhoto(chatId, photo, [options], [fileOptions])](#TelegramBot+sendPhoto) ⇒ <code>Promise</code>
|
|
47
|
+
* [.sendAudio(chatId, audio, [options], [fileOptions])](#TelegramBot+sendAudio) ⇒ <code>Promise</code>
|
|
48
|
+
* [.sendDocument(chatId, doc, [options], [fileOptions])](#TelegramBot+sendDocument) ⇒ <code>Promise</code>
|
|
49
|
+
* [.sendVideo(chatId, video, [options], [fileOptions])](#TelegramBot+sendVideo) ⇒ <code>Promise</code>
|
|
50
|
+
* [.sendAnimation(chatId, animation, [options], [fileOptions])](#TelegramBot+sendAnimation) ⇒ <code>Promise</code>
|
|
51
|
+
* [.sendVoice(chatId, voice, [options], [fileOptions])](#TelegramBot+sendVoice) ⇒ <code>Promise</code>
|
|
52
|
+
* [.sendVideoNote(chatId, videoNote, [options], [fileOptions])](#TelegramBot+sendVideoNote) ⇒ <code>Promise</code>
|
|
53
|
+
* [.sendPaidMedia(chatId, starCount, media, [options])](#TelegramBot+sendPaidMedia) ⇒ <code>Promise</code>
|
|
54
|
+
* [.sendMediaGroup(chatId, media, [options])](#TelegramBot+sendMediaGroup) ⇒ <code>Promise</code>
|
|
55
|
+
* [.sendLocation(chatId, latitude, longitude, [options])](#TelegramBot+sendLocation) ⇒ <code>Promise</code>
|
|
56
|
+
* [.editMessageLiveLocation(latitude, longitude, [options])](#TelegramBot+editMessageLiveLocation) ⇒ <code>Promise</code>
|
|
57
|
+
* [.stopMessageLiveLocation([options])](#TelegramBot+stopMessageLiveLocation) ⇒ <code>Promise</code>
|
|
58
|
+
* [.sendVenue(chatId, latitude, longitude, title, address, [options])](#TelegramBot+sendVenue) ⇒ <code>Promise</code>
|
|
59
|
+
* [.sendContact(chatId, phoneNumber, firstName, [options])](#TelegramBot+sendContact) ⇒ <code>Promise</code>
|
|
60
|
+
* [.sendPoll(chatId, question, pollOptions, [options])](#TelegramBot+sendPoll) ⇒ <code>Promise</code>
|
|
61
|
+
* [.sendChecklist(businessConnectionId, chatId, checklist, [options])](#TelegramBot+sendChecklist) ⇒ <code>Promise</code>
|
|
62
|
+
* [.sendDice(chatId, [options])](#TelegramBot+sendDice) ⇒ <code>Promise</code>
|
|
63
|
+
* [.sendChatAction(chatId, action, [options])](#TelegramBot+sendChatAction) ⇒ <code>Promise</code>
|
|
64
|
+
* [.setMessageReaction(chatId, messageId, [options])](#TelegramBot+setMessageReaction) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
|
65
|
+
* [.getUserProfilePhotos(userId, [options])](#TelegramBot+getUserProfilePhotos) ⇒ <code>Promise</code>
|
|
66
|
+
* [.setUserEmojiStatus(userId, [options])](#TelegramBot+setUserEmojiStatus) ⇒ <code>Promise</code>
|
|
67
|
+
* [.getFile(fileId, [options])](#TelegramBot+getFile) ⇒ <code>Promise</code>
|
|
68
|
+
* [.banChatMember(chatId, userId, [options])](#TelegramBot+banChatMember) ⇒ <code>Promise</code>
|
|
69
|
+
* [.unbanChatMember(chatId, userId, [options])](#TelegramBot+unbanChatMember) ⇒ <code>Promise</code>
|
|
70
|
+
* [.restrictChatMember(chatId, userId, [options])](#TelegramBot+restrictChatMember) ⇒ <code>Promise</code>
|
|
71
|
+
* [.promoteChatMember(chatId, userId, [options])](#TelegramBot+promoteChatMember) ⇒ <code>Promise</code>
|
|
72
|
+
* [.setChatAdministratorCustomTitle(chatId, userId, customTitle, [options])](#TelegramBot+setChatAdministratorCustomTitle) ⇒ <code>Promise</code>
|
|
73
|
+
* [.banChatSenderChat(chatId, senderChatId, [options])](#TelegramBot+banChatSenderChat) ⇒ <code>Promise</code>
|
|
74
|
+
* [.unbanChatSenderChat(chatId, senderChatId, [options])](#TelegramBot+unbanChatSenderChat) ⇒ <code>Promise</code>
|
|
75
|
+
* [.setChatPermissions(chatId, chatPermissions, [options])](#TelegramBot+setChatPermissions) ⇒ <code>Promise</code>
|
|
76
|
+
* [.exportChatInviteLink(chatId, [options])](#TelegramBot+exportChatInviteLink) ⇒ <code>Promise</code>
|
|
77
|
+
* [.createChatInviteLink(chatId, [options])](#TelegramBot+createChatInviteLink) ⇒ <code>Object</code>
|
|
78
|
+
* [.editChatInviteLink(chatId, inviteLink, [options])](#TelegramBot+editChatInviteLink) ⇒ <code>Promise</code>
|
|
79
|
+
* [.createChatSubscriptionInviteLink(chatId, subscriptionPeriod, subscriptionPrice, [options])](#TelegramBot+createChatSubscriptionInviteLink) ⇒ <code>Promise</code>
|
|
80
|
+
* [.editChatSubscriptionInviteLink(chatId, inviteLink, [options])](#TelegramBot+editChatSubscriptionInviteLink) ⇒ <code>Promise</code>
|
|
81
|
+
* [.revokeChatInviteLink(chatId, inviteLink, [options])](#TelegramBot+revokeChatInviteLink) ⇒ <code>Promise</code>
|
|
82
|
+
* [.approveChatJoinRequest(chatId, userId, [options])](#TelegramBot+approveChatJoinRequest) ⇒ <code>Promise</code>
|
|
83
|
+
* [.declineChatJoinRequest(chatId, userId, [options])](#TelegramBot+declineChatJoinRequest) ⇒ <code>Promise</code>
|
|
84
|
+
* [.setChatPhoto(chatId, photo, [options], [fileOptions])](#TelegramBot+setChatPhoto) ⇒ <code>Promise</code>
|
|
85
|
+
* [.deleteChatPhoto(chatId, [options])](#TelegramBot+deleteChatPhoto) ⇒ <code>Promise</code>
|
|
86
|
+
* [.setChatTitle(chatId, title, [options])](#TelegramBot+setChatTitle) ⇒ <code>Promise</code>
|
|
87
|
+
* [.setChatDescription(chatId, description, [options])](#TelegramBot+setChatDescription) ⇒ <code>Promise</code>
|
|
88
|
+
* [.pinChatMessage(chatId, messageId, [options])](#TelegramBot+pinChatMessage) ⇒ <code>Promise</code>
|
|
89
|
+
* [.unpinChatMessage(chatId, [options])](#TelegramBot+unpinChatMessage) ⇒ <code>Promise</code>
|
|
90
|
+
* [.unpinAllChatMessages(chatId, [options])](#TelegramBot+unpinAllChatMessages) ⇒ <code>Promise</code>
|
|
91
|
+
* [.leaveChat(chatId, [options])](#TelegramBot+leaveChat) ⇒ <code>Promise</code>
|
|
92
|
+
* [.getChat(chatId, [options])](#TelegramBot+getChat) ⇒ <code>Promise</code>
|
|
93
|
+
* [.getChatAdministrators(chatId, [options])](#TelegramBot+getChatAdministrators) ⇒ <code>Promise</code>
|
|
94
|
+
* [.getChatMemberCount(chatId, [options])](#TelegramBot+getChatMemberCount) ⇒ <code>Promise</code>
|
|
95
|
+
* [.getChatMember(chatId, userId, [options])](#TelegramBot+getChatMember) ⇒ <code>Promise</code>
|
|
96
|
+
* [.setChatStickerSet(chatId, stickerSetName, [options])](#TelegramBot+setChatStickerSet) ⇒ <code>Promise</code>
|
|
97
|
+
* [.deleteChatStickerSet(chatId, [options])](#TelegramBot+deleteChatStickerSet) ⇒ <code>Promise</code>
|
|
98
|
+
* [.getForumTopicIconStickers(chatId, [options])](#TelegramBot+getForumTopicIconStickers) ⇒ <code>Promise</code>
|
|
99
|
+
* [.createForumTopic(chatId, name, [options])](#TelegramBot+createForumTopic)
|
|
100
|
+
* [.editForumTopic(chatId, messageThreadId, [options])](#TelegramBot+editForumTopic) ⇒ <code>Promise</code>
|
|
101
|
+
* [.closeForumTopic(chatId, messageThreadId, [options])](#TelegramBot+closeForumTopic) ⇒ <code>Promise</code>
|
|
102
|
+
* [.reopenForumTopic(chatId, messageThreadId, [options])](#TelegramBot+reopenForumTopic) ⇒ <code>Promise</code>
|
|
103
|
+
* [.deleteForumTopic(chatId, messageThreadId, [options])](#TelegramBot+deleteForumTopic) ⇒ <code>Promise</code>
|
|
104
|
+
* [.unpinAllForumTopicMessages(chatId, messageThreadId, [options])](#TelegramBot+unpinAllForumTopicMessages) ⇒ <code>Promise</code>
|
|
105
|
+
* [.editGeneralForumTopic(chatId, name, [options])](#TelegramBot+editGeneralForumTopic) ⇒ <code>Promise</code>
|
|
106
|
+
* [.closeGeneralForumTopic(chatId, [options])](#TelegramBot+closeGeneralForumTopic) ⇒ <code>Promise</code>
|
|
107
|
+
* [.reopenGeneralForumTopic(chatId, [options])](#TelegramBot+reopenGeneralForumTopic) ⇒ <code>Promise</code>
|
|
108
|
+
* [.hideGeneralForumTopic(chatId, [options])](#TelegramBot+hideGeneralForumTopic) ⇒ <code>Promise</code>
|
|
109
|
+
* [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ <code>Promise</code>
|
|
110
|
+
* [.unpinAllGeneralForumTopicMessages(chatId, [options])](#TelegramBot+unpinAllGeneralForumTopicMessages) ⇒ <code>Promise</code>
|
|
111
|
+
* [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ <code>Promise</code>
|
|
112
|
+
* [.savePreparedInlineMessage(userId, result, [options])](#TelegramBot+savePreparedInlineMessage) ⇒ <code>Promise</code>
|
|
113
|
+
* [.getUserChatBoosts(chatId, userId, [options])](#TelegramBot+getUserChatBoosts) ⇒ <code>Promise</code>
|
|
114
|
+
* [.getBusinessConnection(businessConnectionId, [options])](#TelegramBot+getBusinessConnection) ⇒ <code>Promise</code>
|
|
115
|
+
* [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ <code>Promise</code>
|
|
116
|
+
* [.deleteMyCommands([options])](#TelegramBot+deleteMyCommands) ⇒ <code>Promise</code>
|
|
117
|
+
* [.getMyCommands([options])](#TelegramBot+getMyCommands) ⇒ <code>Promise</code>
|
|
118
|
+
* [.setMyName([options])](#TelegramBot+setMyName) ⇒ <code>Promise</code>
|
|
119
|
+
* [.getMyName([options])](#TelegramBot+getMyName) ⇒ <code>Promise</code>
|
|
120
|
+
* [.setMyDescription([options])](#TelegramBot+setMyDescription) ⇒ <code>Promise</code>
|
|
121
|
+
* [.getMyDescription([options])](#TelegramBot+getMyDescription) ⇒ <code>Promise</code>
|
|
122
|
+
* [.setMyShortDescription([options])](#TelegramBot+setMyShortDescription) ⇒ <code>Promise</code>
|
|
123
|
+
* [.getMyShortDescription([options])](#TelegramBot+getMyShortDescription) ⇒ <code>Promise</code>
|
|
124
|
+
* [.setChatMenuButton([options])](#TelegramBot+setChatMenuButton) ⇒ <code>Promise</code>
|
|
125
|
+
* [.getChatMenuButton([options])](#TelegramBot+getChatMenuButton) ⇒ <code>Promise</code>
|
|
126
|
+
* [.setMyDefaultAdministratorRights([options])](#TelegramBot+setMyDefaultAdministratorRights) ⇒ <code>Promise</code>
|
|
127
|
+
* [.getMyDefaultAdministratorRights([options])](#TelegramBot+getMyDefaultAdministratorRights) ⇒ <code>Promise</code>
|
|
128
|
+
* [.editMessageText(text, [options])](#TelegramBot+editMessageText) ⇒ <code>Promise</code>
|
|
129
|
+
* [.editMessageCaption(caption, [options])](#TelegramBot+editMessageCaption) ⇒ <code>Promise</code>
|
|
130
|
+
* [.editMessageMedia(media, [options])](#TelegramBot+editMessageMedia) ⇒ <code>Promise</code>
|
|
131
|
+
* [.editMessageChecklist(businessConnectionId, chatId, messageId, checklist, [options])](#TelegramBot+editMessageChecklist) ⇒ <code>Promise</code>
|
|
132
|
+
* [.editMessageReplyMarkup(replyMarkup, [options])](#TelegramBot+editMessageReplyMarkup) ⇒ <code>Promise</code>
|
|
133
|
+
* [.stopPoll(chatId, pollId, [options])](#TelegramBot+stopPoll) ⇒ <code>Promise</code>
|
|
134
|
+
* [.sendSticker(chatId, sticker, [options], [fileOptions])](#TelegramBot+sendSticker) ⇒ <code>Promise</code>
|
|
135
|
+
* [.getStickerSet(name, [options])](#TelegramBot+getStickerSet) ⇒ <code>Promise</code>
|
|
136
|
+
* [.getCustomEmojiStickers(custom_emoji_ids, [options])](#TelegramBot+getCustomEmojiStickers) ⇒ <code>Promise</code>
|
|
137
|
+
* [.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions])](#TelegramBot+uploadStickerFile) ⇒ <code>Promise</code>
|
|
138
|
+
* [.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions])](#TelegramBot+createNewStickerSet) ⇒ <code>Promise</code>
|
|
139
|
+
* [.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions])](#TelegramBot+addStickerToSet) ⇒ <code>Promise</code>
|
|
140
|
+
* [.setStickerPositionInSet(sticker, position, [options])](#TelegramBot+setStickerPositionInSet) ⇒ <code>Promise</code>
|
|
141
|
+
* [.deleteStickerFromSet(sticker, [options])](#TelegramBot+deleteStickerFromSet) ⇒ <code>Promise</code>
|
|
142
|
+
* [.replaceStickerInSet(user_id, name, sticker, [options])](#TelegramBot+replaceStickerInSet) ⇒ <code>Promise</code>
|
|
143
|
+
* [.setStickerEmojiList(sticker, emojiList, [options])](#TelegramBot+setStickerEmojiList) ⇒ <code>Promise</code>
|
|
144
|
+
* [.setStickerKeywords(sticker, [options])](#TelegramBot+setStickerKeywords) ⇒ <code>Promise</code>
|
|
145
|
+
* [.setStickerMaskPosition(sticker, [options])](#TelegramBot+setStickerMaskPosition) ⇒ <code>Promise</code>
|
|
146
|
+
* [.setStickerSetTitle(name, title, [options])](#TelegramBot+setStickerSetTitle) ⇒ <code>Promise</code>
|
|
147
|
+
* [.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions])](#TelegramBot+setStickerSetThumbnail) ⇒ <code>Promise</code>
|
|
148
|
+
* [.setCustomEmojiStickerSetThumbnail(name, [options])](#TelegramBot+setCustomEmojiStickerSetThumbnail) ⇒ <code>Promise</code>
|
|
149
|
+
* [.deleteStickerSet(name, [options])](#TelegramBot+deleteStickerSet) ⇒ <code>Promise</code>
|
|
150
|
+
* [.answerInlineQuery(inlineQueryId, results, [options])](#TelegramBot+answerInlineQuery) ⇒ <code>Promise</code>
|
|
151
|
+
* [.answerWebAppQuery(webAppQueryId, result, [options])](#TelegramBot+answerWebAppQuery) ⇒ <code>Promise</code>
|
|
152
|
+
* [.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+sendInvoice) ⇒ <code>Promise</code>
|
|
153
|
+
* [.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+createInvoiceLink) ⇒ <code>Promise</code>
|
|
154
|
+
* [.answerShippingQuery(shippingQueryId, ok, [options])](#TelegramBot+answerShippingQuery) ⇒ <code>Promise</code>
|
|
155
|
+
* [.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options])](#TelegramBot+answerPreCheckoutQuery) ⇒ <code>Promise</code>
|
|
156
|
+
* [.getMyStarBalance([options])](#TelegramBot+getMyStarBalance) ⇒ <code>Promise</code>
|
|
157
|
+
* [.getStarTransactions([options])](#TelegramBot+getStarTransactions) ⇒ <code>Promise</code>
|
|
158
|
+
* [.refundStarPayment(userId, telegramPaymentChargeId, [options])](#TelegramBot+refundStarPayment) ⇒ <code>Promise</code>
|
|
159
|
+
* [.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options])](#TelegramBot+editUserStarSubscription) ⇒ <code>Promise</code>
|
|
160
|
+
* [.sendGame(chatId, gameShortName, [options])](#TelegramBot+sendGame) ⇒ <code>Promise</code>
|
|
161
|
+
* [.setGameScore(userId, score, [options])](#TelegramBot+setGameScore) ⇒ <code>Promise</code>
|
|
162
|
+
* [.getGameHighScores(userId, [options])](#TelegramBot+getGameHighScores) ⇒ <code>Promise</code>
|
|
163
|
+
* [.deleteMessage(chatId, messageId, [options])](#TelegramBot+deleteMessage) ⇒ <code>Promise</code>
|
|
164
|
+
* [.deleteMessages(chatId, messageIds, [options])](#TelegramBot+deleteMessages) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
|
165
|
+
* [.getAvailableGifts([options])](#TelegramBot+getAvailableGifts) ⇒ <code>Promise</code>
|
|
166
|
+
* [.sendGift(giftId, [options])](#TelegramBot+sendGift) ⇒ <code>Promise</code>
|
|
167
|
+
* [.giftPremiumSubscription(userId, monthCount, starCount, [options])](#TelegramBot+giftPremiumSubscription) ⇒ <code>Promise</code>
|
|
168
|
+
* [.verifyUser(userId, [options])](#TelegramBot+verifyUser) ⇒ <code>Promise</code>
|
|
169
|
+
* [.verifyChat(chatId, [options])](#TelegramBot+verifyChat) ⇒ <code>Promise</code>
|
|
170
|
+
* [.removeUserVerification(userId, [options])](#TelegramBot+removeUserVerification) ⇒ <code>Promise</code>
|
|
171
|
+
* [.removeChatVerification(chatId, [options])](#TelegramBot+removeChatVerification) ⇒ <code>Promise</code>
|
|
172
|
+
* [.readBusinessMessage(businessConnectionId, chatId, messageId, [options])](#TelegramBot+readBusinessMessage) ⇒ <code>Promise</code>
|
|
173
|
+
* [.deleteBusinessMessages(businessConnectionId, messageIds, [options])](#TelegramBot+deleteBusinessMessages) ⇒ <code>Promise</code>
|
|
174
|
+
* [.setBusinessAccountName(businessConnectionId, firstName, [options])](#TelegramBot+setBusinessAccountName) ⇒ <code>Promise</code>
|
|
175
|
+
* [.setBusinessAccountUsername(businessConnectionId, [options])](#TelegramBot+setBusinessAccountUsername) ⇒ <code>Promise</code>
|
|
176
|
+
* [.setBusinessAccountBio(businessConnectionId, [options])](#TelegramBot+setBusinessAccountBio) ⇒ <code>Promise</code>
|
|
177
|
+
* [.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options])](#TelegramBot+setBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
|
|
178
|
+
* [.removeBusinessAccountProfilePhoto(businessConnectionId, [options])](#TelegramBot+removeBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
|
|
179
|
+
* [.setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, acceptedGiftTypes, [options])](#TelegramBot+setBusinessAccountGiftSettings) ⇒ <code>Promise</code>
|
|
180
|
+
* [.getBusinessAccountStarBalance(businessConnectionId, [options])](#TelegramBot+getBusinessAccountStarBalance) ⇒ <code>Promise</code>
|
|
181
|
+
* [.transferBusinessAccountStars(businessConnectionId, starCount, [options])](#TelegramBot+transferBusinessAccountStars) ⇒ <code>Promise</code>
|
|
182
|
+
* [.getBusinessAccountGifts(businessConnectionId, [options])](#TelegramBot+getBusinessAccountGifts) ⇒ <code>Promise</code>
|
|
183
|
+
* [.convertGiftToStars(businessConnectionId, ownedGiftId, [options])](#TelegramBot+convertGiftToStars) ⇒ <code>Promise</code>
|
|
184
|
+
* [.upgradeGift(businessConnectionId, ownedGiftId, [options])](#TelegramBot+upgradeGift) ⇒ <code>Promise</code>
|
|
185
|
+
* [.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options])](#TelegramBot+transferGift) ⇒ <code>Promise</code>
|
|
186
|
+
* [.postStory(businessConnectionId, content, activePeriod, [options])](#TelegramBot+postStory) ⇒ <code>Promise</code>
|
|
187
|
+
* [.editStory(businessConnectionId, storyId, content, [options])](#TelegramBot+editStory) ⇒ <code>Promise</code>
|
|
188
|
+
* [.deleteStory(businessConnectionId, storyId, [options])](#TelegramBot+deleteStory) ⇒ <code>Promise</code>
|
|
189
|
+
* _static_
|
|
190
|
+
* [.errors](#TelegramBot.errors) : <code>Object</code>
|
|
191
|
+
* [.messageTypes](#TelegramBot.messageTypes) : <code>[ 'Array' ].<String></code>
|
|
192
|
+
|
|
193
|
+
<a name="new_TelegramBot_new"></a>
|
|
194
|
+
|
|
195
|
+
### new TelegramBot(token, [options])
|
|
196
|
+
Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
| Param | Type | Default | Description |
|
|
200
|
+
| --- | --- | --- | --- |
|
|
201
|
+
| token | <code>String</code> | | Bot Token |
|
|
202
|
+
| [options] | <code>Object</code> | | |
|
|
203
|
+
| [options.polling] | <code>Boolean</code> \| <code>Object</code> | <code>false</code> | Set true to enable polling or set options. If a WebHook has been set, it will be deleted automatically. |
|
|
204
|
+
| [options.polling.timeout] | <code>String</code> \| <code>Number</code> | <code>10</code> | *Deprecated. Use `options.polling.params` instead*. Timeout in seconds for long polling. |
|
|
205
|
+
| [options.testEnvironment] | <code>Boolean</code> | <code>false</code> | Set true to work with test enviroment. When working with the test environment, you may use HTTP links without TLS to test your Web App. |
|
|
206
|
+
| [options.polling.interval] | <code>String</code> \| <code>Number</code> | <code>300</code> | Interval between requests in miliseconds |
|
|
207
|
+
| [options.polling.autoStart] | <code>Boolean</code> | <code>true</code> | Start polling immediately |
|
|
208
|
+
| [options.polling.params] | <code>Object</code> | | Parameters to be used in polling API requests. See https://core.telegram.org/bots/api#getupdates for more information. |
|
|
209
|
+
| [options.polling.params.timeout] | <code>Number</code> | <code>10</code> | Timeout in seconds for long polling. |
|
|
210
|
+
| [options.webHook] | <code>Boolean</code> \| <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options |
|
|
211
|
+
| [options.webHook.host] | <code>String</code> | <code>"0.0.0.0"</code> | Host to bind to |
|
|
212
|
+
| [options.webHook.port] | <code>Number</code> | <code>8443</code> | Port to bind to |
|
|
213
|
+
| [options.webHook.key] | <code>String</code> | | Path to file with PEM private key for webHook server. The file is read **synchronously**! |
|
|
214
|
+
| [options.webHook.cert] | <code>String</code> | | Path to file with PEM certificate (public) for webHook server. The file is read **synchronously**! |
|
|
215
|
+
| [options.webHook.pfx] | <code>String</code> | | Path to file with PFX private key and certificate chain for webHook server. The file is read **synchronously**! |
|
|
216
|
+
| [options.webHook.autoOpen] | <code>Boolean</code> | <code>true</code> | Open webHook immediately |
|
|
217
|
+
| [options.webHook.https] | <code>Object</code> | | Options to be passed to `https.createServer()`. Note that `options.webHook.key`, `options.webHook.cert` and `options.webHook.pfx`, if provided, will be used to override `key`, `cert` and `pfx` in this object, respectively. See https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener for more information. |
|
|
218
|
+
| [options.webHook.healthEndpoint] | <code>String</code> | <code>"/healthz"</code> | An endpoint for health checks that always responds with 200 OK |
|
|
219
|
+
| [options.onlyFirstMatch] | <code>Boolean</code> | <code>false</code> | Set to true to stop after first match. Otherwise, all regexps are executed |
|
|
220
|
+
| [options.request] | <code>Object</code> | | Options which will be added for all requests to telegram api. See https://github.com/request/request#requestoptions-callback for more information. |
|
|
221
|
+
| [options.baseApiUrl] | <code>String</code> | <code>"https://api.telegram.org"</code> | API Base URl; useful for proxying and testing |
|
|
222
|
+
| [options.filepath] | <code>Boolean</code> | <code>true</code> | Allow passing file-paths as arguments when sending files, such as photos using `TelegramBot#sendPhoto()`. See [usage information][usage-sending-files-performance] for more information on this option and its consequences. |
|
|
223
|
+
| [options.badRejection] | <code>Boolean</code> | <code>false</code> | Set to `true` **if and only if** the Node.js version you're using terminates the process on unhandled rejections. This option is only for *forward-compatibility purposes*. |
|
|
224
|
+
|
|
225
|
+
<a name="TelegramBot+on"></a>
|
|
226
|
+
|
|
227
|
+
### telegramBot.on(event, listener)
|
|
228
|
+
Add listener for the specified [event](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events).
|
|
229
|
+
|
|
230
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
231
|
+
**See**
|
|
232
|
+
|
|
233
|
+
- [Available events](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events)
|
|
234
|
+
- https://nodejs.org/api/events.html#events_emitter_on_eventname_listener
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
| Param | Type |
|
|
238
|
+
| --- | --- |
|
|
239
|
+
| event | <code>String</code> |
|
|
240
|
+
| listener | <code>function</code> |
|
|
241
|
+
|
|
242
|
+
<a name="TelegramBot+startPolling"></a>
|
|
243
|
+
|
|
244
|
+
### telegramBot.startPolling([options]) ⇒ <code>Promise</code>
|
|
245
|
+
Start polling.
|
|
246
|
+
|
|
247
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
248
|
+
|
|
249
|
+
| Param | Type | Default | Description |
|
|
250
|
+
| --- | --- | --- | --- |
|
|
251
|
+
| [options] | <code>Object</code> | | |
|
|
252
|
+
| [options.restart] | <code>Boolean</code> | <code>true</code> | Consecutive calls to this method causes polling to be restarted |
|
|
253
|
+
|
|
254
|
+
<a name="TelegramBot+initPolling"></a>
|
|
255
|
+
|
|
256
|
+
### ~~telegramBot.initPolling([options]) ⇒ <code>Promise</code>~~
|
|
257
|
+
***Deprecated***
|
|
258
|
+
|
|
259
|
+
Alias of `TelegramBot#startPolling()`. This is **deprecated**.
|
|
260
|
+
|
|
261
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
262
|
+
|
|
263
|
+
| Param | Type |
|
|
264
|
+
| --- | --- |
|
|
265
|
+
| [options] | <code>Object</code> |
|
|
266
|
+
|
|
267
|
+
<a name="TelegramBot+stopPolling"></a>
|
|
268
|
+
|
|
269
|
+
### telegramBot.stopPolling([options]) ⇒ <code>Promise</code>
|
|
270
|
+
Stops polling after the last polling request resolves.
|
|
271
|
+
|
|
272
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
273
|
+
|
|
274
|
+
| Param | Type | Description |
|
|
275
|
+
| --- | --- | --- |
|
|
276
|
+
| [options] | <code>Object</code> | Options |
|
|
277
|
+
| [options.cancel] | <code>Boolean</code> | Cancel current request |
|
|
278
|
+
| [options.reason] | <code>String</code> | Reason for stopping polling |
|
|
279
|
+
|
|
280
|
+
<a name="TelegramBot+getFileLink"></a>
|
|
281
|
+
|
|
282
|
+
### telegramBot.getFileLink(fileId, [options]) ⇒ <code>Promise</code>
|
|
283
|
+
Get link for file.
|
|
284
|
+
|
|
285
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
286
|
+
**Returns**: <code>Promise</code> - Promise which will have *fileURI* in resolve callback
|
|
287
|
+
**See**: https://core.telegram.org/bots/api#getfile
|
|
288
|
+
|
|
289
|
+
| Param | Type | Description |
|
|
290
|
+
| --- | --- | --- |
|
|
291
|
+
| fileId | <code>String</code> | File identifier to get info about |
|
|
292
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
293
|
+
|
|
294
|
+
<a name="TelegramBot+getFileStream"></a>
|
|
295
|
+
|
|
296
|
+
### telegramBot.getFileStream(fileId, [options]) ⇒ <code>stream.Readable</code>
|
|
297
|
+
Return a readable stream for file.
|
|
298
|
+
|
|
299
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
300
|
+
**Returns**: <code>stream.Readable</code> - fileStream
|
|
301
|
+
|
|
302
|
+
| Param | Type | Description |
|
|
303
|
+
| --- | --- | --- |
|
|
304
|
+
| fileId | <code>String</code> | File identifier to get info about |
|
|
305
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
306
|
+
|
|
307
|
+
<a name="TelegramBot+downloadFile"></a>
|
|
308
|
+
|
|
309
|
+
### telegramBot.downloadFile(fileId, downloadDir, [options]) ⇒ <code>Promise</code>
|
|
310
|
+
Downloads file in the specified folder.
|
|
311
|
+
|
|
312
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
313
|
+
**Returns**: <code>Promise</code> - Promise, which will have *filePath* of downloaded file in resolve callback
|
|
314
|
+
|
|
315
|
+
| Param | Type | Description |
|
|
316
|
+
| --- | --- | --- |
|
|
317
|
+
| fileId | <code>String</code> | File identifier to get info about |
|
|
318
|
+
| downloadDir | <code>String</code> | Absolute path to the folder in which file will be saved |
|
|
319
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
320
|
+
|
|
321
|
+
<a name="TelegramBot+onText"></a>
|
|
322
|
+
|
|
323
|
+
### telegramBot.onText(regexpRexecuted, callback)
|
|
324
|
+
Register a RegExp to test against an incomming text message.
|
|
325
|
+
|
|
326
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
327
|
+
|
|
328
|
+
| Param | Type | Description |
|
|
329
|
+
| --- | --- | --- |
|
|
330
|
+
| regexpRexecuted | <code>RegExp</code> | with `exec`. |
|
|
331
|
+
| callback | <code>function</code> | Callback will be called with 2 parameters, the `msg` and the result of executing `regexp.exec` on message text. |
|
|
332
|
+
|
|
333
|
+
<a name="TelegramBot+removeTextListener"></a>
|
|
334
|
+
|
|
335
|
+
### telegramBot.removeTextListener(regexp) ⇒ <code>Object</code>
|
|
336
|
+
Remove a listener registered with `onText()`.
|
|
337
|
+
|
|
338
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
339
|
+
**Returns**: <code>Object</code> - deletedListener The removed reply listener if
|
|
340
|
found. This object has `regexp` and `callback`
|
|
1
341
|
properties. If not found, returns `null`.
|
|
342
|
+
|
|
343
|
+
| Param | Type | Description |
|
|
344
|
+
| --- | --- | --- |
|
|
345
|
+
| regexp | <code>RegExp</code> | RegExp used previously in `onText()` |
|
|
346
|
+
|
|
347
|
+
<a name="TelegramBot+clearTextListeners"></a>
|
|
348
|
+
|
|
349
|
+
### telegramBot.clearTextListeners()
|
|
350
|
+
Remove all listeners registered with `onText()`.
|
|
351
|
+
|
|
352
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
353
|
+
<a name="TelegramBot+onReplyToMessage"></a>
|
|
354
|
+
|
|
355
|
+
### telegramBot.onReplyToMessage(chatId, messageId, callback) ⇒ <code>Number</code>
|
|
356
|
+
Register a reply to wait for a message response.
|
|
357
|
+
|
|
358
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
359
|
+
**Returns**: <code>Number</code> - id The ID of the inserted reply listener.
|
|
360
|
+
|
|
361
|
+
| Param | Type | Description |
|
|
362
|
+
| --- | --- | --- |
|
|
363
|
+
| chatId | <code>Number</code> \| <code>String</code> | The chat id where the message cames from. |
|
|
364
|
+
| messageId | <code>Number</code> \| <code>String</code> | The message id to be replied. |
|
|
365
|
+
| callback | <code>function</code> | Callback will be called with the reply message. |
|
|
366
|
+
|
|
367
|
+
<a name="TelegramBot+removeReplyListener"></a>
|
|
368
|
+
|
|
369
|
+
### telegramBot.removeReplyListener(replyListenerId) ⇒ <code>Object</code>
|
|
370
|
+
Removes a reply that has been prev. registered for a message response.
|
|
371
|
+
|
|
372
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
373
|
+
**Returns**: <code>Object</code> - deletedListener The removed reply listener if
|
|
2
374
|
found. This object has `id`, `chatId`, `messageId` and `callback`
|
|
3
375
|
properties. If not found, returns `null`.
|
|
376
|
+
|
|
377
|
+
| Param | Type | Description |
|
|
378
|
+
| --- | --- | --- |
|
|
379
|
+
| replyListenerId | <code>Number</code> | The ID of the reply listener. |
|
|
380
|
+
|
|
381
|
+
<a name="TelegramBot+clearReplyListeners"></a>
|
|
382
|
+
|
|
383
|
+
### telegramBot.clearReplyListeners() ⇒ <code>Array</code>
|
|
384
|
+
Removes all replies that have been prev. registered for a message response.
|
|
385
|
+
|
|
386
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
387
|
+
**Returns**: <code>Array</code> - deletedListeners An array of removed listeners.
|
|
388
|
+
<a name="TelegramBot+isPolling"></a>
|
|
389
|
+
|
|
390
|
+
### telegramBot.isPolling() ⇒ <code>Boolean</code>
|
|
391
|
+
Return true if polling. Otherwise, false.
|
|
392
|
+
|
|
393
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
394
|
+
<a name="TelegramBot+openWebHook"></a>
|
|
395
|
+
|
|
396
|
+
### telegramBot.openWebHook() ⇒ <code>Promise</code>
|
|
397
|
+
Open webhook.
|
|
398
|
+
|
|
399
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
400
|
+
<a name="TelegramBot+closeWebHook"></a>
|
|
401
|
+
|
|
402
|
+
### telegramBot.closeWebHook() ⇒ <code>Promise</code>
|
|
403
|
+
Close webhook after closing all current connections.
|
|
404
|
+
|
|
405
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
406
|
+
**Returns**: <code>Promise</code> - Promise
|
|
407
|
+
<a name="TelegramBot+hasOpenWebHook"></a>
|
|
408
|
+
|
|
409
|
+
### telegramBot.hasOpenWebHook() ⇒ <code>Boolean</code>
|
|
410
|
+
Return true if using webhook and it is open i.e. accepts connections.
|
|
411
|
+
|
|
412
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
413
|
+
<a name="TelegramBot+processUpdate"></a>
|
|
414
|
+
|
|
415
|
+
### telegramBot.processUpdate(update)
|
|
416
|
+
Process an update; emitting the proper events and executing regexp
|
|
417
|
+
|
|
418
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
419
|
+
**See**: https://core.telegram.org/bots/api#update
|
|
420
|
+
|
|
421
|
+
| Param | Type |
|
|
422
|
+
| --- | --- |
|
|
423
|
+
| update | <code>Object</code> |
|
|
424
|
+
|
|
425
|
+
<a name="TelegramBot+getUpdates"></a>
|
|
426
|
+
|
|
427
|
+
### telegramBot.getUpdates([options]) ⇒ <code>Promise</code>
|
|
428
|
+
Use this method to receive incoming updates using long polling.
|
|
429
|
+
|
|
430
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
431
|
+
**See**: https://core.telegram.org/bots/api#getupdates
|
|
432
|
+
|
|
433
|
+
| Param | Type | Description |
|
|
434
|
+
| --- | --- | --- |
|
|
435
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
436
|
+
|
|
437
|
+
<a name="TelegramBot+setWebHook"></a>
|
|
438
|
+
|
|
439
|
+
### telegramBot.setWebHook(url, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
440
|
+
Specify an url to receive incoming updates via an outgoing webHook.
|
|
441
|
+
|
|
442
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
443
|
+
**See**
|
|
444
|
+
|
|
445
|
+
- https://core.telegram.org/bots/api#setwebhook
|
|
446
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
| Param | Type | Description |
|
|
450
|
+
| --- | --- | --- |
|
|
451
|
+
| url | <code>String</code> | URL where Telegram will make HTTP Post. Leave empty to delete webHook. |
|
|
452
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
453
|
+
| [options.certificate] | <code>String</code> \| <code>stream.Stream</code> | PEM certificate key (public). |
|
|
454
|
+
| [options.secret_token] | <code>String</code> | Optional secret token to be sent in a header `X-Telegram-Bot-Api-Secret-Token` in every webhook request. |
|
|
455
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
456
|
+
|
|
457
|
+
<a name="TelegramBot+deleteWebHook"></a>
|
|
458
|
+
|
|
459
|
+
### telegramBot.deleteWebHook([options]) ⇒ <code>Promise</code>
|
|
460
|
+
Use this method to remove webhook integration if you decide to
|
|
461
|
+
|
|
462
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
463
|
+
**See**: https://core.telegram.org/bots/api#deletewebhook
|
|
464
|
+
|
|
465
|
+
| Param | Type | Description |
|
|
466
|
+
| --- | --- | --- |
|
|
467
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
468
|
+
|
|
469
|
+
<a name="TelegramBot+getWebHookInfo"></a>
|
|
470
|
+
|
|
471
|
+
### telegramBot.getWebHookInfo([options]) ⇒ <code>Promise</code>
|
|
472
|
+
Use this method to get current webhook status.
|
|
473
|
+
|
|
474
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
475
|
+
**See**: https://core.telegram.org/bots/api#getwebhookinfo
|
|
476
|
+
|
|
477
|
+
| Param | Type | Description |
|
|
478
|
+
| --- | --- | --- |
|
|
479
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
480
|
+
|
|
481
|
+
<a name="TelegramBot+getMe"></a>
|
|
482
|
+
|
|
483
|
+
### telegramBot.getMe([options]) ⇒ <code>Promise</code>
|
|
484
|
+
A simple method for testing your bot's authentication token. Requires no parameters.
|
|
485
|
+
|
|
486
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
487
|
+
**Returns**: <code>Promise</code> - basic information about the bot in form of a [User](https://core.telegram.org/bots/api#user) object.
|
|
488
|
+
**See**: https://core.telegram.org/bots/api#getme
|
|
489
|
+
|
|
490
|
+
| Param | Type | Description |
|
|
491
|
+
| --- | --- | --- |
|
|
492
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
493
|
+
|
|
494
|
+
<a name="TelegramBot+logOut"></a>
|
|
495
|
+
|
|
496
|
+
### telegramBot.logOut([options]) ⇒ <code>Promise</code>
|
|
497
|
+
This method log out your bot from the cloud Bot API server before launching the bot locally.
|
|
498
|
+
|
|
499
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
500
|
+
**Returns**: <code>Promise</code> - True on success
|
|
501
|
+
**See**: https://core.telegram.org/bots/api#logout
|
|
502
|
+
|
|
503
|
+
| Param | Type | Description |
|
|
504
|
+
| --- | --- | --- |
|
|
505
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
506
|
+
|
|
507
|
+
<a name="TelegramBot+close"></a>
|
|
508
|
+
|
|
509
|
+
### telegramBot.close([options]) ⇒ <code>Promise</code>
|
|
510
|
+
This method close the bot instance before moving it from one local server to another.
|
|
511
|
+
|
|
512
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
513
|
+
**Returns**: <code>Promise</code> - True on success
|
|
514
|
+
**See**: https://core.telegram.org/bots/api#close
|
|
515
|
+
|
|
516
|
+
| Param | Type | Description |
|
|
517
|
+
| --- | --- | --- |
|
|
518
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
519
|
+
|
|
520
|
+
<a name="TelegramBot+sendMessage"></a>
|
|
521
|
+
|
|
522
|
+
### telegramBot.sendMessage(chatId, text, [options]) ⇒ <code>Promise</code>
|
|
523
|
+
Send text message.
|
|
524
|
+
|
|
525
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
526
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
527
|
+
**See**: https://core.telegram.org/bots/api#sendmessage
|
|
528
|
+
|
|
529
|
+
| Param | Type | Description |
|
|
530
|
+
| --- | --- | --- |
|
|
531
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
532
|
+
| text | <code>String</code> | Text of the message to be sent |
|
|
533
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
534
|
+
|
|
535
|
+
<a name="TelegramBot+forwardMessage"></a>
|
|
536
|
+
|
|
537
|
+
### telegramBot.forwardMessage(chatId, fromChatId, messageId, [options]) ⇒ <code>Promise</code>
|
|
538
|
+
Forward messages of any kind.
|
|
539
|
+
|
|
540
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
541
|
+
**See**: https://core.telegram.org/bots/api#forwardmessage
|
|
542
|
+
|
|
543
|
+
| Param | Type | Description |
|
|
544
|
+
| --- | --- | --- |
|
|
545
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or username of the target channel (in the format `@channelusername`) |
|
|
546
|
+
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`) |
|
|
547
|
+
| messageId | <code>Number</code> \| <code>String</code> | Unique message identifier in the chat specified in fromChatId |
|
|
548
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
549
|
+
|
|
550
|
+
<a name="TelegramBot+forwardMessages"></a>
|
|
551
|
+
|
|
552
|
+
### telegramBot.forwardMessages(chatId, fromChatId, messageIds, [options]) ⇒ <code>Promise</code>
|
|
553
|
+
Use this method to forward multiple messages of any kind.
|
|
554
|
+
|
|
555
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
556
|
+
**Returns**: <code>Promise</code> - An array of MessageId of the sent messages on success
|
|
557
|
+
**See**: https://core.telegram.org/bots/api#forwardmessages
|
|
558
|
+
|
|
559
|
+
| Param | Type | Description |
|
|
560
|
+
| --- | --- | --- |
|
|
561
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or username of the target channel (in the format `@channelusername`) |
|
|
562
|
+
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent (or channel username in the format `@channelusername`) |
|
|
563
|
+
| messageIds | <code>[ 'Array' ].<(Number\|String)></code> | Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. |
|
|
564
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
565
|
+
|
|
566
|
+
<a name="TelegramBot+copyMessage"></a>
|
|
567
|
+
|
|
568
|
+
### telegramBot.copyMessage(chatId, fromChatId, messageId, [options]) ⇒ <code>Promise</code>
|
|
569
|
+
Copy messages of any kind. **Service messages and invoice messages can't be copied.**
|
|
570
|
+
|
|
571
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
572
|
+
**Returns**: <code>Promise</code> - The [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success
|
|
573
|
+
**See**: https://core.telegram.org/bots/api#copymessage
|
|
574
|
+
|
|
575
|
+
| Param | Type | Description |
|
|
576
|
+
| --- | --- | --- |
|
|
577
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
578
|
+
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent |
|
|
579
|
+
| messageId | <code>Number</code> \| <code>String</code> | Unique message identifier |
|
|
580
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
581
|
+
|
|
582
|
+
<a name="TelegramBot+copyMessages"></a>
|
|
583
|
+
|
|
584
|
+
### telegramBot.copyMessages(chatId, fromChatId, messageIds, [options]) ⇒ <code>Promise</code>
|
|
585
|
+
Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
|
|
586
|
+
|
|
587
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
588
|
+
**Returns**: <code>Promise</code> - An array of MessageId of the sent messages
|
|
589
|
+
**See**: https://core.telegram.org/bots/api#copymessages
|
|
590
|
+
|
|
591
|
+
| Param | Type | Description |
|
|
592
|
+
| --- | --- | --- |
|
|
593
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat |
|
|
594
|
+
| fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent |
|
|
595
|
+
| messageIds | <code>Array</code> | Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. |
|
|
596
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
597
|
+
|
|
598
|
+
<a name="TelegramBot+sendPhoto"></a>
|
|
599
|
+
|
|
600
|
+
### telegramBot.sendPhoto(chatId, photo, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
601
|
+
Send photo
|
|
602
|
+
|
|
603
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
604
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
605
|
+
**See**
|
|
606
|
+
|
|
607
|
+
- https://core.telegram.org/bots/api#sendphoto
|
|
608
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
| Param | Type | Description |
|
|
612
|
+
| --- | --- | --- |
|
|
613
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
614
|
+
| photo | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or a Stream. Can also be a `file_id` previously uploaded |
|
|
615
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
616
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
617
|
+
|
|
618
|
+
<a name="TelegramBot+sendAudio"></a>
|
|
619
|
+
|
|
620
|
+
### telegramBot.sendAudio(chatId, audio, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
621
|
+
Send audio
|
|
622
|
+
|
|
623
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
624
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
625
|
+
**See**
|
|
626
|
+
|
|
627
|
+
- https://core.telegram.org/bots/api#sendaudio
|
|
628
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
| Param | Type | Description |
|
|
632
|
+
| --- | --- | --- |
|
|
633
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
634
|
+
| audio | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
|
|
635
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
636
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
637
|
+
|
|
638
|
+
<a name="TelegramBot+sendDocument"></a>
|
|
639
|
+
|
|
640
|
+
### telegramBot.sendDocument(chatId, doc, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
641
|
+
Send Document
|
|
642
|
+
|
|
643
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
644
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
645
|
+
**See**
|
|
646
|
+
|
|
647
|
+
- https://core.telegram.org/bots/api#sendDocument
|
|
648
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
| Param | Type | Description |
|
|
652
|
+
| --- | --- | --- |
|
|
653
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
654
|
+
| doc | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
|
|
655
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
656
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
657
|
+
|
|
658
|
+
<a name="TelegramBot+sendVideo"></a>
|
|
659
|
+
|
|
660
|
+
### telegramBot.sendVideo(chatId, video, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
661
|
+
Use this method to send video files, **Telegram clients support mp4 videos** (other formats may be sent as Document).
|
|
662
|
+
|
|
663
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
664
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
665
|
+
**See**
|
|
666
|
+
|
|
667
|
+
- https://core.telegram.org/bots/api#sendvideo
|
|
668
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
| Param | Type | Description |
|
|
672
|
+
| --- | --- | --- |
|
|
673
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
674
|
+
| video | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. Can also be a `file_id` previously uploaded. |
|
|
675
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
676
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
677
|
+
|
|
678
|
+
<a name="TelegramBot+sendAnimation"></a>
|
|
679
|
+
|
|
680
|
+
### telegramBot.sendAnimation(chatId, animation, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
681
|
+
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
|
|
682
|
+
|
|
683
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
684
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
685
|
+
**See**
|
|
686
|
+
|
|
687
|
+
- https://core.telegram.org/bots/api#sendanimation
|
|
688
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
| Param | Type | Description |
|
|
692
|
+
| --- | --- | --- |
|
|
693
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
694
|
+
| animation | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
|
|
695
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
696
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
697
|
+
|
|
698
|
+
<a name="TelegramBot+sendVoice"></a>
|
|
699
|
+
|
|
700
|
+
### telegramBot.sendVoice(chatId, voice, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
701
|
+
Send voice
|
|
702
|
+
|
|
703
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
704
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
705
|
+
**See**
|
|
706
|
+
|
|
707
|
+
- https://core.telegram.org/bots/api#sendvoice
|
|
708
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
| Param | Type | Description |
|
|
712
|
+
| --- | --- | --- |
|
|
713
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
714
|
+
| voice | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. |
|
|
715
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
716
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
717
|
+
|
|
718
|
+
<a name="TelegramBot+sendVideoNote"></a>
|
|
719
|
+
|
|
720
|
+
### telegramBot.sendVideoNote(chatId, videoNote, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
721
|
+
Use this method to send video messages
|
|
722
|
+
|
|
723
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
724
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
725
|
+
**Info**: The length parameter is actually optional. However, the API (at time of writing) requires you to always provide it until it is fixed.
|
|
726
|
+
**See**
|
|
727
|
+
|
|
728
|
+
- https://core.telegram.org/bots/api#sendvideonote
|
|
729
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
| Param | Type | Description |
|
|
733
|
+
| --- | --- | --- |
|
|
734
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
735
|
+
| videoNote | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. Can also be a `file_id` previously uploaded. |
|
|
736
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
737
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
738
|
+
|
|
739
|
+
<a name="TelegramBot+sendPaidMedia"></a>
|
|
740
|
+
|
|
741
|
+
### telegramBot.sendPaidMedia(chatId, starCount, media, [options]) ⇒ <code>Promise</code>
|
|
742
|
+
Use this method to send paid media.
|
|
743
|
+
|
|
744
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
745
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
746
|
+
**See**: https://core.telegram.org/bots/api#sendpaidmedia
|
|
747
|
+
|
|
748
|
+
| Param | Type | Description |
|
|
749
|
+
| --- | --- | --- |
|
|
750
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
751
|
+
| starCount | <code>Number</code> | The number of Telegram Stars that must be paid to buy access to the media; 1-10000 |
|
|
752
|
+
| media | <code>Array</code> | Array of [InputPaidMedia](https://core.telegram.org/bots/api#inputpaidmedia). The media property can bea String, Stream or Buffer. |
|
|
753
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
754
|
+
|
|
755
|
+
<a name="TelegramBot+sendMediaGroup"></a>
|
|
756
|
+
|
|
757
|
+
### telegramBot.sendMediaGroup(chatId, media, [options]) ⇒ <code>Promise</code>
|
|
758
|
+
Use this method to send a group of photos or videos as an album.
|
|
759
|
+
|
|
760
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
761
|
+
**Returns**: <code>Promise</code> - On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
|
|
762
|
+
**See**
|
|
763
|
+
|
|
764
|
+
- https://core.telegram.org/bots/api#sendmediagroup
|
|
765
|
+
- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
| Param | Type | Description |
|
|
769
|
+
| --- | --- | --- |
|
|
770
|
+
| chatId | <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
771
|
+
| media | <code>Array</code> | A JSON-serialized array describing photos and videos to be sent, must include 2–10 items |
|
|
772
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
773
|
+
|
|
774
|
+
<a name="TelegramBot+sendLocation"></a>
|
|
775
|
+
|
|
776
|
+
### telegramBot.sendLocation(chatId, latitude, longitude, [options]) ⇒ <code>Promise</code>
|
|
777
|
+
Send location.
|
|
778
|
+
|
|
779
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
780
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
781
|
+
**See**: https://core.telegram.org/bots/api#sendlocation
|
|
782
|
+
|
|
783
|
+
| Param | Type | Description |
|
|
784
|
+
| --- | --- | --- |
|
|
785
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
786
|
+
| latitude | <code>Float</code> | Latitude of location |
|
|
787
|
+
| longitude | <code>Float</code> | Longitude of location |
|
|
788
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
789
|
+
|
|
790
|
+
<a name="TelegramBot+editMessageLiveLocation"></a>
|
|
791
|
+
|
|
792
|
+
### telegramBot.editMessageLiveLocation(latitude, longitude, [options]) ⇒ <code>Promise</code>
|
|
793
|
+
Use this method to edit live location messages sent by
|
|
4
794
|
A location **can be edited until its live_period expires or editing is explicitly disabled by a call to [stopMessageLiveLocation](https://core.telegram.org/bots/api#stopmessagelivelocation)**
|
|
795
|
+
|
|
796
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
797
|
+
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
|
|
798
|
+
**See**: https://core.telegram.org/bots/api#editmessagelivelocation
|
|
799
|
+
|
|
800
|
+
| Param | Type | Description |
|
|
801
|
+
| --- | --- | --- |
|
|
802
|
+
| latitude | <code>Float</code> | Latitude of location |
|
|
803
|
+
| longitude | <code>Float</code> | Longitude of location |
|
|
804
|
+
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
|
805
|
+
|
|
806
|
+
<a name="TelegramBot+stopMessageLiveLocation"></a>
|
|
807
|
+
|
|
808
|
+
### telegramBot.stopMessageLiveLocation([options]) ⇒ <code>Promise</code>
|
|
809
|
+
Use this method to stop updating a live location message sent by
|
|
810
|
+
|
|
811
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
812
|
+
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
|
|
813
|
+
**See**: https://core.telegram.org/bots/api#stopmessagelivelocation
|
|
814
|
+
|
|
815
|
+
| Param | Type | Description |
|
|
816
|
+
| --- | --- | --- |
|
|
817
|
+
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
|
818
|
+
|
|
819
|
+
<a name="TelegramBot+sendVenue"></a>
|
|
820
|
+
|
|
821
|
+
### telegramBot.sendVenue(chatId, latitude, longitude, title, address, [options]) ⇒ <code>Promise</code>
|
|
822
|
+
Send venue.
|
|
823
|
+
|
|
824
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
825
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
|
|
826
|
+
**See**: https://core.telegram.org/bots/api#sendvenue
|
|
827
|
+
|
|
828
|
+
| Param | Type | Description |
|
|
829
|
+
| --- | --- | --- |
|
|
830
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
831
|
+
| latitude | <code>Float</code> | Latitude of location |
|
|
832
|
+
| longitude | <code>Float</code> | Longitude of location |
|
|
833
|
+
| title | <code>String</code> | Name of the venue |
|
|
834
|
+
| address | <code>String</code> | Address of the venue |
|
|
835
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
836
|
+
|
|
837
|
+
<a name="TelegramBot+sendContact"></a>
|
|
838
|
+
|
|
839
|
+
### telegramBot.sendContact(chatId, phoneNumber, firstName, [options]) ⇒ <code>Promise</code>
|
|
840
|
+
Send contact.
|
|
841
|
+
|
|
842
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
843
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
844
|
+
**See**: https://core.telegram.org/bots/api#sendcontact
|
|
845
|
+
|
|
846
|
+
| Param | Type | Description |
|
|
847
|
+
| --- | --- | --- |
|
|
848
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
849
|
+
| phoneNumber | <code>String</code> | Contact's phone number |
|
|
850
|
+
| firstName | <code>String</code> | Contact's first name |
|
|
851
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
852
|
+
|
|
853
|
+
<a name="TelegramBot+sendPoll"></a>
|
|
854
|
+
|
|
855
|
+
### telegramBot.sendPoll(chatId, question, pollOptions, [options]) ⇒ <code>Promise</code>
|
|
856
|
+
Send poll.
|
|
857
|
+
|
|
858
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
859
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
860
|
+
**See**: https://core.telegram.org/bots/api#sendpoll
|
|
861
|
+
|
|
862
|
+
| Param | Type | Description |
|
|
863
|
+
| --- | --- | --- |
|
|
864
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
|
|
865
|
+
| question | <code>String</code> | Poll question, 1-300 characters |
|
|
866
|
+
| pollOptions | <code>Array</code> | Poll options, between 2-10 options (only 1-100 characters each) |
|
|
867
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
868
|
+
|
|
869
|
+
<a name="TelegramBot+sendChecklist"></a>
|
|
870
|
+
|
|
871
|
+
### telegramBot.sendChecklist(businessConnectionId, chatId, checklist, [options]) ⇒ <code>Promise</code>
|
|
872
|
+
Send sendChecklist.
|
|
873
|
+
|
|
874
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
875
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
876
|
+
**See**: https://core.telegram.org/bots/api#sendchecklist
|
|
877
|
+
|
|
878
|
+
| Param | Type | Description |
|
|
879
|
+
| --- | --- | --- |
|
|
880
|
+
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the business connection |
|
|
881
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
|
|
882
|
+
| checklist | <code>Object</code> | A JSON-serialized object for the checklist to send |
|
|
883
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
884
|
+
|
|
885
|
+
<a name="TelegramBot+sendDice"></a>
|
|
886
|
+
|
|
887
|
+
### telegramBot.sendDice(chatId, [options]) ⇒ <code>Promise</code>
|
|
888
|
+
Send Dice
|
|
889
|
+
|
|
890
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
891
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
|
892
|
+
**See**: https://core.telegram.org/bots/api#senddice
|
|
893
|
+
|
|
894
|
+
| Param | Type | Description |
|
|
895
|
+
| --- | --- | --- |
|
|
896
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
897
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
898
|
+
|
|
899
|
+
<a name="TelegramBot+sendChatAction"></a>
|
|
900
|
+
|
|
901
|
+
### telegramBot.sendChatAction(chatId, action, [options]) ⇒ <code>Promise</code>
|
|
902
|
+
Send chat action.
|
|
5
903
|
Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
|
|
904
|
+
|
|
905
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
906
|
+
**Returns**: <code>Promise</code> - True on success
|
|
907
|
+
**See**: https://core.telegram.org/bots/api#sendchataction
|
|
908
|
+
|
|
909
|
+
| Param | Type | Description |
|
|
910
|
+
| --- | --- | --- |
|
|
911
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
912
|
+
| action | <code>String</code> | Type of action to broadcast. |
|
|
913
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
914
|
+
|
|
915
|
+
<a name="TelegramBot+setMessageReaction"></a>
|
|
916
|
+
|
|
917
|
+
### telegramBot.setMessageReaction(chatId, messageId, [options]) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
|
918
|
+
Use this method to change the chosen reactions on a message.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
919
|
+
|
|
920
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
921
|
+
**Returns**: <code>[ 'Promise' ].<Boolean></code> - True on success
|
|
922
|
+
**See**: https://core.telegram.org/bots/api#setmessagereaction
|
|
923
|
+
|
|
924
|
+
| Param | Type | Description |
|
|
925
|
+
| --- | --- | --- |
|
|
926
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
|
927
|
+
| messageId | <code>Number</code> | Unique identifier of the target message |
|
|
928
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
929
|
+
|
|
930
|
+
<a name="TelegramBot+getUserProfilePhotos"></a>
|
|
931
|
+
|
|
932
|
+
### telegramBot.getUserProfilePhotos(userId, [options]) ⇒ <code>Promise</code>
|
|
933
|
+
Use this method to get a list of profile pictures for a user.
|
|
934
|
+
|
|
935
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
936
|
+
**Returns**: <code>Promise</code> - Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object
|
|
937
|
+
**See**: https://core.telegram.org/bots/api#getuserprofilephotos
|
|
938
|
+
|
|
939
|
+
| Param | Type | Description |
|
|
940
|
+
| --- | --- | --- |
|
|
941
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
942
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
943
|
+
|
|
944
|
+
<a name="TelegramBot+setUserEmojiStatus"></a>
|
|
945
|
+
|
|
946
|
+
### telegramBot.setUserEmojiStatus(userId, [options]) ⇒ <code>Promise</code>
|
|
947
|
+
Changes the emoji status for a given user that previously allowed the bot to manage their emoji status
|
|
948
|
+
|
|
949
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
950
|
+
**Returns**: <code>Promise</code> - True on success
|
|
951
|
+
**See**: https://core.telegram.org/bots/api#setuseremojistatus
|
|
952
|
+
|
|
953
|
+
| Param | Type | Description |
|
|
954
|
+
| --- | --- | --- |
|
|
955
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
956
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
957
|
+
|
|
958
|
+
<a name="TelegramBot+getFile"></a>
|
|
959
|
+
|
|
960
|
+
### telegramBot.getFile(fileId, [options]) ⇒ <code>Promise</code>
|
|
961
|
+
Get file.
|
|
962
|
+
|
|
963
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
964
|
+
**Returns**: <code>Promise</code> - On success, a [File](https://core.telegram.org/bots/api#file) object is returned
|
|
965
|
+
**See**: https://core.telegram.org/bots/api#getfile
|
|
966
|
+
|
|
967
|
+
| Param | Type | Description |
|
|
968
|
+
| --- | --- | --- |
|
|
969
|
+
| fileId | <code>String</code> | File identifier to get info about |
|
|
970
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
971
|
+
|
|
972
|
+
<a name="TelegramBot+banChatMember"></a>
|
|
973
|
+
|
|
974
|
+
### telegramBot.banChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
975
|
+
Use this method to ban a user in a group, a supergroup or a channel.
|
|
976
|
+
|
|
977
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
978
|
+
**Returns**: <code>Promise</code> - True on success.
|
|
979
|
+
**See**: https://core.telegram.org/bots/api#banchatmember
|
|
980
|
+
|
|
981
|
+
| Param | Type | Description |
|
|
982
|
+
| --- | --- | --- |
|
|
983
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
984
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
985
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
986
|
+
|
|
987
|
+
<a name="TelegramBot+unbanChatMember"></a>
|
|
988
|
+
|
|
989
|
+
### telegramBot.unbanChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
990
|
+
Use this method to unban a previously kicked user in a supergroup.
|
|
991
|
+
|
|
992
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
993
|
+
**Returns**: <code>Promise</code> - True on success
|
|
994
|
+
**See**: https://core.telegram.org/bots/api#unbanchatmember
|
|
995
|
+
|
|
996
|
+
| Param | Type | Description |
|
|
997
|
+
| --- | --- | --- |
|
|
998
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
999
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1000
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1001
|
+
|
|
1002
|
+
<a name="TelegramBot+restrictChatMember"></a>
|
|
1003
|
+
|
|
1004
|
+
### telegramBot.restrictChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
1005
|
+
Use this method to restrict a user in a supergroup.
|
|
1006
|
+
|
|
1007
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1008
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1009
|
+
**See**: https://core.telegram.org/bots/api#restrictchatmember
|
|
1010
|
+
|
|
1011
|
+
| Param | Type | Description |
|
|
1012
|
+
| --- | --- | --- |
|
|
1013
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1014
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1015
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1016
|
+
|
|
1017
|
+
<a name="TelegramBot+promoteChatMember"></a>
|
|
1018
|
+
|
|
1019
|
+
### telegramBot.promoteChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
1020
|
+
Use this method to promote or demote a user in a supergroup or a channel.
|
|
1021
|
+
|
|
1022
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1023
|
+
**Returns**: <code>Promise</code> - True on success.
|
|
1024
|
+
**See**: https://core.telegram.org/bots/api#promotechatmember
|
|
1025
|
+
|
|
1026
|
+
| Param | Type | Description |
|
|
1027
|
+
| --- | --- | --- |
|
|
1028
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1029
|
+
| userId | <code>Number</code> | |
|
|
1030
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1031
|
+
|
|
1032
|
+
<a name="TelegramBot+setChatAdministratorCustomTitle"></a>
|
|
1033
|
+
|
|
1034
|
+
### telegramBot.setChatAdministratorCustomTitle(chatId, userId, customTitle, [options]) ⇒ <code>Promise</code>
|
|
1035
|
+
Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
|
|
1036
|
+
|
|
1037
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1038
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1039
|
+
**See**: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
|
|
1040
|
+
|
|
1041
|
+
| Param | Type | Description |
|
|
1042
|
+
| --- | --- | --- |
|
|
1043
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1044
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1045
|
+
| customTitle | <code>String</code> | New custom title for the administrator; 0-16 characters, emoji are not allowed |
|
|
1046
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1047
|
+
|
|
1048
|
+
<a name="TelegramBot+banChatSenderChat"></a>
|
|
1049
|
+
|
|
1050
|
+
### telegramBot.banChatSenderChat(chatId, senderChatId, [options]) ⇒ <code>Promise</code>
|
|
1051
|
+
Use this method to ban a channel chat in a supergroup or a channel.
|
|
1052
|
+
|
|
1053
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1054
|
+
**Returns**: <code>Promise</code> - True on success.
|
|
1055
|
+
**See**: https://core.telegram.org/bots/api#banchatsenderchat
|
|
1056
|
+
|
|
1057
|
+
| Param | Type | Description |
|
|
1058
|
+
| --- | --- | --- |
|
|
1059
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1060
|
+
| senderChatId | <code>Number</code> | Unique identifier of the target user |
|
|
1061
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1062
|
+
|
|
1063
|
+
<a name="TelegramBot+unbanChatSenderChat"></a>
|
|
1064
|
+
|
|
1065
|
+
### telegramBot.unbanChatSenderChat(chatId, senderChatId, [options]) ⇒ <code>Promise</code>
|
|
1066
|
+
Use this method to unban a previously banned channel chat in a supergroup or channel.
|
|
1067
|
+
|
|
1068
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1069
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1070
|
+
**See**: https://core.telegram.org/bots/api#unbanchatsenderchat
|
|
1071
|
+
|
|
1072
|
+
| Param | Type | Description |
|
|
1073
|
+
| --- | --- | --- |
|
|
1074
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1075
|
+
| senderChatId | <code>Number</code> | Unique identifier of the target user |
|
|
1076
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1077
|
+
|
|
1078
|
+
<a name="TelegramBot+setChatPermissions"></a>
|
|
1079
|
+
|
|
1080
|
+
### telegramBot.setChatPermissions(chatId, chatPermissions, [options]) ⇒ <code>Promise</code>
|
|
1081
|
+
Use this method to set default chat permissions for all members.
|
|
1082
|
+
|
|
1083
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1084
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1085
|
+
**See**: https://core.telegram.org/bots/api#setchatpermissions
|
|
1086
|
+
|
|
1087
|
+
| Param | Type | Description |
|
|
1088
|
+
| --- | --- | --- |
|
|
1089
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1090
|
+
| chatPermissions | <code>Array</code> | New default chat permissions |
|
|
1091
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1092
|
+
|
|
1093
|
+
<a name="TelegramBot+exportChatInviteLink"></a>
|
|
1094
|
+
|
|
1095
|
+
### telegramBot.exportChatInviteLink(chatId, [options]) ⇒ <code>Promise</code>
|
|
1096
|
+
Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.
|
|
1097
|
+
|
|
1098
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1099
|
+
**Returns**: <code>Promise</code> - Exported invite link as String on success.
|
|
1100
|
+
**See**: https://core.telegram.org/bots/api#exportchatinvitelink
|
|
1101
|
+
|
|
1102
|
+
| Param | Type | Description |
|
|
1103
|
+
| --- | --- | --- |
|
|
1104
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1105
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1106
|
+
|
|
1107
|
+
<a name="TelegramBot+createChatInviteLink"></a>
|
|
1108
|
+
|
|
1109
|
+
### telegramBot.createChatInviteLink(chatId, [options]) ⇒ <code>Object</code>
|
|
1110
|
+
Use this method to create an additional invite link for a chat.
|
|
1111
|
+
|
|
1112
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1113
|
+
**Returns**: <code>Object</code> - The new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
|
|
1114
|
+
**See**: https://core.telegram.org/bots/api#createchatinvitelink
|
|
1115
|
+
|
|
1116
|
+
| Param | Type | Description |
|
|
1117
|
+
| --- | --- | --- |
|
|
1118
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1119
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1120
|
+
|
|
1121
|
+
<a name="TelegramBot+editChatInviteLink"></a>
|
|
1122
|
+
|
|
1123
|
+
### telegramBot.editChatInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
|
|
1124
|
+
Use this method to edit a non-primary invite link created by the bot.
|
|
1125
|
+
|
|
1126
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1127
|
+
**Returns**: <code>Promise</code> - The edited invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
|
|
1128
|
+
**See**: https://core.telegram.org/bots/api#editchatinvitelink
|
|
1129
|
+
|
|
1130
|
+
| Param | Type | Description |
|
|
1131
|
+
| --- | --- | --- |
|
|
1132
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1133
|
+
| inviteLink | <code>String</code> | Text with the invite link to edit |
|
|
1134
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1135
|
+
|
|
1136
|
+
<a name="TelegramBot+createChatSubscriptionInviteLink"></a>
|
|
1137
|
+
|
|
1138
|
+
### telegramBot.createChatSubscriptionInviteLink(chatId, subscriptionPeriod, subscriptionPrice, [options]) ⇒ <code>Promise</code>
|
|
1139
|
+
Use this method to create a subscription invite link for a channel chat.
|
|
1140
|
+
|
|
1141
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1142
|
+
**Returns**: <code>Promise</code> - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
|
|
1143
|
+
**See**: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
|
|
1144
|
+
|
|
1145
|
+
| Param | Type | Description |
|
|
1146
|
+
| --- | --- | --- |
|
|
1147
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1148
|
+
| subscriptionPeriod | <code>Number</code> | The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days) |
|
|
1149
|
+
| subscriptionPrice | <code>Number</code> | The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat (1-2500) |
|
|
1150
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1151
|
+
|
|
1152
|
+
<a name="TelegramBot+editChatSubscriptionInviteLink"></a>
|
|
1153
|
+
|
|
1154
|
+
### telegramBot.editChatSubscriptionInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
|
|
1155
|
+
Use this method to edit a subscription invite link created by the bot.
|
|
1156
|
+
|
|
1157
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1158
|
+
**Returns**: <code>Promise</code> - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
|
|
1159
|
+
**See**: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
|
|
1160
|
+
|
|
1161
|
+
| Param | Type | Description |
|
|
1162
|
+
| --- | --- | --- |
|
|
1163
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1164
|
+
| inviteLink | <code>String</code> | The invite link to edit |
|
|
1165
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1166
|
+
|
|
1167
|
+
<a name="TelegramBot+revokeChatInviteLink"></a>
|
|
1168
|
+
|
|
1169
|
+
### telegramBot.revokeChatInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
|
|
1170
|
+
Use this method to revoke an invite link created by the bot.
|
|
1171
|
+
|
|
1172
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1173
|
+
**Returns**: <code>Promise</code> - The revoked invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
|
|
1174
|
+
**See**: https://core.telegram.org/bots/api#revokechatinvitelink
|
|
1175
|
+
|
|
1176
|
+
| Param | Type | Description |
|
|
1177
|
+
| --- | --- | --- |
|
|
1178
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1179
|
+
| inviteLink | <code>String</code> | The invite link to revoke |
|
|
1180
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1181
|
+
|
|
1182
|
+
<a name="TelegramBot+approveChatJoinRequest"></a>
|
|
1183
|
+
|
|
1184
|
+
### telegramBot.approveChatJoinRequest(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
1185
|
+
Use this method to approve a chat join request.
|
|
1186
|
+
|
|
1187
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1188
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1189
|
+
**See**: https://core.telegram.org/bots/api#approvechatjoinrequest
|
|
1190
|
+
|
|
1191
|
+
| Param | Type | Description |
|
|
1192
|
+
| --- | --- | --- |
|
|
1193
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1194
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1195
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1196
|
+
|
|
1197
|
+
<a name="TelegramBot+declineChatJoinRequest"></a>
|
|
1198
|
+
|
|
1199
|
+
### telegramBot.declineChatJoinRequest(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
1200
|
+
Use this method to decline a chat join request.
|
|
1201
|
+
|
|
1202
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1203
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1204
|
+
**See**: https://core.telegram.org/bots/api#declinechatjoinrequest
|
|
1205
|
+
|
|
1206
|
+
| Param | Type | Description |
|
|
1207
|
+
| --- | --- | --- |
|
|
1208
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1209
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1210
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1211
|
+
|
|
1212
|
+
<a name="TelegramBot+setChatPhoto"></a>
|
|
1213
|
+
|
|
1214
|
+
### telegramBot.setChatPhoto(chatId, photo, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
1215
|
+
Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.
|
|
1216
|
+
|
|
1217
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1218
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1219
|
+
**See**: https://core.telegram.org/bots/api#setchatphoto
|
|
1220
|
+
|
|
1221
|
+
| Param | Type | Description |
|
|
1222
|
+
| --- | --- | --- |
|
|
1223
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1224
|
+
| photo | <code>stream.Stream</code> \| <code>Buffer</code> | A file path or a Stream. |
|
|
1225
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1226
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
1227
|
+
|
|
1228
|
+
<a name="TelegramBot+deleteChatPhoto"></a>
|
|
1229
|
+
|
|
1230
|
+
### telegramBot.deleteChatPhoto(chatId, [options]) ⇒ <code>Promise</code>
|
|
1231
|
+
Use this method to delete a chat photo. **Photos can't be changed for private chats**.
|
|
1232
|
+
|
|
1233
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1234
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1235
|
+
**See**: https://core.telegram.org/bots/api#deletechatphoto
|
|
1236
|
+
|
|
1237
|
+
| Param | Type | Description |
|
|
1238
|
+
| --- | --- | --- |
|
|
1239
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1240
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1241
|
+
|
|
1242
|
+
<a name="TelegramBot+setChatTitle"></a>
|
|
1243
|
+
|
|
1244
|
+
### telegramBot.setChatTitle(chatId, title, [options]) ⇒ <code>Promise</code>
|
|
1245
|
+
Use this method to change the title of a chat. **Titles can't be changed for private chats**.
|
|
1246
|
+
|
|
1247
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1248
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1249
|
+
**See**: https://core.telegram.org/bots/api#setchattitle
|
|
1250
|
+
|
|
1251
|
+
| Param | Type | Description |
|
|
1252
|
+
| --- | --- | --- |
|
|
1253
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1254
|
+
| title | <code>String</code> | New chat title, 1-255 characters |
|
|
1255
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1256
|
+
|
|
1257
|
+
<a name="TelegramBot+setChatDescription"></a>
|
|
1258
|
+
|
|
1259
|
+
### telegramBot.setChatDescription(chatId, description, [options]) ⇒ <code>Promise</code>
|
|
1260
|
+
Use this method to change the description of a group, a supergroup or a channel.
|
|
1261
|
+
|
|
1262
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1263
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1264
|
+
**See**: https://core.telegram.org/bots/api#setchatdescription
|
|
1265
|
+
|
|
1266
|
+
| Param | Type | Description |
|
|
1267
|
+
| --- | --- | --- |
|
|
1268
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1269
|
+
| description | <code>String</code> | New chat title, 0-255 characters |
|
|
1270
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1271
|
+
|
|
1272
|
+
<a name="TelegramBot+pinChatMessage"></a>
|
|
1273
|
+
|
|
1274
|
+
### telegramBot.pinChatMessage(chatId, messageId, [options]) ⇒ <code>Promise</code>
|
|
1275
|
+
Use this method to pin a message in a supergroup.
|
|
1276
|
+
|
|
1277
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1278
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1279
|
+
**See**: https://core.telegram.org/bots/api#pinchatmessage
|
|
1280
|
+
|
|
1281
|
+
| Param | Type | Description |
|
|
1282
|
+
| --- | --- | --- |
|
|
1283
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1284
|
+
| messageId | <code>Number</code> | Identifier of a message to pin |
|
|
1285
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1286
|
+
|
|
1287
|
+
<a name="TelegramBot+unpinChatMessage"></a>
|
|
1288
|
+
|
|
1289
|
+
### telegramBot.unpinChatMessage(chatId, [options]) ⇒ <code>Promise</code>
|
|
1290
|
+
Use this method to remove a message from the list of pinned messages in a chat
|
|
1291
|
+
|
|
1292
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1293
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1294
|
+
**See**: https://core.telegram.org/bots/api#unpinchatmessage
|
|
1295
|
+
|
|
1296
|
+
| Param | Type | Description |
|
|
1297
|
+
| --- | --- | --- |
|
|
1298
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1299
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1300
|
+
|
|
1301
|
+
<a name="TelegramBot+unpinAllChatMessages"></a>
|
|
1302
|
+
|
|
1303
|
+
### telegramBot.unpinAllChatMessages(chatId, [options]) ⇒ <code>Promise</code>
|
|
1304
|
+
Use this method to clear the list of pinned messages in a chat.
|
|
1305
|
+
|
|
1306
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1307
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1308
|
+
**See**: https://core.telegram.org/bots/api#unpinallchatmessages
|
|
1309
|
+
|
|
1310
|
+
| Param | Type | Description |
|
|
1311
|
+
| --- | --- | --- |
|
|
1312
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1313
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1314
|
+
|
|
1315
|
+
<a name="TelegramBot+leaveChat"></a>
|
|
1316
|
+
|
|
1317
|
+
### telegramBot.leaveChat(chatId, [options]) ⇒ <code>Promise</code>
|
|
1318
|
+
Use this method for your bot to leave a group, supergroup or channel
|
|
1319
|
+
|
|
1320
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1321
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1322
|
+
**See**: https://core.telegram.org/bots/api#leavechat
|
|
1323
|
+
|
|
1324
|
+
| Param | Type | Description |
|
|
1325
|
+
| --- | --- | --- |
|
|
1326
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1327
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1328
|
+
|
|
1329
|
+
<a name="TelegramBot+getChat"></a>
|
|
1330
|
+
|
|
1331
|
+
### telegramBot.getChat(chatId, [options]) ⇒ <code>Promise</code>
|
|
1332
|
+
Use this method to get up to date information about the chat
|
|
1333
|
+
|
|
1334
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1335
|
+
**Returns**: <code>Promise</code> - [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success
|
|
1336
|
+
**See**: https://core.telegram.org/bots/api#getchat
|
|
1337
|
+
|
|
1338
|
+
| Param | Type | Description |
|
|
1339
|
+
| --- | --- | --- |
|
|
1340
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) or channel |
|
|
1341
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1342
|
+
|
|
1343
|
+
<a name="TelegramBot+getChatAdministrators"></a>
|
|
1344
|
+
|
|
1345
|
+
### telegramBot.getChatAdministrators(chatId, [options]) ⇒ <code>Promise</code>
|
|
1346
|
+
Use this method to get a list of administrators in a chat
|
|
1347
|
+
|
|
1348
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1349
|
+
**Returns**: <code>Promise</code> - On success, returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects that contains information about all chat administrators except other bots.
|
|
1350
|
+
**See**: https://core.telegram.org/bots/api#getchatadministrators
|
|
1351
|
+
|
|
1352
|
+
| Param | Type | Description |
|
|
1353
|
+
| --- | --- | --- |
|
|
1354
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
|
|
1355
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1356
|
+
|
|
1357
|
+
<a name="TelegramBot+getChatMemberCount"></a>
|
|
1358
|
+
|
|
1359
|
+
### telegramBot.getChatMemberCount(chatId, [options]) ⇒ <code>Promise</code>
|
|
1360
|
+
Use this method to get the number of members in a chat.
|
|
1361
|
+
|
|
1362
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1363
|
+
**Returns**: <code>Promise</code> - Int on success
|
|
1364
|
+
**See**: https://core.telegram.org/bots/api#getchatmembercount
|
|
1365
|
+
|
|
1366
|
+
| Param | Type | Description |
|
|
1367
|
+
| --- | --- | --- |
|
|
1368
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
|
|
1369
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1370
|
+
|
|
1371
|
+
<a name="TelegramBot+getChatMember"></a>
|
|
1372
|
+
|
|
1373
|
+
### telegramBot.getChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
1374
|
+
Use this method to get information about a member of a chat.
|
|
1375
|
+
|
|
1376
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1377
|
+
**Returns**: <code>Promise</code> - [ChatMember](https://core.telegram.org/bots/api#chatmember) object on success
|
|
1378
|
+
**See**: https://core.telegram.org/bots/api#getchatmember
|
|
1379
|
+
|
|
1380
|
+
| Param | Type | Description |
|
|
1381
|
+
| --- | --- | --- |
|
|
1382
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
|
|
1383
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1384
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1385
|
+
|
|
1386
|
+
<a name="TelegramBot+setChatStickerSet"></a>
|
|
1387
|
+
|
|
1388
|
+
### telegramBot.setChatStickerSet(chatId, stickerSetName, [options]) ⇒ <code>Promise</code>
|
|
1389
|
+
Use this method to set a new group sticker set for a supergroup.
|
|
1390
|
+
|
|
1391
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1392
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1393
|
+
**See**: https://core.telegram.org/bots/api#setchatstickerset
|
|
1394
|
+
|
|
1395
|
+
| Param | Type | Description |
|
|
1396
|
+
| --- | --- | --- |
|
|
1397
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1398
|
+
| stickerSetName | <code>String</code> | Name of the sticker set to be set as the group sticker set |
|
|
1399
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1400
|
+
|
|
1401
|
+
<a name="TelegramBot+deleteChatStickerSet"></a>
|
|
1402
|
+
|
|
1403
|
+
### telegramBot.deleteChatStickerSet(chatId, [options]) ⇒ <code>Promise</code>
|
|
1404
|
+
Use this method to delete a group sticker set from a supergroup.
|
|
1405
|
+
|
|
1406
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1407
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1408
|
+
**See**: https://core.telegram.org/bots/api#deletechatstickerset
|
|
1409
|
+
|
|
1410
|
+
| Param | Type | Description |
|
|
1411
|
+
| --- | --- | --- |
|
|
1412
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1413
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1414
|
+
|
|
1415
|
+
<a name="TelegramBot+getForumTopicIconStickers"></a>
|
|
1416
|
+
|
|
1417
|
+
### telegramBot.getForumTopicIconStickers(chatId, [options]) ⇒ <code>Promise</code>
|
|
1418
|
+
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
|
|
1419
|
+
|
|
1420
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1421
|
+
**Returns**: <code>Promise</code> - Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects
|
|
1422
|
+
**See**: https://core.telegram.org/bots/api#getforumtopiciconstickers
|
|
1423
|
+
|
|
1424
|
+
| Param | Type | Description |
|
|
1425
|
+
| --- | --- | --- |
|
|
1426
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1427
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1428
|
+
|
|
1429
|
+
<a name="TelegramBot+createForumTopic"></a>
|
|
1430
|
+
|
|
1431
|
+
### telegramBot.createForumTopic(chatId, name, [options])
|
|
1432
|
+
Use this method to create a topic in a forum supergroup chat.
|
|
1433
|
+
|
|
1434
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1435
|
+
**See**: https://core.telegram.org/bots/api#createforumtopic
|
|
1436
|
+
|
|
1437
|
+
| Param | Type | Description |
|
|
1438
|
+
| --- | --- | --- |
|
|
1439
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1440
|
+
| name | <code>String</code> | Topic name, 1-128 characters |
|
|
1441
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1442
|
+
|
|
1443
|
+
<a name="TelegramBot+editForumTopic"></a>
|
|
1444
|
+
|
|
1445
|
+
### telegramBot.editForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
|
|
1446
|
+
Use this method to edit name and icon of a topic in a forum supergroup chat.
|
|
1447
|
+
|
|
1448
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1449
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1450
|
+
**See**: https://core.telegram.org/bots/api#editforumtopic
|
|
1451
|
+
|
|
1452
|
+
| Param | Type | Description |
|
|
1453
|
+
| --- | --- | --- |
|
|
1454
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1455
|
+
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
|
|
1456
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1457
|
+
|
|
1458
|
+
<a name="TelegramBot+closeForumTopic"></a>
|
|
1459
|
+
|
|
1460
|
+
### telegramBot.closeForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
|
|
1461
|
+
Use this method to close an open topic in a forum supergroup chat.
|
|
1462
|
+
|
|
1463
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1464
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1465
|
+
**See**: https://core.telegram.org/bots/api#closeforumtopic
|
|
1466
|
+
|
|
1467
|
+
| Param | Type | Description |
|
|
1468
|
+
| --- | --- | --- |
|
|
1469
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1470
|
+
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
|
|
1471
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1472
|
+
|
|
1473
|
+
<a name="TelegramBot+reopenForumTopic"></a>
|
|
1474
|
+
|
|
1475
|
+
### telegramBot.reopenForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
|
|
1476
|
+
Use this method to reopen a closed topic in a forum supergroup chat.
|
|
1477
|
+
|
|
1478
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1479
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1480
|
+
**See**: https://core.telegram.org/bots/api#reopenforumtopic
|
|
1481
|
+
|
|
1482
|
+
| Param | Type | Description |
|
|
1483
|
+
| --- | --- | --- |
|
|
1484
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1485
|
+
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
|
|
1486
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1487
|
+
|
|
1488
|
+
<a name="TelegramBot+deleteForumTopic"></a>
|
|
1489
|
+
|
|
1490
|
+
### telegramBot.deleteForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
|
|
1491
|
+
Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
|
|
1492
|
+
|
|
1493
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1494
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1495
|
+
**See**: https://core.telegram.org/bots/api#deleteforumtopic
|
|
1496
|
+
|
|
1497
|
+
| Param | Type | Description |
|
|
1498
|
+
| --- | --- | --- |
|
|
1499
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1500
|
+
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
|
|
1501
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1502
|
+
|
|
1503
|
+
<a name="TelegramBot+unpinAllForumTopicMessages"></a>
|
|
1504
|
+
|
|
1505
|
+
### telegramBot.unpinAllForumTopicMessages(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
|
|
1506
|
+
Use this method to clear the list of pinned messages in a forum topic.
|
|
1507
|
+
|
|
1508
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1509
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1510
|
+
**See**: https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
|
1511
|
+
|
|
1512
|
+
| Param | Type | Description |
|
|
1513
|
+
| --- | --- | --- |
|
|
1514
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1515
|
+
| messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
|
|
1516
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1517
|
+
|
|
1518
|
+
<a name="TelegramBot+editGeneralForumTopic"></a>
|
|
1519
|
+
|
|
1520
|
+
### telegramBot.editGeneralForumTopic(chatId, name, [options]) ⇒ <code>Promise</code>
|
|
1521
|
+
Use this method to edit the name of the 'General' topic in a forum supergroup chat.
|
|
1522
|
+
|
|
1523
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1524
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1525
|
+
**See**: https://core.telegram.org/bots/api#editgeneralforumtopic
|
|
1526
|
+
|
|
1527
|
+
| Param | Type | Description |
|
|
1528
|
+
| --- | --- | --- |
|
|
1529
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1530
|
+
| name | <code>String</code> | New topic name, 1-128 characters |
|
|
1531
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1532
|
+
|
|
1533
|
+
<a name="TelegramBot+closeGeneralForumTopic"></a>
|
|
1534
|
+
|
|
1535
|
+
### telegramBot.closeGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
|
|
1536
|
+
Use this method to close an open 'General' topic in a forum supergroup chat.
|
|
1537
|
+
|
|
1538
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1539
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1540
|
+
**See**: https://core.telegram.org/bots/api#closegeneralforumtopic
|
|
1541
|
+
|
|
1542
|
+
| Param | Type | Description |
|
|
1543
|
+
| --- | --- | --- |
|
|
1544
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1545
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1546
|
+
|
|
1547
|
+
<a name="TelegramBot+reopenGeneralForumTopic"></a>
|
|
1548
|
+
|
|
1549
|
+
### telegramBot.reopenGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
|
|
1550
|
+
Use this method to reopen a closed 'General' topic in a forum supergroup chat.
|
|
1551
|
+
|
|
1552
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1553
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1554
|
+
**See**: https://core.telegram.org/bots/api#reopengeneralforumtopic
|
|
1555
|
+
|
|
1556
|
+
| Param | Type | Description |
|
|
1557
|
+
| --- | --- | --- |
|
|
1558
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1559
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1560
|
+
|
|
1561
|
+
<a name="TelegramBot+hideGeneralForumTopic"></a>
|
|
1562
|
+
|
|
1563
|
+
### telegramBot.hideGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
|
|
1564
|
+
Use this method to hide the 'General' topic in a forum supergroup chat.
|
|
1565
|
+
|
|
1566
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1567
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1568
|
+
**See**: https://core.telegram.org/bots/api#hidegeneralforumtopic
|
|
1569
|
+
|
|
1570
|
+
| Param | Type | Description |
|
|
1571
|
+
| --- | --- | --- |
|
|
1572
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1573
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1574
|
+
|
|
1575
|
+
<a name="TelegramBot+unhideGeneralForumTopic"></a>
|
|
1576
|
+
|
|
1577
|
+
### telegramBot.unhideGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
|
|
1578
|
+
Use this method to unhide the 'General' topic in a forum supergroup chat.
|
|
1579
|
+
|
|
1580
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1581
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1582
|
+
**See**: https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
|
1583
|
+
|
|
1584
|
+
| Param | Type | Description |
|
|
1585
|
+
| --- | --- | --- |
|
|
1586
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1587
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1588
|
+
|
|
1589
|
+
<a name="TelegramBot+unpinAllGeneralForumTopicMessages"></a>
|
|
1590
|
+
|
|
1591
|
+
### telegramBot.unpinAllGeneralForumTopicMessages(chatId, [options]) ⇒ <code>Promise</code>
|
|
1592
|
+
Use this method to clear the list of pinned messages in a General forum topic.
|
|
1593
|
+
|
|
1594
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1595
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1596
|
+
**See**: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
|
|
1597
|
+
|
|
1598
|
+
| Param | Type | Description |
|
|
1599
|
+
| --- | --- | --- |
|
|
1600
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
|
|
1601
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1602
|
+
|
|
1603
|
+
<a name="TelegramBot+answerCallbackQuery"></a>
|
|
1604
|
+
|
|
1605
|
+
### telegramBot.answerCallbackQuery(callbackQueryId, [options]) ⇒ <code>Promise</code>
|
|
1606
|
+
Use this method to send answers to callback queries sent from
|
|
1607
|
+
|
|
1608
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1609
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1610
|
+
**See**: https://core.telegram.org/bots/api#answercallbackquery
|
|
1611
|
+
|
|
1612
|
+
| Param | Type | Description |
|
|
1613
|
+
| --- | --- | --- |
|
|
1614
|
+
| callbackQueryId | <code>String</code> | Unique identifier for the query to be answered |
|
|
1615
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1616
|
+
|
|
1617
|
+
<a name="TelegramBot+savePreparedInlineMessage"></a>
|
|
1618
|
+
|
|
1619
|
+
### telegramBot.savePreparedInlineMessage(userId, result, [options]) ⇒ <code>Promise</code>
|
|
1620
|
+
Use this method to stores a message that can be sent by a user of a Mini App.
|
|
1621
|
+
|
|
1622
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1623
|
+
**Returns**: <code>Promise</code> - On success, returns a [PreparedInlineMessage](https://core.telegram.org/bots/api#preparedinlinemessage) object.
|
|
1624
|
+
**See**: https://core.telegram.org/bots/api#savepreparedinlinemessage
|
|
1625
|
+
|
|
1626
|
+
| Param | Type | Description |
|
|
1627
|
+
| --- | --- | --- |
|
|
1628
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1629
|
+
| result | <code>InlineQueryResult</code> | object that represents one result of an inline query |
|
|
1630
|
+
| [options] | <code>Object</code> | Optional form data to include in the request |
|
|
1631
|
+
|
|
1632
|
+
<a name="TelegramBot+getUserChatBoosts"></a>
|
|
1633
|
+
|
|
1634
|
+
### telegramBot.getUserChatBoosts(chatId, userId, [options]) ⇒ <code>Promise</code>
|
|
1635
|
+
Use this method to get the list of boosts added to a chat by a use.
|
|
1636
|
+
|
|
1637
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1638
|
+
**Returns**: <code>Promise</code> - On success, returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object
|
|
1639
|
+
**See**: https://core.telegram.org/bots/api#getuserchatboosts
|
|
1640
|
+
|
|
1641
|
+
| Param | Type | Description |
|
|
1642
|
+
| --- | --- | --- |
|
|
1643
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
|
|
1644
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
1645
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1646
|
+
|
|
1647
|
+
<a name="TelegramBot+getBusinessConnection"></a>
|
|
1648
|
+
|
|
1649
|
+
### telegramBot.getBusinessConnection(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
|
1650
|
+
Use this method to get information about the connection of the bot with a business account
|
|
1651
|
+
|
|
1652
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1653
|
+
**Returns**: <code>Promise</code> - On success, returns [BusinessConnection](https://core.telegram.org/bots/api#businessconnection) object
|
|
1654
|
+
**See**: https://core.telegram.org/bots/api#getbusinessconnection
|
|
1655
|
+
|
|
1656
|
+
| Param | Type | Description |
|
|
1657
|
+
| --- | --- | --- |
|
|
1658
|
+
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
|
|
1659
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1660
|
+
|
|
1661
|
+
<a name="TelegramBot+setMyCommands"></a>
|
|
1662
|
+
|
|
1663
|
+
### telegramBot.setMyCommands(commands, [options]) ⇒ <code>Promise</code>
|
|
1664
|
+
Use this method to change the list of the bot's commands.
|
|
1665
|
+
|
|
1666
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1667
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1668
|
+
**See**: https://core.telegram.org/bots/api#setmycommands
|
|
1669
|
+
|
|
1670
|
+
| Param | Type | Description |
|
|
1671
|
+
| --- | --- | --- |
|
|
1672
|
+
| commands | <code>Array</code> | List of bot commands to be set as the list of the [bot's commands](https://core.telegram.org/bots/api#botcommand). At most 100 commands can be specified. |
|
|
1673
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1674
|
+
|
|
1675
|
+
<a name="TelegramBot+deleteMyCommands"></a>
|
|
1676
|
+
|
|
1677
|
+
### telegramBot.deleteMyCommands([options]) ⇒ <code>Promise</code>
|
|
1678
|
+
Use this method to delete the list of the bot's commands for the given scope and user language.
|
|
9
1679
|
After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.
|
|
1680
|
+
|
|
1681
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1682
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1683
|
+
**See**: https://core.telegram.org/bots/api#deletemycommands
|
|
1684
|
+
|
|
1685
|
+
| Param | Type | Description |
|
|
1686
|
+
| --- | --- | --- |
|
|
1687
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1688
|
+
|
|
1689
|
+
<a name="TelegramBot+getMyCommands"></a>
|
|
1690
|
+
|
|
1691
|
+
### telegramBot.getMyCommands([options]) ⇒ <code>Promise</code>
|
|
1692
|
+
Use this method to get the current list of the bot's commands for the given scope and user language.
|
|
1693
|
+
|
|
1694
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1695
|
+
**Returns**: <code>Promise</code> - Array of [BotCommand](https://core.telegram.org/bots/api#botcommand) on success. If commands aren't set, an empty list is returned.
|
|
1696
|
+
**See**: https://core.telegram.org/bots/api#getmycommands
|
|
1697
|
+
|
|
1698
|
+
| Param | Type | Description |
|
|
1699
|
+
| --- | --- | --- |
|
|
1700
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1701
|
+
|
|
1702
|
+
<a name="TelegramBot+setMyName"></a>
|
|
1703
|
+
|
|
1704
|
+
### telegramBot.setMyName([options]) ⇒ <code>Promise</code>
|
|
1705
|
+
Use this method to change the bot's name.
|
|
1706
|
+
|
|
1707
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1708
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1709
|
+
**See**: https://core.telegram.org/bots/api#setmyname
|
|
1710
|
+
|
|
1711
|
+
| Param | Type | Description |
|
|
1712
|
+
| --- | --- | --- |
|
|
1713
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1714
|
+
|
|
1715
|
+
<a name="TelegramBot+getMyName"></a>
|
|
1716
|
+
|
|
1717
|
+
### telegramBot.getMyName([options]) ⇒ <code>Promise</code>
|
|
1718
|
+
Use this method to get the current bot name for the given user language.
|
|
1719
|
+
|
|
1720
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1721
|
+
**Returns**: <code>Promise</code> - [BotName](https://core.telegram.org/bots/api#botname) on success
|
|
1722
|
+
**See**: https://core.telegram.org/bots/api#getmyname
|
|
1723
|
+
|
|
1724
|
+
| Param | Type | Description |
|
|
1725
|
+
| --- | --- | --- |
|
|
1726
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1727
|
+
|
|
1728
|
+
<a name="TelegramBot+setMyDescription"></a>
|
|
1729
|
+
|
|
1730
|
+
### telegramBot.setMyDescription([options]) ⇒ <code>Promise</code>
|
|
1731
|
+
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
|
|
1732
|
+
|
|
1733
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1734
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1735
|
+
**See**: https://core.telegram.org/bots/api#setmydescription
|
|
1736
|
+
|
|
1737
|
+
| Param | Type | Description |
|
|
1738
|
+
| --- | --- | --- |
|
|
1739
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1740
|
+
|
|
1741
|
+
<a name="TelegramBot+getMyDescription"></a>
|
|
1742
|
+
|
|
1743
|
+
### telegramBot.getMyDescription([options]) ⇒ <code>Promise</code>
|
|
1744
|
+
Use this method to get the current bot description for the given user language.
|
|
1745
|
+
|
|
1746
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1747
|
+
**Returns**: <code>Promise</code> - Returns [BotDescription](https://core.telegram.org/bots/api#botdescription) on success.
|
|
1748
|
+
**See**: https://core.telegram.org/bots/api#getmydescription
|
|
1749
|
+
|
|
1750
|
+
| Param | Type | Description |
|
|
1751
|
+
| --- | --- | --- |
|
|
1752
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1753
|
+
|
|
1754
|
+
<a name="TelegramBot+setMyShortDescription"></a>
|
|
1755
|
+
|
|
1756
|
+
### telegramBot.setMyShortDescription([options]) ⇒ <code>Promise</code>
|
|
1757
|
+
Use this method to change the bot's short description, which is shown on the bot's profile page
|
|
1758
|
+
|
|
1759
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1760
|
+
**Returns**: <code>Promise</code> - Returns True on success.
|
|
1761
|
+
**See**: https://core.telegram.org/bots/api#setmyshortdescription
|
|
1762
|
+
|
|
1763
|
+
| Param | Type | Description |
|
|
1764
|
+
| --- | --- | --- |
|
|
1765
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1766
|
+
|
|
1767
|
+
<a name="TelegramBot+getMyShortDescription"></a>
|
|
1768
|
+
|
|
1769
|
+
### telegramBot.getMyShortDescription([options]) ⇒ <code>Promise</code>
|
|
1770
|
+
Use this method to get the current bot short description for the given user language.
|
|
1771
|
+
|
|
1772
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1773
|
+
**Returns**: <code>Promise</code> - Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success.
|
|
1774
|
+
**See**: https://core.telegram.org/bots/api#getmyshortdescription
|
|
1775
|
+
|
|
1776
|
+
| Param | Type | Description |
|
|
1777
|
+
| --- | --- | --- |
|
|
1778
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1779
|
+
|
|
1780
|
+
<a name="TelegramBot+setChatMenuButton"></a>
|
|
1781
|
+
|
|
1782
|
+
### telegramBot.setChatMenuButton([options]) ⇒ <code>Promise</code>
|
|
1783
|
+
Use this method to change the bot's menu button in a private chat, or the default menu button.
|
|
1784
|
+
|
|
1785
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1786
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1787
|
+
**See**: https://core.telegram.org/bots/api#setchatmenubutton
|
|
1788
|
+
|
|
1789
|
+
| Param | Type | Description |
|
|
1790
|
+
| --- | --- | --- |
|
|
1791
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1792
|
+
|
|
1793
|
+
<a name="TelegramBot+getChatMenuButton"></a>
|
|
1794
|
+
|
|
1795
|
+
### telegramBot.getChatMenuButton([options]) ⇒ <code>Promise</code>
|
|
1796
|
+
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
|
|
1797
|
+
|
|
1798
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1799
|
+
**Returns**: <code>Promise</code> - [MenuButton](https://core.telegram.org/bots/api#menubutton) on success
|
|
1800
|
+
**See**: https://core.telegram.org/bots/api#getchatmenubutton
|
|
1801
|
+
|
|
1802
|
+
| Param | Type | Description |
|
|
1803
|
+
| --- | --- | --- |
|
|
1804
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1805
|
+
|
|
1806
|
+
<a name="TelegramBot+setMyDefaultAdministratorRights"></a>
|
|
1807
|
+
|
|
1808
|
+
### telegramBot.setMyDefaultAdministratorRights([options]) ⇒ <code>Promise</code>
|
|
1809
|
+
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
|
|
1810
|
+
|
|
1811
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1812
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1813
|
+
**See**: https://core.telegram.org/bots/api#getchatmenubutton
|
|
1814
|
+
|
|
1815
|
+
| Param | Type | Description |
|
|
1816
|
+
| --- | --- | --- |
|
|
1817
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1818
|
+
|
|
1819
|
+
<a name="TelegramBot+getMyDefaultAdministratorRights"></a>
|
|
1820
|
+
|
|
1821
|
+
### telegramBot.getMyDefaultAdministratorRights([options]) ⇒ <code>Promise</code>
|
|
1822
|
+
Use this method to get the current default administrator rights of the bot.
|
|
1823
|
+
|
|
1824
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1825
|
+
**Returns**: <code>Promise</code> - [ChatAdministratorRights](https://core.telegram.org/bots/api#chatadministratorrights) on success
|
|
1826
|
+
**See**: https://core.telegram.org/bots/api#getmydefaultadministratorrights
|
|
1827
|
+
|
|
1828
|
+
| Param | Type | Description |
|
|
1829
|
+
| --- | --- | --- |
|
|
1830
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1831
|
+
|
|
1832
|
+
<a name="TelegramBot+editMessageText"></a>
|
|
1833
|
+
|
|
1834
|
+
### telegramBot.editMessageText(text, [options]) ⇒ <code>Promise</code>
|
|
1835
|
+
Use this method to edit text or [game](https://core.telegram.org/bots/api#games) messages sent by the bot or via the bot (for inline bots).
|
|
1836
|
+
|
|
1837
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1838
|
+
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
|
|
1839
|
+
**See**: https://core.telegram.org/bots/api#editmessagetext
|
|
1840
|
+
|
|
1841
|
+
| Param | Type | Description |
|
|
1842
|
+
| --- | --- | --- |
|
|
1843
|
+
| text | <code>String</code> | New text of the message |
|
|
1844
|
+
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
|
1845
|
+
|
|
1846
|
+
<a name="TelegramBot+editMessageCaption"></a>
|
|
1847
|
+
|
|
1848
|
+
### telegramBot.editMessageCaption(caption, [options]) ⇒ <code>Promise</code>
|
|
1849
|
+
Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
|
|
1850
|
+
|
|
1851
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1852
|
+
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
|
|
1853
|
+
**See**: https://core.telegram.org/bots/api#editmessagecaption
|
|
1854
|
+
|
|
1855
|
+
| Param | Type | Description |
|
|
1856
|
+
| --- | --- | --- |
|
|
1857
|
+
| caption | <code>String</code> | New caption of the message |
|
|
1858
|
+
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
|
1859
|
+
|
|
1860
|
+
<a name="TelegramBot+editMessageMedia"></a>
|
|
1861
|
+
|
|
1862
|
+
### telegramBot.editMessageMedia(media, [options]) ⇒ <code>Promise</code>
|
|
1863
|
+
Use this method to edit animation, audio, document, photo, or video messages.
|
|
1864
|
+
|
|
1865
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1866
|
+
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
|
|
1867
|
+
**See**: https://core.telegram.org/bots/api#editmessagemedia
|
|
1868
|
+
|
|
1869
|
+
| Param | Type | Description |
|
|
1870
|
+
| --- | --- | --- |
|
|
1871
|
+
| media | <code>Object</code> | A JSON-serialized object for a new media content of the message |
|
|
1872
|
+
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
|
1873
|
+
|
|
1874
|
+
<a name="TelegramBot+editMessageChecklist"></a>
|
|
1875
|
+
|
|
1876
|
+
### telegramBot.editMessageChecklist(businessConnectionId, chatId, messageId, checklist, [options]) ⇒ <code>Promise</code>
|
|
1877
|
+
Use this method to edit a checklist on behalf of a business connection.
|
|
1878
|
+
|
|
1879
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1880
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
|
|
1881
|
+
**See**: https://core.telegram.org/bots/api#editmessagechecklist
|
|
1882
|
+
|
|
1883
|
+
| Param | Type | Description |
|
|
1884
|
+
| --- | --- | --- |
|
|
1885
|
+
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the target business connection |
|
|
1886
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1887
|
+
| messageId | <code>Number</code> | Unique identifier for the target message |
|
|
1888
|
+
| checklist | <code>Object</code> | A JSON-serialized object for the new checklist |
|
|
1889
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1890
|
+
|
|
1891
|
+
<a name="TelegramBot+editMessageReplyMarkup"></a>
|
|
1892
|
+
|
|
1893
|
+
### telegramBot.editMessageReplyMarkup(replyMarkup, [options]) ⇒ <code>Promise</code>
|
|
1894
|
+
Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
|
|
1895
|
+
|
|
1896
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1897
|
+
**Returns**: <code>Promise</code> - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
|
|
1898
|
+
**See**: https://core.telegram.org/bots/api#editmessagetext
|
|
1899
|
+
|
|
1900
|
+
| Param | Type | Description |
|
|
1901
|
+
| --- | --- | --- |
|
|
1902
|
+
| replyMarkup | <code>Object</code> | A JSON-serialized object for an inline keyboard. |
|
|
1903
|
+
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
|
1904
|
+
|
|
1905
|
+
<a name="TelegramBot+stopPoll"></a>
|
|
1906
|
+
|
|
1907
|
+
### telegramBot.stopPoll(chatId, pollId, [options]) ⇒ <code>Promise</code>
|
|
1908
|
+
Use this method to stop a poll which was sent by the bot.
|
|
1909
|
+
|
|
1910
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1911
|
+
**Returns**: <code>Promise</code> - On success, the stopped [Poll](https://core.telegram.org/bots/api#poll) is returned
|
|
1912
|
+
**See**: https://core.telegram.org/bots/api#stoppoll
|
|
1913
|
+
|
|
1914
|
+
| Param | Type | Description |
|
|
1915
|
+
| --- | --- | --- |
|
|
1916
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
|
|
1917
|
+
| pollId | <code>Number</code> | Identifier of the original message with the poll |
|
|
1918
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1919
|
+
|
|
1920
|
+
<a name="TelegramBot+sendSticker"></a>
|
|
1921
|
+
|
|
1922
|
+
### telegramBot.sendSticker(chatId, sticker, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
1923
|
+
Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
|
|
1924
|
+
|
|
1925
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1926
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
|
|
1927
|
+
**See**: https://core.telegram.org/bots/api#sendsticker
|
|
1928
|
+
|
|
1929
|
+
| Param | Type | Description |
|
|
1930
|
+
| --- | --- | --- |
|
|
1931
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
1932
|
+
| sticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. Stickers are WebP format files. |
|
|
1933
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1934
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
1935
|
+
|
|
1936
|
+
<a name="TelegramBot+getStickerSet"></a>
|
|
1937
|
+
|
|
1938
|
+
### telegramBot.getStickerSet(name, [options]) ⇒ <code>Promise</code>
|
|
1939
|
+
Use this method to get a sticker set.
|
|
1940
|
+
|
|
1941
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1942
|
+
**Returns**: <code>Promise</code> - On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned
|
|
1943
|
+
**See**: https://core.telegram.org/bots/api#getstickerset
|
|
1944
|
+
|
|
1945
|
+
| Param | Type | Description |
|
|
1946
|
+
| --- | --- | --- |
|
|
1947
|
+
| name | <code>String</code> | Name of the sticker set |
|
|
1948
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1949
|
+
|
|
1950
|
+
<a name="TelegramBot+getCustomEmojiStickers"></a>
|
|
1951
|
+
|
|
1952
|
+
### telegramBot.getCustomEmojiStickers(custom_emoji_ids, [options]) ⇒ <code>Promise</code>
|
|
1953
|
+
Use this method to get information about custom emoji stickers by their identifiers.
|
|
1954
|
+
|
|
1955
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1956
|
+
**Returns**: <code>Promise</code> - Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.
|
|
1957
|
+
**See**: https://core.telegram.org/bots/api#getcustomemojistickers
|
|
1958
|
+
|
|
1959
|
+
| Param | Type | Description |
|
|
1960
|
+
| --- | --- | --- |
|
|
1961
|
+
| custom_emoji_ids | <code>Array</code> | List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. |
|
|
1962
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1963
|
+
|
|
1964
|
+
<a name="TelegramBot+uploadStickerFile"></a>
|
|
1965
|
+
|
|
1966
|
+
### telegramBot.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
1967
|
+
Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
|
|
1968
|
+
|
|
1969
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1970
|
+
**Returns**: <code>Promise</code> - On success, a [File](https://core.telegram.org/bots/api#file) object is returned
|
|
1971
|
+
**See**: https://core.telegram.org/bots/api#uploadstickerfile
|
|
1972
|
+
|
|
1973
|
+
| Param | Type | Default | Description |
|
|
1974
|
+
| --- | --- | --- | --- |
|
|
1975
|
+
| userId | <code>Number</code> | | User identifier of sticker file owner |
|
|
1976
|
+
| sticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | | A file path or a Stream with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. Can also be a `file_id` previously uploaded. |
|
|
1977
|
+
| stickerFormat | <code>String</code> | <code>static</code> | Allow values: `static`, `animated` or `video` |
|
|
1978
|
+
| [options] | <code>Object</code> | | Additional Telegram query options |
|
|
1979
|
+
| [fileOptions] | <code>Object</code> | | Optional file related meta-data |
|
|
1980
|
+
|
|
1981
|
+
<a name="TelegramBot+createNewStickerSet"></a>
|
|
1982
|
+
|
|
1983
|
+
### telegramBot.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
1984
|
+
Use this method to create new sticker set owned by a user.
|
|
1985
|
+
|
|
1986
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
1987
|
+
**Returns**: <code>Promise</code> - True on success
|
|
1988
|
+
**See**: https://core.telegram.org/bots/api#createnewstickerset
|
|
1989
|
+
|
|
1990
|
+
| Param | Type | Description |
|
|
1991
|
+
| --- | --- | --- |
|
|
1992
|
+
| userId | <code>Number</code> | User identifier of created sticker set owner |
|
|
1993
|
+
| name | <code>String</code> | Short name of sticker set, to be used in `t.me/addstickers/` URLs (e.g., *"animals"*). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in `"_by_<bot_username>"`. `<bot_username>` is case insensitive. 1-64 characters. |
|
|
1994
|
+
| title | <code>String</code> | Sticker set title, 1-64 characters |
|
|
1995
|
+
| pngSticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. |
|
|
1996
|
+
| emojis | <code>String</code> | One or more emoji corresponding to the sticker |
|
|
1997
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
1998
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
1999
|
+
|
|
2000
|
+
<a name="TelegramBot+addStickerToSet"></a>
|
|
2001
|
+
|
|
2002
|
+
### telegramBot.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
2003
|
+
Use this method to add a new sticker to a set created by the bot.
|
|
10
|
-
|
|
11
|
-
|
|
2004
|
+
|
|
2005
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2006
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2007
|
+
**See**: https://core.telegram.org/bots/api#addstickertoset
|
|
2008
|
+
|
|
2009
|
+
| Param | Type | Default | Description |
|
|
2010
|
+
| --- | --- | --- | --- |
|
|
2011
|
+
| userId | <code>Number</code> | | User identifier of sticker set owner |
|
|
2012
|
+
| name | <code>String</code> | | Sticker set name |
|
|
2013
|
+
| sticker | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | | Png image with the sticker (must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px, [TGS animation](https://core.telegram.org/stickers#animated-sticker-requirements) with the sticker or [WEBM video](https://core.telegram.org/stickers#video-sticker-requirements) with the sticker. |
|
|
2014
|
+
| emojis | <code>String</code> | | One or more emoji corresponding to the sticker |
|
|
2015
|
+
| stickerType | <code>String</code> | <code>png_sticker</code> | Allow values: `png_sticker`, `tgs_sticker`, or `webm_sticker`. |
|
|
2016
|
+
| [options] | <code>Object</code> | | Additional Telegram query options |
|
|
2017
|
+
| [fileOptions] | <code>Object</code> | | Optional file related meta-data |
|
|
2018
|
+
|
|
2019
|
+
<a name="TelegramBot+setStickerPositionInSet"></a>
|
|
2020
|
+
|
|
2021
|
+
### telegramBot.setStickerPositionInSet(sticker, position, [options]) ⇒ <code>Promise</code>
|
|
2022
|
+
Use this method to move a sticker in a set created by the bot to a specific position.
|
|
2023
|
+
|
|
2024
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2025
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2026
|
+
**See**: https://core.telegram.org/bots/api#setstickerpositioninset
|
|
2027
|
+
|
|
2028
|
+
| Param | Type | Description |
|
|
2029
|
+
| --- | --- | --- |
|
|
2030
|
+
| sticker | <code>String</code> | File identifier of the sticker |
|
|
2031
|
+
| position | <code>Number</code> | New sticker position in the set, zero-based |
|
|
2032
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2033
|
+
|
|
2034
|
+
<a name="TelegramBot+deleteStickerFromSet"></a>
|
|
2035
|
+
|
|
2036
|
+
### telegramBot.deleteStickerFromSet(sticker, [options]) ⇒ <code>Promise</code>
|
|
2037
|
+
Use this method to delete a sticker from a set created by the bot.
|
|
2038
|
+
|
|
2039
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2040
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2041
|
+
**See**: https://core.telegram.org/bots/api#deletestickerfromset
|
|
2042
|
+
**Todo**
|
|
2043
|
+
|
|
2044
|
+
- [ ] Add tests for this method!
|
|
2045
|
+
|
|
2046
|
+
|
|
2047
|
+
| Param | Type | Description |
|
|
2048
|
+
| --- | --- | --- |
|
|
2049
|
+
| sticker | <code>String</code> | File identifier of the sticker |
|
|
2050
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2051
|
+
|
|
2052
|
+
<a name="TelegramBot+replaceStickerInSet"></a>
|
|
2053
|
+
|
|
2054
|
+
### telegramBot.replaceStickerInSet(user_id, name, sticker, [options]) ⇒ <code>Promise</code>
|
|
2055
|
+
Use this method to replace an existing sticker in a sticker set with a new one
|
|
2056
|
+
|
|
2057
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2058
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2059
|
+
**See**: https://core.telegram.org/bots/api#replacestickerinset
|
|
2060
|
+
**Todo**
|
|
2061
|
+
|
|
2062
|
+
- [ ] Add tests for this method!
|
|
2063
|
+
|
|
2064
|
+
|
|
2065
|
+
| Param | Type | Description |
|
|
2066
|
+
| --- | --- | --- |
|
|
2067
|
+
| user_id | <code>Number</code> | User identifier of the sticker set owner |
|
|
2068
|
+
| name | <code>String</code> | Sticker set name |
|
|
2069
|
+
| sticker | <code>String</code> | File identifier of the sticker |
|
|
2070
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2071
|
+
|
|
2072
|
+
<a name="TelegramBot+setStickerEmojiList"></a>
|
|
2073
|
+
|
|
2074
|
+
### telegramBot.setStickerEmojiList(sticker, emojiList, [options]) ⇒ <code>Promise</code>
|
|
2075
|
+
Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
|
|
2076
|
+
|
|
2077
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2078
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2079
|
+
**See**: https://core.telegram.org/bots/api#setstickeremojilist
|
|
2080
|
+
|
|
2081
|
+
| Param | Type | Description |
|
|
2082
|
+
| --- | --- | --- |
|
|
2083
|
+
| sticker | <code>String</code> | File identifier of the sticker |
|
|
2084
|
+
| emojiList | <code>Array</code> | A JSON-serialized list of 1-20 emoji associated with the sticker |
|
|
2085
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2086
|
+
|
|
2087
|
+
<a name="TelegramBot+setStickerKeywords"></a>
|
|
2088
|
+
|
|
2089
|
+
### telegramBot.setStickerKeywords(sticker, [options]) ⇒ <code>Promise</code>
|
|
2090
|
+
Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.
|
|
2091
|
+
|
|
2092
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2093
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2094
|
+
**See**: https://core.telegram.org/bots/api#setstickerkeywords
|
|
2095
|
+
|
|
2096
|
+
| Param | Type | Description |
|
|
2097
|
+
| --- | --- | --- |
|
|
2098
|
+
| sticker | <code>String</code> | File identifier of the sticker |
|
|
2099
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2100
|
+
|
|
2101
|
+
<a name="TelegramBot+setStickerMaskPosition"></a>
|
|
2102
|
+
|
|
2103
|
+
### telegramBot.setStickerMaskPosition(sticker, [options]) ⇒ <code>Promise</code>
|
|
2104
|
+
Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.
|
|
2105
|
+
|
|
2106
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2107
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2108
|
+
**See**: https://core.telegram.org/bots/api#setstickermaskposition
|
|
2109
|
+
|
|
2110
|
+
| Param | Type | Description |
|
|
2111
|
+
| --- | --- | --- |
|
|
2112
|
+
| sticker | <code>String</code> | File identifier of the sticker |
|
|
2113
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2114
|
+
|
|
2115
|
+
<a name="TelegramBot+setStickerSetTitle"></a>
|
|
2116
|
+
|
|
2117
|
+
### telegramBot.setStickerSetTitle(name, title, [options]) ⇒ <code>Promise</code>
|
|
2118
|
+
Use this method to set the title of a created sticker set.
|
|
2119
|
+
|
|
2120
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2121
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2122
|
+
**See**: https://core.telegram.org/bots/api#setstickersettitle
|
|
2123
|
+
|
|
2124
|
+
| Param | Type | Description |
|
|
2125
|
+
| --- | --- | --- |
|
|
2126
|
+
| name | <code>String</code> | Sticker set name |
|
|
2127
|
+
| title | <code>String</code> | Sticker set title, 1-64 characters |
|
|
2128
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2129
|
+
|
|
2130
|
+
<a name="TelegramBot+setStickerSetThumbnail"></a>
|
|
2131
|
+
|
|
2132
|
+
### telegramBot.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions]) ⇒ <code>Promise</code>
|
|
2133
|
+
Use this method to add a thumb to a set created by the bot.
|
|
2134
|
+
|
|
2135
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2136
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2137
|
+
**See**: https://core.telegram.org/bots/api#setstickersetthumbnail
|
|
2138
|
+
|
|
2139
|
+
| Param | Type | Description |
|
|
2140
|
+
| --- | --- | --- |
|
|
2141
|
+
| userId | <code>Number</code> | User identifier of sticker set owner |
|
|
2142
|
+
| name | <code>String</code> | Sticker set name |
|
|
2143
|
+
| thumbnail | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, a TGS animation with the thumbnail up to 32 kilobytes in size or a WEBM video with the thumbnail up to 32 kilobytes in size. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one. Animated sticker set thumbnails can't be uploaded via HTTP URL. |
|
|
2144
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2145
|
+
| [fileOptions] | <code>Object</code> | Optional file related meta-data |
|
|
2146
|
+
|
|
2147
|
+
<a name="TelegramBot+setCustomEmojiStickerSetThumbnail"></a>
|
|
2148
|
+
|
|
2149
|
+
### telegramBot.setCustomEmojiStickerSetThumbnail(name, [options]) ⇒ <code>Promise</code>
|
|
2150
|
+
Use this method to set the thumbnail of a custom emoji sticker set.
|
|
2151
|
+
|
|
2152
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2153
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2154
|
+
**See**: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
|
2155
|
+
|
|
2156
|
+
| Param | Type | Description |
|
|
2157
|
+
| --- | --- | --- |
|
|
2158
|
+
| name | <code>String</code> | Sticker set name |
|
|
2159
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2160
|
+
|
|
2161
|
+
<a name="TelegramBot+deleteStickerSet"></a>
|
|
2162
|
+
|
|
2163
|
+
### telegramBot.deleteStickerSet(name, [options]) ⇒ <code>Promise</code>
|
|
2164
|
+
Use this method to delete a sticker set that was created by the bot.
|
|
2165
|
+
|
|
2166
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2167
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2168
|
+
**See**: https://core.telegram.org/bots/api#deletestickerset
|
|
2169
|
+
|
|
2170
|
+
| Param | Type | Description |
|
|
2171
|
+
| --- | --- | --- |
|
|
2172
|
+
| name | <code>String</code> | Sticker set name |
|
|
2173
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2174
|
+
|
|
2175
|
+
<a name="TelegramBot+answerInlineQuery"></a>
|
|
2176
|
+
|
|
2177
|
+
### telegramBot.answerInlineQuery(inlineQueryId, results, [options]) ⇒ <code>Promise</code>
|
|
2178
|
+
Send answers to an inline query.
|
|
2179
|
+
|
|
2180
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2181
|
+
**Returns**: <code>Promise</code> - On success, True is returned
|
|
2182
|
+
**See**: https://core.telegram.org/bots/api#answerinlinequery
|
|
2183
|
+
|
|
2184
|
+
| Param | Type | Description |
|
|
2185
|
+
| --- | --- | --- |
|
|
2186
|
+
| inlineQueryId | <code>String</code> | Unique identifier of the query |
|
|
2187
|
+
| results | <code>[ 'Array' ].<InlineQueryResult></code> | An array of results for the inline query |
|
|
2188
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2189
|
+
|
|
2190
|
+
<a name="TelegramBot+answerWebAppQuery"></a>
|
|
2191
|
+
|
|
2192
|
+
### telegramBot.answerWebAppQuery(webAppQueryId, result, [options]) ⇒ <code>Promise</code>
|
|
2193
|
+
Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
|
|
2194
|
+
|
|
2195
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2196
|
+
**Returns**: <code>Promise</code> - On success, a [SentWebAppMessage](https://core.telegram.org/bots/api#sentwebappmessage) object is returned
|
|
2197
|
+
**See**: https://core.telegram.org/bots/api#answerwebappquery
|
|
2198
|
+
|
|
2199
|
+
| Param | Type | Description |
|
|
2200
|
+
| --- | --- | --- |
|
|
2201
|
+
| webAppQueryId | <code>String</code> | Unique identifier for the query to be answered |
|
|
2202
|
+
| result | <code>InlineQueryResult</code> | object that represents one result of an inline query |
|
|
2203
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2204
|
+
|
|
2205
|
+
<a name="TelegramBot+sendInvoice"></a>
|
|
2206
|
+
|
|
2207
|
+
### telegramBot.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, [options]) ⇒ <code>Promise</code>
|
|
2208
|
+
Use this method to send an invoice.
|
|
2209
|
+
|
|
2210
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2211
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
|
|
2212
|
+
**See**: https://core.telegram.org/bots/api#sendinvoice
|
|
2213
|
+
|
|
2214
|
+
| Param | Type | Description |
|
|
2215
|
+
| --- | --- | --- |
|
|
2216
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
2217
|
+
| title | <code>String</code> | Product name, 1-32 characters |
|
|
2218
|
+
| description | <code>String</code> | Product description, 1-255 characters |
|
|
2219
|
+
| payload | <code>String</code> | Bot defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. |
|
|
2220
|
+
| providerToken | <code>String</code> | Payments provider token, obtained via `@BotFather` |
|
|
2221
|
+
| currency | <code>String</code> | Three-letter ISO 4217 currency code |
|
|
2222
|
+
| prices | <code>Array</code> | Breakdown of prices |
|
|
2223
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2224
|
+
|
|
2225
|
+
<a name="TelegramBot+createInvoiceLink"></a>
|
|
2226
|
+
|
|
2227
|
+
### telegramBot.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options]) ⇒ <code>Promise</code>
|
|
2228
|
+
Use this method to create a link for an invoice.
|
|
2229
|
+
|
|
2230
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2231
|
+
**Returns**: <code>Promise</code> - The created invoice link as String on success.
|
|
2232
|
+
**See**: https://core.telegram.org/bots/api#createinvoicelink
|
|
2233
|
+
|
|
2234
|
+
| Param | Type | Description |
|
|
2235
|
+
| --- | --- | --- |
|
|
2236
|
+
| title | <code>String</code> | Product name, 1-32 characters |
|
|
2237
|
+
| description | <code>String</code> | Product description, 1-255 characters |
|
|
2238
|
+
| payload | <code>String</code> | Bot defined invoice payload |
|
|
2239
|
+
| providerToken | <code>String</code> | Payment provider token |
|
|
2240
|
+
| currency | <code>String</code> | Three-letter ISO 4217 currency code |
|
|
2241
|
+
| prices | <code>Array</code> | Breakdown of prices |
|
|
2242
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2243
|
+
|
|
2244
|
+
<a name="TelegramBot+answerShippingQuery"></a>
|
|
2245
|
+
|
|
2246
|
+
### telegramBot.answerShippingQuery(shippingQueryId, ok, [options]) ⇒ <code>Promise</code>
|
|
2247
|
+
Use this method to reply to shipping queries.
|
|
2248
|
+
|
|
2249
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2250
|
+
**Returns**: <code>Promise</code> - On success, True is returned
|
|
2251
|
+
**See**: https://core.telegram.org/bots/api#answershippingquery
|
|
2252
|
+
|
|
2253
|
+
| Param | Type | Description |
|
|
2254
|
+
| --- | --- | --- |
|
|
2255
|
+
| shippingQueryId | <code>String</code> | Unique identifier for the query to be answered |
|
|
2256
|
+
| ok | <code>Boolean</code> | Specify if delivery of the product is possible |
|
|
2257
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2258
|
+
|
|
2259
|
+
<a name="TelegramBot+answerPreCheckoutQuery"></a>
|
|
2260
|
+
|
|
2261
|
+
### telegramBot.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options]) ⇒ <code>Promise</code>
|
|
2262
|
+
Use this method to respond to such pre-checkout queries
|
|
2263
|
+
|
|
2264
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2265
|
+
**Returns**: <code>Promise</code> - On success, True is returned
|
|
2266
|
+
**See**: https://core.telegram.org/bots/api#answerprecheckoutquery
|
|
2267
|
+
|
|
2268
|
+
| Param | Type | Description |
|
|
2269
|
+
| --- | --- | --- |
|
|
2270
|
+
| preCheckoutQueryId | <code>String</code> | Unique identifier for the query to be answered |
|
|
2271
|
+
| ok | <code>Boolean</code> | Specify if every order details are ok |
|
|
2272
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2273
|
+
|
|
2274
|
+
<a name="TelegramBot+getMyStarBalance"></a>
|
|
2275
|
+
|
|
2276
|
+
### telegramBot.getMyStarBalance([options]) ⇒ <code>Promise</code>
|
|
2277
|
+
Use this method to get the current Telegram Stars balance of the bot.
|
|
2278
|
+
|
|
2279
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2280
|
+
**Returns**: <code>Promise</code> - On success, returns a [StarAmount](https://core.telegram.org/bots/api#staramount) object
|
|
2281
|
+
**See**: https://core.telegram.org/bots/api#getmystarbalance
|
|
2282
|
+
|
|
2283
|
+
| Param | Type | Description |
|
|
2284
|
+
| --- | --- | --- |
|
|
2285
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2286
|
+
|
|
2287
|
+
<a name="TelegramBot+getStarTransactions"></a>
|
|
2288
|
+
|
|
2289
|
+
### telegramBot.getStarTransactions([options]) ⇒ <code>Promise</code>
|
|
2290
|
+
Use this method for get the bot's Telegram Star transactions in chronological order
|
|
2291
|
+
|
|
2292
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2293
|
+
**Returns**: <code>Promise</code> - On success, returns a [StarTransactions](https://core.telegram.org/bots/api#startransactions) object
|
|
2294
|
+
**See**: https://core.telegram.org/bots/api#getstartransactions
|
|
2295
|
+
|
|
2296
|
+
| Param | Type | Description |
|
|
2297
|
+
| --- | --- | --- |
|
|
2298
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2299
|
+
|
|
2300
|
+
<a name="TelegramBot+refundStarPayment"></a>
|
|
2301
|
+
|
|
2302
|
+
### telegramBot.refundStarPayment(userId, telegramPaymentChargeId, [options]) ⇒ <code>Promise</code>
|
|
2303
|
+
Use this method for refund a successful payment in [Telegram Stars](https://t.me/BotNews/90)
|
|
2304
|
+
|
|
2305
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2306
|
+
**Returns**: <code>Promise</code> - On success, True is returned
|
|
2307
|
+
**See**: https://core.telegram.org/bots/api#refundstarpayment
|
|
2308
|
+
|
|
2309
|
+
| Param | Type | Description |
|
|
2310
|
+
| --- | --- | --- |
|
|
2311
|
+
| userId | <code>Number</code> | Unique identifier of the user whose payment will be refunded |
|
|
2312
|
+
| telegramPaymentChargeId | <code>String</code> | Telegram payment identifier |
|
|
2313
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2314
|
+
|
|
2315
|
+
<a name="TelegramBot+editUserStarSubscription"></a>
|
|
2316
|
+
|
|
2317
|
+
### telegramBot.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options]) ⇒ <code>Promise</code>
|
|
2318
|
+
Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars.
|
|
2319
|
+
|
|
2320
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2321
|
+
**Returns**: <code>Promise</code> - On success, True is returned
|
|
2322
|
+
**See**: https://core.telegram.org/bots/api#cancelrenewsubscription
|
|
2323
|
+
|
|
2324
|
+
| Param | Type | Description |
|
|
2325
|
+
| --- | --- | --- |
|
|
2326
|
+
| userId | <code>Number</code> | Unique identifier of the user whose subscription will be canceled or re-enabled |
|
|
2327
|
+
| telegramPaymentChargeId | <code>String</code> | Telegram payment identifier for the subscription |
|
|
2328
|
+
| isCanceled | <code>Boolean</code> | True, if the subscription should be canceled, False, if it should be re-enabled |
|
|
2329
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2330
|
+
|
|
2331
|
+
<a name="TelegramBot+sendGame"></a>
|
|
2332
|
+
|
|
2333
|
+
### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ <code>Promise</code>
|
|
2334
|
+
Use this method to send a game.
|
|
2335
|
+
|
|
2336
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2337
|
+
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
|
|
2338
|
+
**See**: https://core.telegram.org/bots/api#sendgame
|
|
2339
|
+
|
|
2340
|
+
| Param | Type | Description |
|
|
2341
|
+
| --- | --- | --- |
|
|
2342
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
|
2343
|
+
| gameShortName | <code>String</code> | name of the game to be sent. Set up your games via `@BotFather`. |
|
|
2344
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2345
|
+
|
|
2346
|
+
<a name="TelegramBot+setGameScore"></a>
|
|
2347
|
+
|
|
2348
|
+
### telegramBot.setGameScore(userId, score, [options]) ⇒ <code>Promise</code>
|
|
2349
|
+
Use this method to set the score of the specified user in a game message.
|
|
2350
|
+
|
|
2351
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2352
|
+
**Returns**: <code>Promise</code> - On success, if the message is not an inline message, the [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
|
|
2353
|
+
**See**: https://core.telegram.org/bots/api#setgamescore
|
|
2354
|
+
|
|
2355
|
+
| Param | Type | Description |
|
|
2356
|
+
| --- | --- | --- |
|
|
2357
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
2358
|
+
| score | <code>Number</code> | New score value, must be non-negative |
|
|
2359
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2360
|
+
|
|
2361
|
+
<a name="TelegramBot+getGameHighScores"></a>
|
|
2362
|
+
|
|
2363
|
+
### telegramBot.getGameHighScores(userId, [options]) ⇒ <code>Promise</code>
|
|
2364
|
+
Use this method to get data for high score tables.
|
|
2365
|
+
|
|
2366
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2367
|
+
**Returns**: <code>Promise</code> - On success, returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects
|
|
2368
|
+
**See**: https://core.telegram.org/bots/api#getgamehighscores
|
|
2369
|
+
|
|
2370
|
+
| Param | Type | Description |
|
|
2371
|
+
| --- | --- | --- |
|
|
2372
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
2373
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2374
|
+
|
|
2375
|
+
<a name="TelegramBot+deleteMessage"></a>
|
|
2376
|
+
|
|
2377
|
+
### telegramBot.deleteMessage(chatId, messageId, [options]) ⇒ <code>Promise</code>
|
|
2378
|
+
Use this method to delete a message, including service messages, with the following limitations:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2379
|
+
|
|
2380
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2381
|
+
**Returns**: <code>Promise</code> - True on success
|
|
2382
|
+
**See**: https://core.telegram.org/bots/api#deletemessage
|
|
2383
|
+
|
|
2384
|
+
| Param | Type | Description |
|
|
2385
|
+
| --- | --- | --- |
|
|
2386
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
|
2387
|
+
| messageId | <code>Number</code> | Unique identifier of the target message |
|
|
2388
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2389
|
+
|
|
2390
|
+
<a name="TelegramBot+deleteMessages"></a>
|
|
2391
|
+
|
|
2392
|
+
### telegramBot.deleteMessages(chatId, messageIds, [options]) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
|
2393
|
+
Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
|
|
2394
|
+
|
|
2395
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2396
|
+
**Returns**: <code>[ 'Promise' ].<Boolean></code> - True on success
|
|
2397
|
+
**See**: https://core.telegram.org/bots/api#deletemessages
|
|
2398
|
+
|
|
2399
|
+
| Param | Type | Description |
|
|
2400
|
+
| --- | --- | --- |
|
|
2401
|
+
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
|
2402
|
+
| messageIds | <code>[ 'Array' ].<(Number\|String)></code> | Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted |
|
|
2403
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2404
|
+
|
|
2405
|
+
<a name="TelegramBot+getAvailableGifts"></a>
|
|
2406
|
+
|
|
2407
|
+
### telegramBot.getAvailableGifts([options]) ⇒ <code>Promise</code>
|
|
2408
|
+
Use this method to returns the list of gifts that can be sent by the bot to users and channel chats.
|
|
2409
|
+
|
|
2410
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2411
|
+
**Returns**: <code>Promise</code> - On success, returns a [Gifts](https://core.telegram.org/bots/api#gifts) objects.
|
|
2412
|
+
**See**: https://core.telegram.org/bots/api#getavailablegifts
|
|
2413
|
+
|
|
2414
|
+
| Param | Type | Description |
|
|
2415
|
+
| --- | --- | --- |
|
|
2416
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2417
|
+
|
|
2418
|
+
<a name="TelegramBot+sendGift"></a>
|
|
2419
|
+
|
|
2420
|
+
### telegramBot.sendGift(giftId, [options]) ⇒ <code>Promise</code>
|
|
2421
|
+
Use this method to sends a gift to the given user or channel chat.
|
|
2422
|
+
|
|
2423
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2424
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2425
|
+
**See**: https://core.telegram.org/bots/api#getavailablegifts
|
|
2426
|
+
|
|
2427
|
+
| Param | Type | Description |
|
|
2428
|
+
| --- | --- | --- |
|
|
2429
|
+
| giftId | <code>String</code> | Unique identifier of the gift |
|
|
2430
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2431
|
+
|
|
2432
|
+
<a name="TelegramBot+giftPremiumSubscription"></a>
|
|
2433
|
+
|
|
2434
|
+
### telegramBot.giftPremiumSubscription(userId, monthCount, starCount, [options]) ⇒ <code>Promise</code>
|
|
2435
|
+
Use this method to sends a gift to the given user or channel chat.
|
|
2436
|
+
|
|
2437
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2438
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2439
|
+
**See**: https://core.telegram.org/bots/api#getavailablegifts
|
|
2440
|
+
|
|
2441
|
+
| Param | Type | Description |
|
|
2442
|
+
| --- | --- | --- |
|
|
2443
|
+
| userId | <code>Number</code> | Unique identifier of the target user who will receive a Telegram Premium subscription. |
|
|
2444
|
+
| monthCount | <code>Number</code> | Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12. |
|
|
2445
|
+
| starCount | <code>String</code> | Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months. |
|
|
2446
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2447
|
+
|
|
2448
|
+
<a name="TelegramBot+verifyUser"></a>
|
|
2449
|
+
|
|
2450
|
+
### telegramBot.verifyUser(userId, [options]) ⇒ <code>Promise</code>
|
|
2451
|
+
This method verifies a user [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
|
2452
|
+
|
|
2453
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2454
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2455
|
+
**See**: https://core.telegram.org/bots/api#verifyuser
|
|
2456
|
+
|
|
2457
|
+
| Param | Type | Description |
|
|
2458
|
+
| --- | --- | --- |
|
|
2459
|
+
| userId | <code>Number</code> | Unique identifier of the target user. |
|
|
2460
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2461
|
+
|
|
2462
|
+
<a name="TelegramBot+verifyChat"></a>
|
|
2463
|
+
|
|
2464
|
+
### telegramBot.verifyChat(chatId, [options]) ⇒ <code>Promise</code>
|
|
2465
|
+
This method verifies a chat [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
|
2466
|
+
|
|
2467
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2468
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2469
|
+
**See**: https://core.telegram.org/bots/api#verifychat
|
|
2470
|
+
|
|
2471
|
+
| Param | Type | Description |
|
|
2472
|
+
| --- | --- | --- |
|
|
2473
|
+
| chatId | <code>Number</code> | Unique identifier of the target chat. |
|
|
2474
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2475
|
+
|
|
2476
|
+
<a name="TelegramBot+removeUserVerification"></a>
|
|
2477
|
+
|
|
2478
|
+
### telegramBot.removeUserVerification(userId, [options]) ⇒ <code>Promise</code>
|
|
2479
|
+
This method removes verification from a user who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
|
2480
|
+
|
|
2481
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2482
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2483
|
+
**See**: https://core.telegram.org/bots/api#removeuserverification
|
|
2484
|
+
|
|
2485
|
+
| Param | Type | Description |
|
|
2486
|
+
| --- | --- | --- |
|
|
2487
|
+
| userId | <code>Number</code> | Unique identifier of the target user |
|
|
2488
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2489
|
+
|
|
2490
|
+
<a name="TelegramBot+removeChatVerification"></a>
|
|
2491
|
+
|
|
2492
|
+
### telegramBot.removeChatVerification(chatId, [options]) ⇒ <code>Promise</code>
|
|
2493
|
+
This method removes verification from a chat who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
|
2494
|
+
|
|
2495
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2496
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2497
|
+
**See**: https://core.telegram.org/bots/api#removechatverification
|
|
2498
|
+
|
|
2499
|
+
| Param | Type | Description |
|
|
2500
|
+
| --- | --- | --- |
|
|
2501
|
+
| chatId | <code>Number</code> | Unique identifier of the target chat. |
|
|
2502
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2503
|
+
|
|
2504
|
+
<a name="TelegramBot+readBusinessMessage"></a>
|
|
2505
|
+
|
|
2506
|
+
### telegramBot.readBusinessMessage(businessConnectionId, chatId, messageId, [options]) ⇒ <code>Promise</code>
|
|
2507
|
+
This method marks incoming message as read on behalf of a business account.
|
|
2508
|
+
|
|
2509
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2510
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2511
|
+
**See**: https://core.telegram.org/bots/api#readbusinessmessage
|
|
2512
|
+
|
|
2513
|
+
| Param | Type | Description |
|
|
2514
|
+
| --- | --- | --- |
|
|
2515
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection on behalf of which to read the message. |
|
|
2516
|
+
| chatId | <code>Number</code> | Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. |
|
|
2517
|
+
| messageId | <code>Number</code> | Unique identifier of the message to mark as read. |
|
|
2518
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2519
|
+
|
|
2520
|
+
<a name="TelegramBot+deleteBusinessMessages"></a>
|
|
2521
|
+
|
|
2522
|
+
### telegramBot.deleteBusinessMessages(businessConnectionId, messageIds, [options]) ⇒ <code>Promise</code>
|
|
2523
|
+
This method delete messages on behalf of a business account.
|
|
2524
|
+
|
|
2525
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2526
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2527
|
+
**See**: https://core.telegram.org/bots/api#deletebusinessmessages
|
|
2528
|
+
|
|
2529
|
+
| Param | Type | Description |
|
|
2530
|
+
| --- | --- | --- |
|
|
2531
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection on behalf of which to delete the message. |
|
|
2532
|
+
| messageIds | <code>[ 'Array' ].<Number></code> | List of 1-100 identifiers of messages to delete. All messages **must be from the same chat**. |
|
|
2533
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2534
|
+
|
|
2535
|
+
<a name="TelegramBot+setBusinessAccountName"></a>
|
|
2536
|
+
|
|
2537
|
+
### telegramBot.setBusinessAccountName(businessConnectionId, firstName, [options]) ⇒ <code>Promise</code>
|
|
2538
|
+
This method changes the first and last name of a managed business account.
|
|
2539
|
+
|
|
2540
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2541
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2542
|
+
**See**: https://core.telegram.org/bots/api#setbusinessaccountname
|
|
2543
|
+
|
|
2544
|
+
| Param | Type | Description |
|
|
2545
|
+
| --- | --- | --- |
|
|
2546
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2547
|
+
| firstName | <code>String</code> | The new value of the first name for the business account; 1-64 characters. |
|
|
2548
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2549
|
+
|
|
2550
|
+
<a name="TelegramBot+setBusinessAccountUsername"></a>
|
|
2551
|
+
|
|
2552
|
+
### telegramBot.setBusinessAccountUsername(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
|
2553
|
+
This method changes the username of a managed business account.
|
|
2554
|
+
|
|
2555
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2556
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2557
|
+
**See**: https://core.telegram.org/bots/api#setbusinessaccountusername
|
|
2558
|
+
|
|
2559
|
+
| Param | Type | Description |
|
|
2560
|
+
| --- | --- | --- |
|
|
2561
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2562
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2563
|
+
|
|
2564
|
+
<a name="TelegramBot+setBusinessAccountBio"></a>
|
|
2565
|
+
|
|
2566
|
+
### telegramBot.setBusinessAccountBio(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
|
2567
|
+
This method changes the bio of a managed business account.
|
|
2568
|
+
|
|
2569
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2570
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2571
|
+
**See**: https://core.telegram.org/bots/api#setbusinessaccountbio
|
|
2572
|
+
|
|
2573
|
+
| Param | Type | Description |
|
|
2574
|
+
| --- | --- | --- |
|
|
2575
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2576
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2577
|
+
|
|
2578
|
+
<a name="TelegramBot+setBusinessAccountProfilePhoto"></a>
|
|
2579
|
+
|
|
2580
|
+
### telegramBot.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options]) ⇒ <code>Promise</code>
|
|
2581
|
+
This method changes the profile photo of a managed business account.
|
|
2582
|
+
|
|
2583
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2584
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2585
|
+
**See**: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
|
|
2586
|
+
|
|
2587
|
+
| Param | Type | Description |
|
|
2588
|
+
| --- | --- | --- |
|
|
2589
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2590
|
+
| photo | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | New profile photo. |
|
|
2591
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2592
|
+
|
|
2593
|
+
<a name="TelegramBot+removeBusinessAccountProfilePhoto"></a>
|
|
2594
|
+
|
|
2595
|
+
### telegramBot.removeBusinessAccountProfilePhoto(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
|
2596
|
+
This method removes the current profile photo of a managed business account.
|
|
2597
|
+
|
|
2598
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2599
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2600
|
+
**See**: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
|
|
2601
|
+
|
|
2602
|
+
| Param | Type | Description |
|
|
2603
|
+
| --- | --- | --- |
|
|
2604
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2605
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2606
|
+
|
|
2607
|
+
<a name="TelegramBot+setBusinessAccountGiftSettings"></a>
|
|
2608
|
+
|
|
2609
|
+
### telegramBot.setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, acceptedGiftTypes, [options]) ⇒ <code>Promise</code>
|
|
2610
|
+
This method changes the privacy settings pertaining to incoming gifts in a managed business account.
|
|
2611
|
+
|
|
2612
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2613
|
+
**Returns**: <code>Promise</code> - On success, returns true.
|
|
2614
|
+
**See**: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
|
|
2615
|
+
|
|
2616
|
+
| Param | Type | Description |
|
|
2617
|
+
| --- | --- | --- |
|
|
2618
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2619
|
+
| showGiftButton | <code>Boolean</code> | Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field. |
|
|
2620
|
+
| acceptedGiftTypes | <code>Object</code> | Types of gifts accepted by the business account. |
|
|
2621
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2622
|
+
|
|
2623
|
+
<a name="TelegramBot+getBusinessAccountStarBalance"></a>
|
|
2624
|
+
|
|
2625
|
+
### telegramBot.getBusinessAccountStarBalance(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
|
2626
|
+
This method returns the amount of Telegram Stars owned by a managed business account.
|
|
2627
|
+
|
|
2628
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2629
|
+
**Returns**: <code>Promise</code> - On success, returns [StarAmount](https://core.telegram.org/bots/api#staramount).
|
|
2630
|
+
**See**: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
|
|
2631
|
+
|
|
2632
|
+
| Param | Type | Description |
|
|
2633
|
+
| --- | --- | --- |
|
|
2634
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2635
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2636
|
+
|
|
2637
|
+
<a name="TelegramBot+transferBusinessAccountStars"></a>
|
|
2638
|
+
|
|
2639
|
+
### telegramBot.transferBusinessAccountStars(businessConnectionId, starCount, [options]) ⇒ <code>Promise</code>
|
|
2640
|
+
This method transfers Telegram Stars from the business account balance to the bot's balance.
|
|
2641
|
+
|
|
2642
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2643
|
+
**Returns**: <code>Promise</code> - On success, returns True.
|
|
2644
|
+
**See**: https://core.telegram.org/bots/api#transferbusinessaccountstars
|
|
2645
|
+
|
|
2646
|
+
| Param | Type | Description |
|
|
2647
|
+
| --- | --- | --- |
|
|
2648
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2649
|
+
| starCount | <code>Number</code> | Number of Telegram Stars to transfer; 1-10000. |
|
|
2650
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2651
|
+
|
|
2652
|
+
<a name="TelegramBot+getBusinessAccountGifts"></a>
|
|
2653
|
+
|
|
2654
|
+
### telegramBot.getBusinessAccountGifts(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
|
2655
|
+
This method returns the gifts received and owned by a managed business account.
|
|
2656
|
+
|
|
2657
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2658
|
+
**Returns**: <code>Promise</code> - On success, returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts).
|
|
2659
|
+
**See**: https://core.telegram.org/bots/api#getbusinessaccountgifts
|
|
2660
|
+
|
|
2661
|
+
| Param | Type | Description |
|
|
2662
|
+
| --- | --- | --- |
|
|
2663
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2664
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2665
|
+
|
|
2666
|
+
<a name="TelegramBot+convertGiftToStars"></a>
|
|
2667
|
+
|
|
2668
|
+
### telegramBot.convertGiftToStars(businessConnectionId, ownedGiftId, [options]) ⇒ <code>Promise</code>
|
|
2669
|
+
This method converts a given regular gift to Telegram Stars.
|
|
2670
|
+
|
|
2671
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2672
|
+
**Returns**: <code>Promise</code> - On success, returns True.
|
|
2673
|
+
**See**: https://core.telegram.org/bots/api#convertgifttostars
|
|
2674
|
+
|
|
2675
|
+
| Param | Type | Description |
|
|
2676
|
+
| --- | --- | --- |
|
|
2677
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2678
|
+
| ownedGiftId | <code>String</code> | Unique identifier of the regular gift that should be converted to Telegram Stars. |
|
|
2679
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2680
|
+
|
|
2681
|
+
<a name="TelegramBot+upgradeGift"></a>
|
|
2682
|
+
|
|
2683
|
+
### telegramBot.upgradeGift(businessConnectionId, ownedGiftId, [options]) ⇒ <code>Promise</code>
|
|
2684
|
+
This method upgrades a given regular gift to a unique gift.
|
|
2685
|
+
|
|
2686
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2687
|
+
**Returns**: <code>Promise</code> - On success, returns True.
|
|
2688
|
+
**See**: https://core.telegram.org/bots/api#upgradegift
|
|
2689
|
+
|
|
2690
|
+
| Param | Type | Description |
|
|
2691
|
+
| --- | --- | --- |
|
|
2692
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2693
|
+
| ownedGiftId | <code>String</code> | Unique identifier of the regular gift that should be upgraded to a unique one. |
|
|
2694
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2695
|
+
|
|
2696
|
+
<a name="TelegramBot+transferGift"></a>
|
|
2697
|
+
|
|
2698
|
+
### telegramBot.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options]) ⇒ <code>Promise</code>
|
|
2699
|
+
This method transfers an owned unique gift to another user.
|
|
2700
|
+
|
|
2701
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2702
|
+
**Returns**: <code>Promise</code> - On success, returns True.
|
|
2703
|
+
**See**: https://core.telegram.org/bots/api#transfergift
|
|
2704
|
+
|
|
2705
|
+
| Param | Type | Description |
|
|
2706
|
+
| --- | --- | --- |
|
|
2707
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2708
|
+
| ownedGiftId | <code>String</code> | Unique identifier of the regular gift that should be transferred. |
|
|
2709
|
+
| newOwnerChatId | <code>Number</code> | Unique identifier of the chat which will own the gift. The chat **must be active in the last 24 hours**. |
|
|
2710
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2711
|
+
|
|
2712
|
+
<a name="TelegramBot+postStory"></a>
|
|
2713
|
+
|
|
2714
|
+
### telegramBot.postStory(businessConnectionId, content, activePeriod, [options]) ⇒ <code>Promise</code>
|
|
2715
|
+
This method posts a story on behalf of a managed business account.
|
|
2716
|
+
|
|
2717
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2718
|
+
**Returns**: <code>Promise</code> - On success, returns [Story](https://core.telegram.org/bots/api#story).
|
|
2719
|
+
**See**: https://core.telegram.org/bots/api#poststory
|
|
2720
|
+
|
|
2721
|
+
| Param | Type | Description |
|
|
2722
|
+
| --- | --- | --- |
|
|
2723
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2724
|
+
| content | <code>Array</code> | [InputStoryContent](https://core.telegram.org/bots/api#inputpaidmedia). The photo/video property can be String, Stream or Buffer. |
|
|
2725
|
+
| activePeriod | <code>Number</code> | Unique identifier of the chat which will own the gift. The chat **must be active in the last 24 hours**. |
|
|
2726
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2727
|
+
|
|
2728
|
+
<a name="TelegramBot+editStory"></a>
|
|
2729
|
+
|
|
2730
|
+
### telegramBot.editStory(businessConnectionId, storyId, content, [options]) ⇒ <code>Promise</code>
|
|
2731
|
+
This method edits a story previously posted by the bot on behalf of a managed business account.
|
|
2732
|
+
|
|
2733
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2734
|
+
**Returns**: <code>Promise</code> - On success, returns [Story](https://core.telegram.org/bots/api#story).
|
|
2735
|
+
**See**: https://core.telegram.org/bots/api#editstory
|
|
2736
|
+
|
|
2737
|
+
| Param | Type | Description |
|
|
2738
|
+
| --- | --- | --- |
|
|
2739
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2740
|
+
| storyId | <code>Number</code> | Unique identifier of the story to edit. |
|
|
2741
|
+
| content | <code>Array</code> | [InputStoryContent](https://core.telegram.org/bots/api#inputpaidmedia). The photo/video property can be String, Stream or Buffer. |
|
|
2742
|
+
| [options] | <code>Object</code> | Additional Telegram query options |
|
|
2743
|
+
|
|
2744
|
+
<a name="TelegramBot+deleteStory"></a>
|
|
2745
|
+
|
|
2746
|
+
### telegramBot.deleteStory(businessConnectionId, storyId, [options]) ⇒ <code>Promise</code>
|
|
2747
|
+
This method deletes a story previously posted by the bot on behalf of a managed business account.
|
|
2748
|
+
|
|
2749
|
+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
|
2750
|
+
**Returns**: <code>Promise</code> - On success, returns True.
|
|
2751
|
+
**See**: https://core.telegram.org/bots/api#deletestory
|
|
2752
|
+
|
|
2753
|
+
| Param | Type | Description |
|
|
2754
|
+
| --- | --- | --- |
|
|
2755
|
+
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
|
2756
|
+
| storyId | <code>Number</code> | Unique identifier of the story to delete. |
|
|
2757
|
+
| [options] | <code>Object</code> | Additional Telegram query options. |
|
|
2758
|
+
|
|
2759
|
+
<a name="TelegramBot.errors"></a>
|
|
2760
|
+
|
|
2761
|
+
### TelegramBot.errors : <code>Object</code>
|
|
2762
|
+
The different errors the library uses.
|
|
2763
|
+
|
|
2764
|
+
**Kind**: static property of [<code>TelegramBot</code>](#TelegramBot)
|
|
2765
|
+
<a name="TelegramBot.messageTypes"></a>
|
|
2766
|
+
|
|
2767
|
+
### TelegramBot.messageTypes : <code>[ 'Array' ].<String></code>
|
|
2768
|
+
The types of message updates the library handles.
|
|
2769
|
+
|
|
2770
|
+
**Kind**: static property of [<code>TelegramBot</code>](#TelegramBot)
|
|
2771
|
+
* * *
|
|
2772
|
+
|
|
2773
|
+
|
|
2774
|
+
[usage-sending-files-performance]:https://github.com/yagop/node-telegram-bot-api/tree/master/doc/usage.md#sending-files-performance
|
|
2775
|
+
[setWebHook-v0.25.0]:https://github.com/yagop/node-telegram-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#telegrambotsetwebhookurl-cert
|
|
2776
|
+
[getUpdates-v0.25.0]:https://github.com/yagop/node-telegram-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#TelegramBot+getUpdates
|
|
2777
|
+
[getUserProfilePhotos-v0.25.0]:https://github.com/yagop/node-telegram-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#TelegramBot+getUserProfilePhotos
|
|
2778
|
+
[answerCallbackQuery-v0.27.1]:https://github.com/yagop/node-telegram-bot-api/blob/v0.27.1/doc/api.md#TelegramBot+answerCallbackQuery
|
|
2779
|
+
[answerCallbackQuery-v0.29.0]:https://github.com/yagop/node-telegram-bot-api/blob/v0.29.0/doc/api.md#TelegramBot+answerCallbackQuery
|