@zero-bot.net/tg-bot-api 1.2.0 → 1.5.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.
package/doc/api.md DELETED
@@ -1,3473 +0,0 @@
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
- * [.sendMediaGroup(chatId, media, [options])](#TelegramBot+sendMediaGroup) ⇒ <code>Promise</code>
54
- * [.sendLocation(chatId, latitude, longitude, [options])](#TelegramBot+sendLocation) ⇒ <code>Promise</code>
55
- * [.editMessageLiveLocation(latitude, longitude, [options])](#TelegramBot+editMessageLiveLocation) ⇒ <code>Promise</code>
56
- * [.stopMessageLiveLocation([options])](#TelegramBot+stopMessageLiveLocation) ⇒ <code>Promise</code>
57
- * [.sendVenue(chatId, latitude, longitude, title, address, [options])](#TelegramBot+sendVenue) ⇒ <code>Promise</code>
58
- * [.sendContact(chatId, phoneNumber, firstName, [options])](#TelegramBot+sendContact) ⇒ <code>Promise</code>
59
- * [.sendPoll(chatId, question, pollOptions, [options])](#TelegramBot+sendPoll) ⇒ <code>Promise</code>
60
- * [.sendDice(chatId, [options])](#TelegramBot+sendDice) ⇒ <code>Promise</code>
61
- * [.sendChatAction(chatId, action, [options])](#TelegramBot+sendChatAction) ⇒ <code>Promise</code>
62
- * [.setMessageReaction(chatId, messageId, [options])](#TelegramBot+setMessageReaction) ⇒ <code>Promise.&lt;Boolean&gt;</code>
63
- * [.getUserProfilePhotos(userId, [options])](#TelegramBot+getUserProfilePhotos) ⇒ <code>Promise</code>
64
- * [.getFile(fileId, [options])](#TelegramBot+getFile) ⇒ <code>Promise</code>
65
- * [.banChatMember(chatId, userId, [options])](#TelegramBot+banChatMember) ⇒ <code>Promise</code>
66
- * [.unbanChatMember(chatId, userId, [options])](#TelegramBot+unbanChatMember) ⇒ <code>Promise</code>
67
- * [.restrictChatMember(chatId, userId, [options])](#TelegramBot+restrictChatMember) ⇒ <code>Promise</code>
68
- * [.promoteChatMember(chatId, userId, [options])](#TelegramBot+promoteChatMember) ⇒ <code>Promise</code>
69
- * [.setChatAdministratorCustomTitle(chatId, userId, customTitle, [options])](#TelegramBot+setChatAdministratorCustomTitle) ⇒ <code>Promise</code>
70
- * [.banChatSenderChat(chatId, senderChatId, [options])](#TelegramBot+banChatSenderChat) ⇒ <code>Promise</code>
71
- * [.unbanChatSenderChat(chatId, senderChatId, [options])](#TelegramBot+unbanChatSenderChat) ⇒ <code>Promise</code>
72
- * [.setChatPermissions(chatId, chatPermissions, [options])](#TelegramBot+setChatPermissions) ⇒ <code>Promise</code>
73
- * [.exportChatInviteLink(chatId, [options])](#TelegramBot+exportChatInviteLink) ⇒ <code>Promise</code>
74
- * [.createChatInviteLink(chatId, [options])](#TelegramBot+createChatInviteLink) ⇒ <code>Object</code>
75
- * [.editChatInviteLink(chatId, inviteLink, [options])](#TelegramBot+editChatInviteLink) ⇒ <code>Promise</code>
76
- * [.revokeChatInviteLink(chatId, inviteLink, [options])](#TelegramBot+revokeChatInviteLink) ⇒ <code>Promise</code>
77
- * [.approveChatJoinRequest(chatId, userId, [options])](#TelegramBot+approveChatJoinRequest) ⇒ <code>Promise</code>
78
- * [.declineChatJoinRequest(chatId, userId, [options])](#TelegramBot+declineChatJoinRequest) ⇒ <code>Promise</code>
79
- * [.setChatPhoto(chatId, photo, [options], [fileOptions])](#TelegramBot+setChatPhoto) ⇒ <code>Promise</code>
80
- * [.deleteChatPhoto(chatId, [options])](#TelegramBot+deleteChatPhoto) ⇒ <code>Promise</code>
81
- * [.setChatTitle(chatId, title, [options])](#TelegramBot+setChatTitle) ⇒ <code>Promise</code>
82
- * [.setChatDescription(chatId, description, [options])](#TelegramBot+setChatDescription) ⇒ <code>Promise</code>
83
- * [.pinChatMessage(chatId, messageId, [options])](#TelegramBot+pinChatMessage) ⇒ <code>Promise</code>
84
- * [.unpinChatMessage(chatId, [options])](#TelegramBot+unpinChatMessage) ⇒ <code>Promise</code>
85
- * [.unpinAllChatMessages(chatId, [options])](#TelegramBot+unpinAllChatMessages) ⇒ <code>Promise</code>
86
- * [.leaveChat(chatId, [options])](#TelegramBot+leaveChat) ⇒ <code>Promise</code>
87
- * [.getChat(chatId, [options])](#TelegramBot+getChat) ⇒ <code>Promise</code>
88
- * [.getChatAdministrators(chatId, [options])](#TelegramBot+getChatAdministrators) ⇒ <code>Promise</code>
89
- * [.getChatMemberCount(chatId, [options])](#TelegramBot+getChatMemberCount) ⇒ <code>Promise</code>
90
- * [.getChatMember(chatId, userId, [options])](#TelegramBot+getChatMember) ⇒ <code>Promise</code>
91
- * [.setChatStickerSet(chatId, stickerSetName, [options])](#TelegramBot+setChatStickerSet) ⇒ <code>Promise</code>
92
- * [.deleteChatStickerSet(chatId, [options])](#TelegramBot+deleteChatStickerSet) ⇒ <code>Promise</code>
93
- * [.getForumTopicIconStickers(chatId, [options])](#TelegramBot+getForumTopicIconStickers) ⇒ <code>Promise</code>
94
- * [.createForumTopic(chatId, name, [options])](#TelegramBot+createForumTopic)
95
- * [.editForumTopic(chatId, messageThreadId, [options])](#TelegramBot+editForumTopic) ⇒ <code>Promise</code>
96
- * [.closeForumTopic(chatId, messageThreadId, [options])](#TelegramBot+closeForumTopic) ⇒ <code>Promise</code>
97
- * [.reopenForumTopic(chatId, messageThreadId, [options])](#TelegramBot+reopenForumTopic) ⇒ <code>Promise</code>
98
- * [.deleteForumTopic(chatId, messageThreadId, [options])](#TelegramBot+deleteForumTopic) ⇒ <code>Promise</code>
99
- * [.unpinAllForumTopicMessages(chatId, messageThreadId, [options])](#TelegramBot+unpinAllForumTopicMessages) ⇒ <code>Promise</code>
100
- * [.editGeneralForumTopic(chatId, name, [options])](#TelegramBot+editGeneralForumTopic) ⇒ <code>Promise</code>
101
- * [.closeGeneralForumTopic(chatId, [options])](#TelegramBot+closeGeneralForumTopic) ⇒ <code>Promise</code>
102
- * [.reopenGeneralForumTopic(chatId, [options])](#TelegramBot+reopenGeneralForumTopic) ⇒ <code>Promise</code>
103
- * [.hideGeneralForumTopic(chatId, [options])](#TelegramBot+hideGeneralForumTopic) ⇒ <code>Promise</code>
104
- * [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ <code>Promise</code>
105
- * [.unpinAllGeneralForumTopicMessages(chatId, [options])](#TelegramBot+unpinAllGeneralForumTopicMessages) ⇒ <code>Promise</code>
106
- * [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ <code>Promise</code>
107
- * [.getUserChatBoosts(chatId, user_id, [options])](#TelegramBot+getUserChatBoosts) ⇒ <code>Promise</code>
108
- * [.getBusinessConnection(businessConnectionId, [options])](#TelegramBot+getBusinessConnection) ⇒ <code>Promise</code>
109
- * [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ <code>Promise</code>
110
- * [.deleteMyCommands([options])](#TelegramBot+deleteMyCommands) ⇒ <code>Promise</code>
111
- * [.getMyCommands([options])](#TelegramBot+getMyCommands) ⇒ <code>Promise</code>
112
- * [.setMyName([options])](#TelegramBot+setMyName) ⇒ <code>Promise</code>
113
- * [.getMyName([options])](#TelegramBot+getMyName) ⇒ <code>Promise</code>
114
- * [.setMyDescription([options])](#TelegramBot+setMyDescription) ⇒ <code>Promise</code>
115
- * [.getMyDescription([options])](#TelegramBot+getMyDescription) ⇒ <code>Promise</code>
116
- * [.setMyShortDescription([options])](#TelegramBot+setMyShortDescription) ⇒ <code>Promise</code>
117
- * [.getMyShortDescription([options])](#TelegramBot+getMyShortDescription) ⇒ <code>Promise</code>
118
- * [.setChatMenuButton([options])](#TelegramBot+setChatMenuButton) ⇒ <code>Promise</code>
119
- * [.getChatMenuButton([options])](#TelegramBot+getChatMenuButton) ⇒ <code>Promise</code>
120
- * [.setMyDefaultAdministratorRights([options])](#TelegramBot+setMyDefaultAdministratorRights) ⇒ <code>Promise</code>
121
- * [.getMyDefaultAdministratorRights([options])](#TelegramBot+getMyDefaultAdministratorRights) ⇒ <code>Promise</code>
122
- * [.editMessageText(text, [options])](#TelegramBot+editMessageText) ⇒ <code>Promise</code>
123
- * [.editMessageCaption(caption, [options])](#TelegramBot+editMessageCaption) ⇒ <code>Promise</code>
124
- * [.editMessageMedia(media, [options])](#TelegramBot+editMessageMedia) ⇒ <code>Promise</code>
125
- * [.editMessageReplyMarkup(replyMarkup, [options])](#TelegramBot+editMessageReplyMarkup) ⇒ <code>Promise</code>
126
- * [.stopPoll(chatId, pollId, [options])](#TelegramBot+stopPoll) ⇒ <code>Promise</code>
127
- * [.sendSticker(chatId, sticker, [options], [fileOptions])](#TelegramBot+sendSticker) ⇒ <code>Promise</code>
128
- * [.getStickerSet(name, [options])](#TelegramBot+getStickerSet) ⇒ <code>Promise</code>
129
- * [.getCustomEmojiStickers(custom_emoji_ids, [options])](#TelegramBot+getCustomEmojiStickers) ⇒ <code>Promise</code>
130
- * [.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions])](#TelegramBot+uploadStickerFile) ⇒ <code>Promise</code>
131
- * [.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions])](#TelegramBot+createNewStickerSet) ⇒ <code>Promise</code>
132
- * [.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions])](#TelegramBot+addStickerToSet) ⇒ <code>Promise</code>
133
- * [.setStickerPositionInSet(sticker, position, [options])](#TelegramBot+setStickerPositionInSet) ⇒ <code>Promise</code>
134
- * [.deleteStickerFromSet(sticker, [options])](#TelegramBot+deleteStickerFromSet) ⇒ <code>Promise</code>
135
- * [.replaceStickerInSet(user_id, name, sticker, [options])](#TelegramBot+replaceStickerInSet) ⇒ <code>Promise</code>
136
- * [.setStickerEmojiList(sticker, emojiList, [options])](#TelegramBot+setStickerEmojiList) ⇒ <code>Promise</code>
137
- * [.setStickerKeywords(sticker, [options])](#TelegramBot+setStickerKeywords) ⇒ <code>Promise</code>
138
- * [.setStickerMaskPosition(sticker, [options])](#TelegramBot+setStickerMaskPosition) ⇒ <code>Promise</code>
139
- * [.setStickerSetTitle(name, title, [options])](#TelegramBot+setStickerSetTitle) ⇒ <code>Promise</code>
140
- * [.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions])](#TelegramBot+setStickerSetThumbnail) ⇒ <code>Promise</code>
141
- * [.setCustomEmojiStickerSetThumbnail(name, [options])](#TelegramBot+setCustomEmojiStickerSetThumbnail) ⇒ <code>Promise</code>
142
- * [.deleteStickerSet(name, [options])](#TelegramBot+deleteStickerSet) ⇒ <code>Promise</code>
143
- * [.answerInlineQuery(inlineQueryId, results, [options])](#TelegramBot+answerInlineQuery) ⇒ <code>Promise</code>
144
- * [.answerWebAppQuery(webAppQueryId, result, [options])](#TelegramBot+answerWebAppQuery) ⇒ <code>Promise</code>
145
- * [.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+sendInvoice) ⇒ <code>Promise</code>
146
- * [.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+createInvoiceLink) ⇒ <code>Promise</code>
147
- * [.answerShippingQuery(shippingQueryId, ok, [options])](#TelegramBot+answerShippingQuery) ⇒ <code>Promise</code>
148
- * [.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options])](#TelegramBot+answerPreCheckoutQuery) ⇒ <code>Promise</code>
149
- * [.sendGame(chatId, gameShortName, [options])](#TelegramBot+sendGame) ⇒ <code>Promise</code>
150
- * [.setGameScore(userId, score, [options])](#TelegramBot+setGameScore) ⇒ <code>Promise</code>
151
- * [.getGameHighScores(userId, [options])](#TelegramBot+getGameHighScores) ⇒ <code>Promise</code>
152
- * [.deleteMessage(chatId, messageId, [options])](#TelegramBot+deleteMessage) ⇒ <code>Promise</code>
153
- * [.deleteMessages(chatId, messageIds, [options])](#TelegramBot+deleteMessages) ⇒ <code>Promise.&lt;Boolean&gt;</code>
154
- * [.refundStarPayment(userId, telegramPaymentChargeId, [options])](#TelegramBot+refundStarPayment) ⇒ <code>Promise</code>
155
- * [.getStarTransactions([options])](#TelegramBot+getStarTransactions) ⇒ <code>Promise</code>
156
- * [.sendPaidMedia(chatId, starCount, media, [options])](#TelegramBot+sendPaidMedia) ⇒ <code>Promise</code>
157
- * [.createChatSubscriptionInviteLink(chatId, [options])](#TelegramBot+createChatSubscriptionInviteLink) ⇒ <code>Promise</code>
158
- * [.editChatSubscriptionInviteLink(chatId, inviteLink, [options])](#TelegramBot+editChatSubscriptionInviteLink) ⇒ <code>Promise</code>
159
- * [.getAvailableGifts([options])](#TelegramBot+getAvailableGifts) ⇒ <code>Promise</code>
160
- * [.sendGift(userId, giftId, [options])](#TelegramBot+sendGift) ⇒ <code>Promise</code>
161
- * [.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options])](#TelegramBot+editUserStarSubscription) ⇒ <code>Promise</code>
162
- * [.savePreparedInlineMessage(userId, result, [options])](#TelegramBot+savePreparedInlineMessage) ⇒ <code>Promise</code>
163
- * [.verifyUser(userId, [options])](#TelegramBot+verifyUser) ⇒ <code>Promise</code>
164
- * [.verifyChat(chatId, [options])](#TelegramBot+verifyChat) ⇒ <code>Promise</code>
165
- * [.removeUserVerification(userId, [options])](#TelegramBot+removeUserVerification) ⇒ <code>Promise</code>
166
- * [.removeChatVerification(chatId, [options])](#TelegramBot+removeChatVerification) ⇒ <code>Promise</code>
167
- * [.readBusinessMessage(businessConnectionId, messageId, [options])](#TelegramBot+readBusinessMessage) ⇒ <code>Promise</code>
168
- * [.deleteBusinessMessages(businessConnectionId, messageIds, [options])](#TelegramBot+deleteBusinessMessages) ⇒ <code>Promise</code>
169
- * [.setBusinessAccountName(businessConnectionId, [options])](#TelegramBot+setBusinessAccountName) ⇒ <code>Promise</code>
170
- * [.setBusinessAccountUsername(businessConnectionId, [options])](#TelegramBot+setBusinessAccountUsername) ⇒ <code>Promise</code>
171
- * [.setBusinessAccountBio(businessConnectionId, [options])](#TelegramBot+setBusinessAccountBio) ⇒ <code>Promise</code>
172
- * [.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options])](#TelegramBot+setBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
173
- * [.removeBusinessAccountProfilePhoto(businessConnectionId, [options])](#TelegramBot+removeBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
174
- * [.setBusinessAccountGiftSettings(businessConnectionId, [options])](#TelegramBot+setBusinessAccountGiftSettings) ⇒ <code>Promise</code>
175
- * [.getBusinessAccountStarBalance(businessConnectionId, [options])](#TelegramBot+getBusinessAccountStarBalance) ⇒ <code>Promise</code>
176
- * [.transferBusinessAccountStars(businessConnectionId, starCount, [options])](#TelegramBot+transferBusinessAccountStars) ⇒ <code>Promise</code>
177
- * [.getBusinessAccountGifts(businessConnectionId, [options])](#TelegramBot+getBusinessAccountGifts) ⇒ <code>Promise</code>
178
- * [.convertGiftToStars(businessConnectionId, ownedGiftId, [options])](#TelegramBot+convertGiftToStars) ⇒ <code>Promise</code>
179
- * [.upgradeGift(businessConnectionId, ownedGiftId, [options])](#TelegramBot+upgradeGift) ⇒ <code>Promise</code>
180
- * [.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options])](#TelegramBot+transferGift) ⇒ <code>Promise</code>
181
- * [.postStory(businessConnectionId, content, [options])](#TelegramBot+postStory) ⇒ <code>Promise</code>
182
- * [.editStory(businessConnectionId, storyId, [options])](#TelegramBot+editStory) ⇒ <code>Promise</code>
183
- * [.deleteStory(businessConnectionId, storyId, [options])](#TelegramBot+deleteStory) ⇒ <code>Promise</code>
184
- * [.giftPremiumSubscription(userId, monthCount, starCount, [options])](#TelegramBot+giftPremiumSubscription) ⇒ <code>Promise</code>
185
- * [.setUserEmojiStatus(userId, [options])](#TelegramBot+setUserEmojiStatus) ⇒ <code>Promise</code>
186
- * [.sendChecklist(businessConnectionId, title, tasks, [options])](#TelegramBot+sendChecklist) ⇒ <code>Promise</code>
187
- * [.editMessageChecklist(businessConnectionId, messageId, [options])](#TelegramBot+editMessageChecklist) ⇒ <code>Promise</code>
188
- * [.getMyStarBalance([options])](#TelegramBot+getMyStarBalance) ⇒ <code>Promise</code>
189
- * [.approveSuggestedPost(businessConnectionId, messageId, [options])](#TelegramBot+approveSuggestedPost) ⇒ <code>Promise</code>
190
- * [.declineSuggestedPost(businessConnectionId, messageId, [options])](#TelegramBot+declineSuggestedPost) ⇒ <code>Promise</code>
191
- * [.sendMessageDraft(chatId, text, [options])](#TelegramBot+sendMessageDraft) ⇒ <code>Promise</code>
192
- * [.getUserGifts(userId, [options])](#TelegramBot+getUserGifts) ⇒ <code>Promise</code>
193
- * [.getChatGifts(chatId, [options])](#TelegramBot+getChatGifts) ⇒ <code>Promise</code>
194
- * [.repostStory(businessConnectionId, storyId, targetBusinessConnectionIds, [options])](#TelegramBot+repostStory) ⇒ <code>Promise</code>
195
- * [.setMyProfilePhoto(photo, [options])](#TelegramBot+setMyProfilePhoto) ⇒ <code>Promise</code>
196
- * [.removeMyProfilePhoto([options])](#TelegramBot+removeMyProfilePhoto) ⇒ <code>Promise</code>
197
- * [.getUserProfileAudios(userId, [options])](#TelegramBot+getUserProfileAudios) ⇒ <code>Promise</code>
198
- * [.setChatMemberTag(chatId, userId, [options])](#TelegramBot+setChatMemberTag) ⇒ <code>Promise</code>
199
- * [.getManagedBotToken(botId, [options])](#TelegramBot+getManagedBotToken) ⇒ <code>Promise</code>
200
- * [.replaceManagedBotToken(botId, [options])](#TelegramBot+replaceManagedBotToken) ⇒ <code>Promise</code>
201
- * [.savePreparedKeyboardButton(button, [options])](#TelegramBot+savePreparedKeyboardButton) ⇒ <code>Promise</code>
202
- * [.answerGuestQuery(guestQueryId, text, [options])](#TelegramBot+answerGuestQuery) ⇒ <code>Promise</code>
203
- * [.deleteAllMessageReactions(chatId, messageId, [options])](#TelegramBot+deleteAllMessageReactions) ⇒ <code>Promise</code>
204
- * [.deleteMessageReaction(chatId, messageId, [options])](#TelegramBot+deleteMessageReaction) ⇒ <code>Promise</code>
205
- * [.sendLivePhoto(chatId, photo, video, [options], [fileOptions])](#TelegramBot+sendLivePhoto) ⇒ <code>Promise</code>
206
- * [.getManagedBotAccessSettings([options])](#TelegramBot+getManagedBotAccessSettings) ⇒ <code>Promise</code>
207
- * [.setManagedBotAccessSettings([options])](#TelegramBot+setManagedBotAccessSettings) ⇒ <code>Promise</code>
208
- * [.getUserPersonalChatMessages(userId, [options])](#TelegramBot+getUserPersonalChatMessages) ⇒ <code>Promise</code>
209
- * [.sendRichMessage(chatId, content, [options])](#TelegramBot+sendRichMessage) ⇒ <code>Promise</code>
210
- * [.sendRichMessageDraft(chatId, content, [options])](#TelegramBot+sendRichMessageDraft) ⇒ <code>Promise</code>
211
- * [.answerChatJoinRequestQuery(chatJoinRequestId, queryId, [options])](#TelegramBot+answerChatJoinRequestQuery) ⇒ <code>Promise</code>
212
- * [.sendChatJoinRequestWebApp(chatJoinRequestId, webApp, [options])](#TelegramBot+sendChatJoinRequestWebApp) ⇒ <code>Promise</code>
213
- * [.editEphemeralMessageText(chatId, ephemeralMessageId, text, [options])](#TelegramBot+editEphemeralMessageText) ⇒ <code>Promise</code>
214
- * [.editEphemeralMessageMedia(chatId, ephemeralMessageId, media, [options], [fileOptions])](#TelegramBot+editEphemeralMessageMedia) ⇒ <code>Promise</code>
215
- * [.editEphemeralMessageCaption(chatId, ephemeralMessageId, [options])](#TelegramBot+editEphemeralMessageCaption) ⇒ <code>Promise</code>
216
- * [.editEphemeralMessageReplyMarkup(chatId, ephemeralMessageId, [options])](#TelegramBot+editEphemeralMessageReplyMarkup) ⇒ <code>Promise</code>
217
- * [.deleteEphemeralMessage(chatId, ephemeralMessageId, [options])](#TelegramBot+deleteEphemeralMessage) ⇒ <code>Promise</code>
218
- * _static_
219
- * [.errors](#TelegramBot.errors) : <code>Object</code>
220
- * [.messageTypes](#TelegramBot.messageTypes) : <code>Array.&lt;String&gt;</code>
221
-
222
- <a name="new_TelegramBot_new"></a>
223
-
224
- ### new TelegramBot(token, [options])
225
- Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
226
- on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
227
- Emits `message` when a message arrives.
228
-
229
-
230
- | Param | Type | Default | Description |
231
- | --- | --- | --- | --- |
232
- | token | <code>String</code> | | Bot Token |
233
- | [options] | <code>Object</code> | | |
234
- | [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. |
235
- | [options.polling.timeout] | <code>String</code> \| <code>Number</code> | <code>10</code> | *Deprecated. Use `options.polling.params` instead*. Timeout in seconds for long polling. |
236
- | [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. |
237
- | [options.polling.interval] | <code>String</code> \| <code>Number</code> | <code>300</code> | Interval between requests in miliseconds |
238
- | [options.polling.autoStart] | <code>Boolean</code> | <code>true</code> | Start polling immediately |
239
- | [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. |
240
- | [options.polling.params.timeout] | <code>Number</code> | <code>10</code> | Timeout in seconds for long polling. |
241
- | [options.webHook] | <code>Boolean</code> \| <code>Object</code> | <code>false</code> | Set true to enable WebHook or set options |
242
- | [options.webHook.host] | <code>String</code> | <code>&quot;0.0.0.0&quot;</code> | Host to bind to |
243
- | [options.webHook.port] | <code>Number</code> | <code>8443</code> | Port to bind to |
244
- | [options.webHook.key] | <code>String</code> | | Path to file with PEM private key for webHook server. The file is read **synchronously**! |
245
- | [options.webHook.cert] | <code>String</code> | | Path to file with PEM certificate (public) for webHook server. The file is read **synchronously**! |
246
- | [options.webHook.pfx] | <code>String</code> | | Path to file with PFX private key and certificate chain for webHook server. The file is read **synchronously**! |
247
- | [options.webHook.autoOpen] | <code>Boolean</code> | <code>true</code> | Open webHook immediately |
248
- | [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. |
249
- | [options.webHook.healthEndpoint] | <code>String</code> | <code>&quot;/healthz&quot;</code> | An endpoint for health checks that always responds with 200 OK |
250
- | [options.onlyFirstMatch] | <code>Boolean</code> | <code>false</code> | Set to true to stop after first match. Otherwise, all regexps are executed |
251
- | [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. |
252
- | [options.baseApiUrl] | <code>String</code> | <code>&quot;https://api.telegram.org&quot;</code> | API Base URl; useful for proxying and testing |
253
- | [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. |
254
- | [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*. |
255
-
256
- <a name="TelegramBot+on"></a>
257
-
258
- ### telegramBot.on(event, listener)
259
- Add listener for the specified [event](https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#events).
260
- This is the usual `emitter.on()` method.
261
-
262
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
263
- **See**
264
-
265
- - [Available events](https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#events)
266
- - https://nodejs.org/api/events.html#events_emitter_on_eventname_listener
267
-
268
-
269
- | Param | Type |
270
- | --- | --- |
271
- | event | <code>String</code> |
272
- | listener | <code>function</code> |
273
-
274
- <a name="TelegramBot+startPolling"></a>
275
-
276
- ### telegramBot.startPolling([options]) ⇒ <code>Promise</code>
277
- Start polling.
278
- Rejects returned promise if a WebHook is being used by this instance.
279
-
280
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
281
-
282
- | Param | Type | Default | Description |
283
- | --- | --- | --- | --- |
284
- | [options] | <code>Object</code> | | |
285
- | [options.restart] | <code>Boolean</code> | <code>true</code> | Consecutive calls to this method causes polling to be restarted |
286
-
287
- <a name="TelegramBot+initPolling"></a>
288
-
289
- ### ~~telegramBot.initPolling([options]) ⇒ <code>Promise</code>~~
290
- ***Deprecated***
291
-
292
- Alias of `TelegramBot#startPolling()`. This is **deprecated**.
293
-
294
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
295
-
296
- | Param | Type |
297
- | --- | --- |
298
- | [options] | <code>Object</code> |
299
-
300
- <a name="TelegramBot+stopPolling"></a>
301
-
302
- ### telegramBot.stopPolling([options]) ⇒ <code>Promise</code>
303
- Stops polling after the last polling request resolves.
304
- Multiple invocations do nothing if polling is already stopped.
305
- Returning the promise of the last polling request is **deprecated**.
306
-
307
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
308
-
309
- | Param | Type | Description |
310
- | --- | --- | --- |
311
- | [options] | <code>Object</code> | Options |
312
- | [options.cancel] | <code>Boolean</code> | Cancel current request |
313
- | [options.reason] | <code>String</code> | Reason for stopping polling |
314
-
315
- <a name="TelegramBot+getFileLink"></a>
316
-
317
- ### telegramBot.getFileLink(fileId, [options]) ⇒ <code>Promise</code>
318
- Get link for file.
319
- Use this method to get link for file for subsequent use.
320
- Attention: link will be valid for 1 hour.
321
-
322
- This method is a sugar extension of the (getFile)[#getfilefileid] method,
323
- which returns just path to file on remote server (you will have to manually build full uri after that).
324
-
325
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
326
- **Returns**: <code>Promise</code> - Promise which will have *fileURI* in resolve callback
327
- **See**: https://core.telegram.org/bots/api#getfile
328
-
329
- | Param | Type | Description |
330
- | --- | --- | --- |
331
- | fileId | <code>String</code> | File identifier to get info about |
332
- | [options] | <code>Object</code> | Additional Telegram query options |
333
-
334
- <a name="TelegramBot+getFileStream"></a>
335
-
336
- ### telegramBot.getFileStream(fileId, [options]) ⇒ <code>stream.Readable</code>
337
- Return a readable stream for file.
338
-
339
- `fileStream.path` is the specified file ID i.e. `fileId`.
340
- `fileStream` emits event `info` passing a single argument i.e.
341
- `info` with the interface `{ uri }` where `uri` is the URI of the
342
- file on Telegram servers.
343
-
344
- This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method,
345
- which returns the full URI to the file on remote server.
346
-
347
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
348
- **Returns**: <code>stream.Readable</code> - fileStream
349
-
350
- | Param | Type | Description |
351
- | --- | --- | --- |
352
- | fileId | <code>String</code> | File identifier to get info about |
353
- | [options] | <code>Object</code> | Additional Telegram query options |
354
-
355
- <a name="TelegramBot+downloadFile"></a>
356
-
357
- ### telegramBot.downloadFile(fileId, downloadDir, [options]) ⇒ <code>Promise</code>
358
- Downloads file in the specified folder.
359
-
360
- This method is a sugar extension of the [getFileStream](#TelegramBot+getFileStream) method,
361
- which returns a readable file stream.
362
-
363
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
364
- **Returns**: <code>Promise</code> - Promise, which will have *filePath* of downloaded file in resolve callback
365
-
366
- | Param | Type | Description |
367
- | --- | --- | --- |
368
- | fileId | <code>String</code> | File identifier to get info about |
369
- | downloadDir | <code>String</code> | Absolute path to the folder in which file will be saved |
370
- | [options] | <code>Object</code> | Additional Telegram query options |
371
-
372
- <a name="TelegramBot+onText"></a>
373
-
374
- ### telegramBot.onText(regexpRexecuted, callback)
375
- Register a RegExp to test against an incomming text message.
376
-
377
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
378
-
379
- | Param | Type | Description |
380
- | --- | --- | --- |
381
- | regexpRexecuted | <code>RegExp</code> | with `exec`. |
382
- | callback | <code>function</code> | Callback will be called with 2 parameters, the `msg` and the result of executing `regexp.exec` on message text. |
383
-
384
- <a name="TelegramBot+removeTextListener"></a>
385
-
386
- ### telegramBot.removeTextListener(regexp) ⇒ <code>Object</code>
387
- Remove a listener registered with `onText()`.
388
-
389
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
390
- **Returns**: <code>Object</code> - deletedListener The removed reply listener if
391
- found. This object has `regexp` and `callback`
392
- properties. If not found, returns `null`.
393
-
394
- | Param | Type | Description |
395
- | --- | --- | --- |
396
- | regexp | <code>RegExp</code> | RegExp used previously in `onText()` |
397
-
398
- <a name="TelegramBot+clearTextListeners"></a>
399
-
400
- ### telegramBot.clearTextListeners()
401
- Remove all listeners registered with `onText()`.
402
-
403
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
404
- <a name="TelegramBot+onReplyToMessage"></a>
405
-
406
- ### telegramBot.onReplyToMessage(chatId, messageId, callback) ⇒ <code>Number</code>
407
- Register a reply to wait for a message response.
408
-
409
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
410
- **Returns**: <code>Number</code> - id The ID of the inserted reply listener.
411
-
412
- | Param | Type | Description |
413
- | --- | --- | --- |
414
- | chatId | <code>Number</code> \| <code>String</code> | The chat id where the message cames from. |
415
- | messageId | <code>Number</code> \| <code>String</code> | The message id to be replied. |
416
- | callback | <code>function</code> | Callback will be called with the reply message. |
417
-
418
- <a name="TelegramBot+removeReplyListener"></a>
419
-
420
- ### telegramBot.removeReplyListener(replyListenerId) ⇒ <code>Object</code>
421
- Removes a reply that has been prev. registered for a message response.
422
-
423
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
424
- **Returns**: <code>Object</code> - deletedListener The removed reply listener if
425
- found. This object has `id`, `chatId`, `messageId` and `callback`
426
- properties. If not found, returns `null`.
427
-
428
- | Param | Type | Description |
429
- | --- | --- | --- |
430
- | replyListenerId | <code>Number</code> | The ID of the reply listener. |
431
-
432
- <a name="TelegramBot+clearReplyListeners"></a>
433
-
434
- ### telegramBot.clearReplyListeners() ⇒ <code>Array</code>
435
- Removes all replies that have been prev. registered for a message response.
436
-
437
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
438
- **Returns**: <code>Array</code> - deletedListeners An array of removed listeners.
439
- <a name="TelegramBot+isPolling"></a>
440
-
441
- ### telegramBot.isPolling() ⇒ <code>Boolean</code>
442
- Return true if polling. Otherwise, false.
443
-
444
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
445
- <a name="TelegramBot+openWebHook"></a>
446
-
447
- ### telegramBot.openWebHook() ⇒ <code>Promise</code>
448
- Open webhook.
449
- Multiple invocations do nothing if webhook is already open.
450
- Rejects returned promise if Polling is being used by this instance.
451
-
452
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
453
- <a name="TelegramBot+closeWebHook"></a>
454
-
455
- ### telegramBot.closeWebHook() ⇒ <code>Promise</code>
456
- Close webhook after closing all current connections.
457
- Multiple invocations do nothing if webhook is already closed.
458
-
459
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
460
- **Returns**: <code>Promise</code> - Promise
461
- <a name="TelegramBot+hasOpenWebHook"></a>
462
-
463
- ### telegramBot.hasOpenWebHook() ⇒ <code>Boolean</code>
464
- Return true if using webhook and it is open i.e. accepts connections.
465
- Otherwise, false.
466
-
467
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
468
- <a name="TelegramBot+processUpdate"></a>
469
-
470
- ### telegramBot.processUpdate(update)
471
- Process an update; emitting the proper events and executing regexp
472
- callbacks. This method is useful should you be using a different
473
- way to fetch updates, other than those provided by TelegramBot.
474
-
475
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
476
- **See**: https://core.telegram.org/bots/api#update
477
-
478
- | Param | Type |
479
- | --- | --- |
480
- | update | <code>Object</code> |
481
-
482
- <a name="TelegramBot+getUpdates"></a>
483
-
484
- ### telegramBot.getUpdates([options]) ⇒ <code>Promise</code>
485
- Use this method to receive incoming updates using long polling.
486
- This method has an [older, compatible signature][getUpdates-v0.25.0]
487
- that is being deprecated.
488
-
489
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
490
- **See**: https://core.telegram.org/bots/api#getupdates
491
-
492
- | Param | Type | Description |
493
- | --- | --- | --- |
494
- | [options] | <code>Object</code> | Additional Telegram query options |
495
-
496
- <a name="TelegramBot+setWebHook"></a>
497
-
498
- ### telegramBot.setWebHook(url, [options], [fileOptions]) ⇒ <code>Promise</code>
499
- Specify an url to receive incoming updates via an outgoing webHook.
500
- This method has an [older, compatible signature][setWebHook-v0.25.0]
501
- that is being deprecated.
502
-
503
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
504
- **See**
505
-
506
- - https://core.telegram.org/bots/api#setwebhook
507
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
508
-
509
-
510
- | Param | Type | Description |
511
- | --- | --- | --- |
512
- | url | <code>String</code> | URL where Telegram will make HTTP Post. Leave empty to delete webHook. |
513
- | [options] | <code>Object</code> | Additional Telegram query options |
514
- | [options.certificate] | <code>String</code> \| <code>stream.Stream</code> | PEM certificate key (public). |
515
- | [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. |
516
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
517
-
518
- <a name="TelegramBot+deleteWebHook"></a>
519
-
520
- ### telegramBot.deleteWebHook([options]) ⇒ <code>Promise</code>
521
- Use this method to remove webhook integration if you decide to
522
- switch back to getUpdates. Returns True on success.
523
-
524
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
525
- **See**: https://core.telegram.org/bots/api#deletewebhook
526
-
527
- | Param | Type | Description |
528
- | --- | --- | --- |
529
- | [options] | <code>Object</code> | Additional Telegram query options |
530
-
531
- <a name="TelegramBot+getWebHookInfo"></a>
532
-
533
- ### telegramBot.getWebHookInfo([options]) ⇒ <code>Promise</code>
534
- Use this method to get current webhook status.
535
- On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookinfo) object.
536
- If the bot is using getUpdates, will return an object with the
537
- url field empty.
538
-
539
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
540
- **See**: https://core.telegram.org/bots/api#getwebhookinfo
541
-
542
- | Param | Type | Description |
543
- | --- | --- | --- |
544
- | [options] | <code>Object</code> | Additional Telegram query options |
545
-
546
- <a name="TelegramBot+getMe"></a>
547
-
548
- ### telegramBot.getMe([options]) ⇒ <code>Promise</code>
549
- A simple method for testing your bot's authentication token. Requires no parameters.
550
-
551
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
552
- **Returns**: <code>Promise</code> - basic information about the bot in form of a [User](https://core.telegram.org/bots/api#user) object.
553
- **See**: https://core.telegram.org/bots/api#getme
554
-
555
- | Param | Type | Description |
556
- | --- | --- | --- |
557
- | [options] | <code>Object</code> | Additional Telegram query options |
558
-
559
- <a name="TelegramBot+logOut"></a>
560
-
561
- ### telegramBot.logOut([options]) ⇒ <code>Promise</code>
562
- This method log out your bot from the cloud Bot API server before launching the bot locally.
563
- You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
564
- After a successful call, you will not be able to log in again using the same token for 10 minutes.
565
-
566
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
567
- **Returns**: <code>Promise</code> - True on success
568
- **See**: https://core.telegram.org/bots/api#logout
569
-
570
- | Param | Type | Description |
571
- | --- | --- | --- |
572
- | [options] | <code>Object</code> | Additional Telegram query options |
573
-
574
- <a name="TelegramBot+close"></a>
575
-
576
- ### telegramBot.close([options]) ⇒ <code>Promise</code>
577
- This method close the bot instance before moving it from one local server to another.
578
- This method will return error 429 in the first 10 minutes after the bot is launched.
579
-
580
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
581
- **Returns**: <code>Promise</code> - True on success
582
- **See**: https://core.telegram.org/bots/api#close
583
-
584
- | Param | Type | Description |
585
- | --- | --- | --- |
586
- | [options] | <code>Object</code> | Additional Telegram query options |
587
-
588
- <a name="TelegramBot+sendMessage"></a>
589
-
590
- ### telegramBot.sendMessage(chatId, text, [options]) ⇒ <code>Promise</code>
591
- Send text message.
592
-
593
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
594
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
595
- **See**: https://core.telegram.org/bots/api#sendmessage
596
-
597
- | Param | Type | Description |
598
- | --- | --- | --- |
599
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
600
- | text | <code>String</code> | Text of the message to be sent |
601
- | [options] | <code>Object</code> | Additional Telegram query options |
602
-
603
- <a name="TelegramBot+forwardMessage"></a>
604
-
605
- ### telegramBot.forwardMessage(chatId, fromChatId, messageId, [options]) ⇒ <code>Promise</code>
606
- Forward messages of any kind.
607
-
608
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
609
- **See**: https://core.telegram.org/bots/api#forwardmessage
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`) or username of the target channel (in the format `@channelusername`) |
614
- | 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`) |
615
- | messageId | <code>Number</code> \| <code>String</code> | Unique message identifier in the chat specified in fromChatId |
616
- | [options] | <code>Object</code> | Additional Telegram query options |
617
-
618
- <a name="TelegramBot+forwardMessages"></a>
619
-
620
- ### telegramBot.forwardMessages(chatId, fromChatId, messageIds, [options]) ⇒ <code>Promise</code>
621
- Use this method to forward multiple messages of any kind.
622
- If some of the specified messages can't be found or forwarded, they are skipped.
623
-
624
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
625
- **Returns**: <code>Promise</code> - An array of MessageId of the sent messages on success
626
- **See**: https://core.telegram.org/bots/api#forwardmessages
627
-
628
- | Param | Type | Description |
629
- | --- | --- | --- |
630
- | 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`) |
631
- | 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`) |
632
- | messageIds | <code>Array.&lt;(Number\|String)&gt;</code> | Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. |
633
- | [options] | <code>Object</code> | Additional Telegram query options |
634
-
635
- <a name="TelegramBot+copyMessage"></a>
636
-
637
- ### telegramBot.copyMessage(chatId, fromChatId, messageId, [options]) ⇒ <code>Promise</code>
638
- Copy messages of any kind. **Service messages and invoice messages can't be copied.**
639
- The method is analogous to the method forwardMessages, but the copied message doesn't
640
- have a link to the original message.
641
- Returns the MessageId of the sent message on success.
642
-
643
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
644
- **Returns**: <code>Promise</code> - The [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success
645
- **See**: https://core.telegram.org/bots/api#copymessage
646
-
647
- | Param | Type | Description |
648
- | --- | --- | --- |
649
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
650
- | fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent |
651
- | messageId | <code>Number</code> \| <code>String</code> | Unique message identifier |
652
- | [options] | <code>Object</code> | Additional Telegram query options |
653
-
654
- <a name="TelegramBot+copyMessages"></a>
655
-
656
- ### telegramBot.copyMessages(chatId, fromChatId, messageIds, [options]) ⇒ <code>Promise</code>
657
- Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
658
- Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
659
- Returns the MessageId of the sent message on success.
660
-
661
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
662
- **Returns**: <code>Promise</code> - An array of MessageId of the sent messages
663
- **See**: https://core.telegram.org/bots/api#copymessages
664
-
665
- | Param | Type | Description |
666
- | --- | --- | --- |
667
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat |
668
- | fromChatId | <code>Number</code> \| <code>String</code> | Unique identifier for the chat where the original message was sent |
669
- | 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. |
670
- | [options] | <code>Object</code> | Additional Telegram query options |
671
-
672
- <a name="TelegramBot+sendPhoto"></a>
673
-
674
- ### telegramBot.sendPhoto(chatId, photo, [options], [fileOptions]) ⇒ <code>Promise</code>
675
- Send photo
676
-
677
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
678
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
679
- **See**
680
-
681
- - https://core.telegram.org/bots/api#sendphoto
682
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
683
-
684
-
685
- | Param | Type | Description |
686
- | --- | --- | --- |
687
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
688
- | 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 |
689
- | [options] | <code>Object</code> | Additional Telegram query options |
690
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
691
-
692
- <a name="TelegramBot+sendAudio"></a>
693
-
694
- ### telegramBot.sendAudio(chatId, audio, [options], [fileOptions]) ⇒ <code>Promise</code>
695
- Send audio
696
-
697
- **Your audio must be in the .MP3 or .M4A format.**
698
-
699
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
700
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
701
- **See**
702
-
703
- - https://core.telegram.org/bots/api#sendaudio
704
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
705
-
706
-
707
- | Param | Type | Description |
708
- | --- | --- | --- |
709
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
710
- | 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. |
711
- | [options] | <code>Object</code> | Additional Telegram query options |
712
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
713
-
714
- <a name="TelegramBot+sendDocument"></a>
715
-
716
- ### telegramBot.sendDocument(chatId, doc, [options], [fileOptions]) ⇒ <code>Promise</code>
717
- Send Document
718
-
719
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
720
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
721
- **See**
722
-
723
- - https://core.telegram.org/bots/api#sendDocument
724
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
725
-
726
-
727
- | Param | Type | Description |
728
- | --- | --- | --- |
729
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
730
- | 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. |
731
- | [options] | <code>Object</code> | Additional Telegram query options |
732
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
733
-
734
- <a name="TelegramBot+sendVideo"></a>
735
-
736
- ### telegramBot.sendVideo(chatId, video, [options], [fileOptions]) ⇒ <code>Promise</code>
737
- Use this method to send video files, **Telegram clients support mp4 videos** (other formats may be sent as Document).
738
-
739
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
740
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
741
- **See**
742
-
743
- - https://core.telegram.org/bots/api#sendvideo
744
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
745
-
746
-
747
- | Param | Type | Description |
748
- | --- | --- | --- |
749
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
750
- | video | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. Can also be a `file_id` previously uploaded. |
751
- | [options] | <code>Object</code> | Additional Telegram query options |
752
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
753
-
754
- <a name="TelegramBot+sendAnimation"></a>
755
-
756
- ### telegramBot.sendAnimation(chatId, animation, [options], [fileOptions]) ⇒ <code>Promise</code>
757
- Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
758
-
759
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
760
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
761
- **See**
762
-
763
- - https://core.telegram.org/bots/api#sendanimation
764
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
765
-
766
-
767
- | Param | Type | Description |
768
- | --- | --- | --- |
769
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
770
- | 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. |
771
- | [options] | <code>Object</code> | Additional Telegram query options |
772
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
773
-
774
- <a name="TelegramBot+sendVoice"></a>
775
-
776
- ### telegramBot.sendVoice(chatId, voice, [options], [fileOptions]) ⇒ <code>Promise</code>
777
- Send voice
778
-
779
- **Your audio must be in an .OGG file encoded with OPUS**, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)
780
-
781
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
782
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
783
- **See**
784
-
785
- - https://core.telegram.org/bots/api#sendvoice
786
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
787
-
788
-
789
- | Param | Type | Description |
790
- | --- | --- | --- |
791
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
792
- | 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. |
793
- | [options] | <code>Object</code> | Additional Telegram query options |
794
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
795
-
796
- <a name="TelegramBot+sendVideoNote"></a>
797
-
798
- ### telegramBot.sendVideoNote(chatId, videoNote, [options], [fileOptions]) ⇒ <code>Promise</code>
799
- Use this method to send video messages
800
- Telegram clients support **rounded square MPEG4 videos** of up to 1 minute long.
801
-
802
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
803
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
804
- **Info**: The length parameter is actually optional. However, the API (at time of writing) requires you to always provide it until it is fixed.
805
- **See**
806
-
807
- - https://core.telegram.org/bots/api#sendvideonote
808
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
809
-
810
-
811
- | Param | Type | Description |
812
- | --- | --- | --- |
813
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
814
- | videoNote | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. Can also be a `file_id` previously uploaded. |
815
- | [options] | <code>Object</code> | Additional Telegram query options |
816
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
817
-
818
- <a name="TelegramBot+sendMediaGroup"></a>
819
-
820
- ### telegramBot.sendMediaGroup(chatId, media, [options]) ⇒ <code>Promise</code>
821
- Use this method to send a group of photos or videos as an album.
822
-
823
- **Documents and audio files can be only grouped in an album with messages of the same type**
824
-
825
- If you wish to [specify file options](https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files),
826
- add a `fileOptions` property to the target input in `media`.
827
-
828
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
829
- **Returns**: <code>Promise</code> - On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
830
- is returned.
831
- **See**
832
-
833
- - https://core.telegram.org/bots/api#sendmediagroup
834
- - https://github.com/ZeroBot-net/@zero-bot.net/tg-bot-api/blob/master/doc/usage.md#sending-files
835
-
836
-
837
- | Param | Type | Description |
838
- | --- | --- | --- |
839
- | chatId | <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
840
- | media | <code>Array</code> | A JSON-serialized array describing photos and videos to be sent, must include 2–10 items |
841
- | [options] | <code>Object</code> | Additional Telegram query options |
842
-
843
- <a name="TelegramBot+sendLocation"></a>
844
-
845
- ### telegramBot.sendLocation(chatId, latitude, longitude, [options]) ⇒ <code>Promise</code>
846
- Send location.
847
- Use this method to send point on the map.
848
-
849
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
850
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
851
- **See**: https://core.telegram.org/bots/api#sendlocation
852
-
853
- | Param | Type | Description |
854
- | --- | --- | --- |
855
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
856
- | latitude | <code>Float</code> | Latitude of location |
857
- | longitude | <code>Float</code> | Longitude of location |
858
- | [options] | <code>Object</code> | Additional Telegram query options |
859
-
860
- <a name="TelegramBot+editMessageLiveLocation"></a>
861
-
862
- ### telegramBot.editMessageLiveLocation(latitude, longitude, [options]) ⇒ <code>Promise</code>
863
- Use this method to edit live location messages sent by
864
- the bot or via the bot (for inline bots).
865
-
866
- 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)**
867
-
868
- Note that you must provide one of chat_id, message_id, or
869
- inline_message_id in your request.
870
-
871
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
872
- **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.
873
- **See**: https://core.telegram.org/bots/api#editmessagelivelocation
874
-
875
- | Param | Type | Description |
876
- | --- | --- | --- |
877
- | latitude | <code>Float</code> | Latitude of location |
878
- | longitude | <code>Float</code> | Longitude of location |
879
- | [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
880
-
881
- <a name="TelegramBot+stopMessageLiveLocation"></a>
882
-
883
- ### telegramBot.stopMessageLiveLocation([options]) ⇒ <code>Promise</code>
884
- Use this method to stop updating a live location message sent by
885
- the bot or via the bot (for inline bots) before live_period expires.
886
-
887
- Note that you must provide one of chat_id, message_id, or
888
- inline_message_id in your request.
889
-
890
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
891
- **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.
892
- **See**: https://core.telegram.org/bots/api#stopmessagelivelocation
893
-
894
- | Param | Type | Description |
895
- | --- | --- | --- |
896
- | [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
897
-
898
- <a name="TelegramBot+sendVenue"></a>
899
-
900
- ### telegramBot.sendVenue(chatId, latitude, longitude, title, address, [options]) ⇒ <code>Promise</code>
901
- Send venue.
902
- Use this method to send information about a venue.
903
-
904
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
905
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
906
- **See**: https://core.telegram.org/bots/api#sendvenue
907
-
908
- | Param | Type | Description |
909
- | --- | --- | --- |
910
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
911
- | latitude | <code>Float</code> | Latitude of location |
912
- | longitude | <code>Float</code> | Longitude of location |
913
- | title | <code>String</code> | Name of the venue |
914
- | address | <code>String</code> | Address of the venue |
915
- | [options] | <code>Object</code> | Additional Telegram query options |
916
-
917
- <a name="TelegramBot+sendContact"></a>
918
-
919
- ### telegramBot.sendContact(chatId, phoneNumber, firstName, [options]) ⇒ <code>Promise</code>
920
- Send contact.
921
- Use this method to send phone contacts.
922
-
923
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
924
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
925
- **See**: https://core.telegram.org/bots/api#sendcontact
926
-
927
- | Param | Type | Description |
928
- | --- | --- | --- |
929
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
930
- | phoneNumber | <code>String</code> | Contact's phone number |
931
- | firstName | <code>String</code> | Contact's first name |
932
- | [options] | <code>Object</code> | Additional Telegram query options |
933
-
934
- <a name="TelegramBot+sendPoll"></a>
935
-
936
- ### telegramBot.sendPoll(chatId, question, pollOptions, [options]) ⇒ <code>Promise</code>
937
- Send poll.
938
- Use this method to send a native poll.
939
-
940
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
941
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
942
- **See**: https://core.telegram.org/bots/api#sendpoll
943
-
944
- | Param | Type | Description |
945
- | --- | --- | --- |
946
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
947
- | question | <code>String</code> | Poll question, 1-300 characters |
948
- | pollOptions | <code>Array</code> | Poll options, between 2-10 options (only 1-100 characters each) |
949
- | [options] | <code>Object</code> | Additional Telegram query options |
950
-
951
- <a name="TelegramBot+sendDice"></a>
952
-
953
- ### telegramBot.sendDice(chatId, [options]) ⇒ <code>Promise</code>
954
- Send Dice
955
- Use this method to send an animated emoji that will display a random value.
956
-
957
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
958
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
959
- **See**: https://core.telegram.org/bots/api#senddice
960
-
961
- | Param | Type | Description |
962
- | --- | --- | --- |
963
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
964
- | [options] | <code>Object</code> | Additional Telegram query options |
965
-
966
- <a name="TelegramBot+sendChatAction"></a>
967
-
968
- ### telegramBot.sendChatAction(chatId, action, [options]) ⇒ <code>Promise</code>
969
- Send chat action.
970
-
971
- Use this method when you need to tell the user that something is happening on the bot's side.
972
- **The status is set for 5 seconds or less** (when a message arrives from your bot, Telegram clients clear its typing status).
973
-
974
- Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
975
- `upload_photo` for [photos](https://core.telegram.org/bots/api#sendphoto), `record_video` or `upload_video` for [videos](https://core.telegram.org/bots/api#sendvideo),
976
- `record_voice` or `upload_voice` for [voice notes](https://core.telegram.org/bots/api#sendvoice), `upload_document` for [general files](https://core.telegram.org/bots/api#senddocument),
977
- `choose_sticker` for [stickers](https://core.telegram.org/bots/api#sendsticker), `find_location` for [location data](https://core.telegram.org/bots/api#sendlocation),
978
- `record_video_note` or `upload_video_note` for [video notes](https://core.telegram.org/bots/api#sendvideonote).
979
-
980
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
981
- **Returns**: <code>Promise</code> - True on success
982
- **See**: https://core.telegram.org/bots/api#sendchataction
983
-
984
- | Param | Type | Description |
985
- | --- | --- | --- |
986
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
987
- | action | <code>String</code> | Type of action to broadcast. |
988
- | [options] | <code>Object</code> | Additional Telegram query options |
989
-
990
- <a name="TelegramBot+setMessageReaction"></a>
991
-
992
- ### telegramBot.setMessageReaction(chatId, messageId, [options]) ⇒ <code>Promise.&lt;Boolean&gt;</code>
993
- Use this method to change the chosen reactions on a message.
994
- - Service messages can't be reacted to.
995
- - Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
996
- - In albums, bots must react to the first message.
997
-
998
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
999
- **Returns**: <code>Promise.&lt;Boolean&gt;</code> - True on success
1000
- **See**: https://core.telegram.org/bots/api#setmessagereaction
1001
-
1002
- | Param | Type | Description |
1003
- | --- | --- | --- |
1004
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
1005
- | messageId | <code>Number</code> | Unique identifier of the target message |
1006
- | [options] | <code>Object</code> | Additional Telegram query options |
1007
-
1008
- <a name="TelegramBot+getUserProfilePhotos"></a>
1009
-
1010
- ### telegramBot.getUserProfilePhotos(userId, [options]) ⇒ <code>Promise</code>
1011
- Use this method to get a list of profile pictures for a user.
1012
- Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.
1013
- This method has an [older, compatible signature][getUserProfilePhotos-v0.25.0]
1014
- that is being deprecated.
1015
-
1016
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1017
- **Returns**: <code>Promise</code> - Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object
1018
- **See**: https://core.telegram.org/bots/api#getuserprofilephotos
1019
-
1020
- | Param | Type | Description |
1021
- | --- | --- | --- |
1022
- | userId | <code>Number</code> | Unique identifier of the target user |
1023
- | [options] | <code>Object</code> | Additional Telegram query options |
1024
-
1025
- <a name="TelegramBot+getFile"></a>
1026
-
1027
- ### telegramBot.getFile(fileId, [options]) ⇒ <code>Promise</code>
1028
- Get file.
1029
- Use this method to get basic info about a file and prepare it for downloading.
1030
-
1031
- Attention: **link will be valid for 1 hour.**
1032
-
1033
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1034
- **Returns**: <code>Promise</code> - On success, a [File](https://core.telegram.org/bots/api#file) object is returned
1035
- **See**: https://core.telegram.org/bots/api#getfile
1036
-
1037
- | Param | Type | Description |
1038
- | --- | --- | --- |
1039
- | fileId | <code>String</code> | File identifier to get info about |
1040
- | [options] | <code>Object</code> | Additional Telegram query options |
1041
-
1042
- <a name="TelegramBot+banChatMember"></a>
1043
-
1044
- ### telegramBot.banChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
1045
- Use this method to ban a user in a group, a supergroup or a channel.
1046
- In the case of supergroups and channels, the user will not be able to
1047
- return to the chat on their own using invite links, etc., unless unbanned first..
1048
-
1049
- The **bot must be an administrator in the group, supergroup or a channel** for this to work.
1050
-
1051
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1052
- **Returns**: <code>Promise</code> - True on success.
1053
- **See**: https://core.telegram.org/bots/api#banchatmember
1054
-
1055
- | Param | Type | Description |
1056
- | --- | --- | --- |
1057
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1058
- | userId | <code>Number</code> | Unique identifier of the target user |
1059
- | [options] | <code>Object</code> | Additional Telegram query options |
1060
-
1061
- <a name="TelegramBot+unbanChatMember"></a>
1062
-
1063
- ### telegramBot.unbanChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
1064
- Use this method to unban a previously kicked user in a supergroup.
1065
- The user will not return to the group automatically, but will be
1066
- able to join via link, etc.
1067
-
1068
- The **bot must be an administrator** in the supergroup or channel for this to work.
1069
-
1070
- **By default**, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
1071
- So **if the user is a member of the chat they will also be removed from the chat**. If you don't want this, use the parameter *only_if_banned*
1072
-
1073
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1074
- **Returns**: <code>Promise</code> - True on success
1075
- **See**: https://core.telegram.org/bots/api#unbanchatmember
1076
-
1077
- | Param | Type | Description |
1078
- | --- | --- | --- |
1079
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1080
- | userId | <code>Number</code> | Unique identifier of the target user |
1081
- | [options] | <code>Object</code> | Additional Telegram query options |
1082
-
1083
- <a name="TelegramBot+restrictChatMember"></a>
1084
-
1085
- ### telegramBot.restrictChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
1086
- Use this method to restrict a user in a supergroup.
1087
- The bot **must be an administrator in the supergroup** for this to work
1088
- and must have the appropriate admin rights. Pass True for all boolean parameters
1089
- to lift restrictions from a user. Returns True on success.
1090
-
1091
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1092
- **Returns**: <code>Promise</code> - True on success
1093
- **See**: https://core.telegram.org/bots/api#restrictchatmember
1094
-
1095
- | Param | Type | Description |
1096
- | --- | --- | --- |
1097
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1098
- | userId | <code>Number</code> | Unique identifier of the target user |
1099
- | [options] | <code>Object</code> | Additional Telegram query options |
1100
-
1101
- <a name="TelegramBot+promoteChatMember"></a>
1102
-
1103
- ### telegramBot.promoteChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
1104
- Use this method to promote or demote a user in a supergroup or a channel.
1105
- The bot **must be an administrator** in the chat for this to work
1106
- and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
1107
-
1108
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1109
- **Returns**: <code>Promise</code> - True on success.
1110
- **See**: https://core.telegram.org/bots/api#promotechatmember
1111
-
1112
- | Param | Type | Description |
1113
- | --- | --- | --- |
1114
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1115
- | userId | <code>Number</code> | |
1116
- | [options] | <code>Object</code> | Additional Telegram query options |
1117
-
1118
- <a name="TelegramBot+setChatAdministratorCustomTitle"></a>
1119
-
1120
- ### telegramBot.setChatAdministratorCustomTitle(chatId, userId, customTitle, [options]) ⇒ <code>Promise</code>
1121
- Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
1122
-
1123
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1124
- **Returns**: <code>Promise</code> - True on success
1125
- **See**: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
1126
-
1127
- | Param | Type | Description |
1128
- | --- | --- | --- |
1129
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1130
- | userId | <code>Number</code> | Unique identifier of the target user |
1131
- | customTitle | <code>String</code> | New custom title for the administrator; 0-16 characters, emoji are not allowed |
1132
- | [options] | <code>Object</code> | Additional Telegram query options |
1133
-
1134
- <a name="TelegramBot+banChatSenderChat"></a>
1135
-
1136
- ### telegramBot.banChatSenderChat(chatId, senderChatId, [options]) ⇒ <code>Promise</code>
1137
- Use this method to ban a channel chat in a supergroup or a channel.
1138
-
1139
- Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), the owner of the banned chat won't be able to send messages on behalf of any of their channels.
1140
- The bot **must be an administrator in the supergroup or channel** for this to work and must have the appropriate administrator rights
1141
-
1142
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1143
- **Returns**: <code>Promise</code> - True on success.
1144
- **See**: https://core.telegram.org/bots/api#banchatsenderchat
1145
-
1146
- | Param | Type | Description |
1147
- | --- | --- | --- |
1148
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1149
- | senderChatId | <code>Number</code> | Unique identifier of the target user |
1150
- | [options] | <code>Object</code> | Additional Telegram query options |
1151
-
1152
- <a name="TelegramBot+unbanChatSenderChat"></a>
1153
-
1154
- ### telegramBot.unbanChatSenderChat(chatId, senderChatId, [options]) ⇒ <code>Promise</code>
1155
- Use this method to unban a previously banned channel chat in a supergroup or channel.
1156
-
1157
- The bot **must be an administrator** for this to work and must have the appropriate administrator rights.
1158
-
1159
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1160
- **Returns**: <code>Promise</code> - True on success
1161
- **See**: https://core.telegram.org/bots/api#unbanchatsenderchat
1162
-
1163
- | Param | Type | Description |
1164
- | --- | --- | --- |
1165
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1166
- | senderChatId | <code>Number</code> | Unique identifier of the target user |
1167
- | [options] | <code>Object</code> | Additional Telegram query options |
1168
-
1169
- <a name="TelegramBot+setChatPermissions"></a>
1170
-
1171
- ### telegramBot.setChatPermissions(chatId, chatPermissions, [options]) ⇒ <code>Promise</code>
1172
- Use this method to set default chat permissions for all members.
1173
-
1174
- The bot **must be an administrator in the group or a supergroup** for this to
1175
- work and **must have the `can_restrict_members` admin rights.**
1176
-
1177
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1178
- **Returns**: <code>Promise</code> - True on success
1179
- **See**: https://core.telegram.org/bots/api#setchatpermissions
1180
-
1181
- | Param | Type | Description |
1182
- | --- | --- | --- |
1183
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1184
- | chatPermissions | <code>Array</code> | New default chat permissions |
1185
- | [options] | <code>Object</code> | Additional Telegram query options |
1186
-
1187
- <a name="TelegramBot+exportChatInviteLink"></a>
1188
-
1189
- ### telegramBot.exportChatInviteLink(chatId, [options]) ⇒ <code>Promise</code>
1190
- Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.
1191
-
1192
- The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
1193
-
1194
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1195
- **Returns**: <code>Promise</code> - Exported invite link as String on success.
1196
- **See**: https://core.telegram.org/bots/api#exportchatinvitelink
1197
-
1198
- | Param | Type | Description |
1199
- | --- | --- | --- |
1200
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1201
- | [options] | <code>Object</code> | Additional Telegram query options |
1202
-
1203
- <a name="TelegramBot+createChatInviteLink"></a>
1204
-
1205
- ### telegramBot.createChatInviteLink(chatId, [options]) ⇒ <code>Object</code>
1206
- Use this method to create an additional invite link for a chat.
1207
-
1208
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1209
-
1210
- The link generated with this method can be revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink)
1211
-
1212
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1213
- **Returns**: <code>Object</code> - The new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
1214
- **See**: https://core.telegram.org/bots/api#createchatinvitelink
1215
-
1216
- | Param | Type | Description |
1217
- | --- | --- | --- |
1218
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1219
- | [options] | <code>Object</code> | Additional Telegram query options |
1220
-
1221
- <a name="TelegramBot+editChatInviteLink"></a>
1222
-
1223
- ### telegramBot.editChatInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
1224
- Use this method to edit a non-primary invite link created by the bot.
1225
-
1226
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1227
-
1228
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1229
- **Returns**: <code>Promise</code> - The edited invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
1230
- **See**: https://core.telegram.org/bots/api#editchatinvitelink
1231
-
1232
- | Param | Type | Description |
1233
- | --- | --- | --- |
1234
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1235
- | inviteLink | <code>String</code> | Text with the invite link to edit |
1236
- | [options] | <code>Object</code> | Additional Telegram query options |
1237
-
1238
- <a name="TelegramBot+revokeChatInviteLink"></a>
1239
-
1240
- ### telegramBot.revokeChatInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
1241
- Use this method to revoke an invite link created by the bot.
1242
- Note: If the primary link is revoked, a new link is automatically generated
1243
-
1244
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1245
-
1246
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1247
- **Returns**: <code>Promise</code> - The revoked invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
1248
- **See**: https://core.telegram.org/bots/api#revokechatinvitelink
1249
-
1250
- | Param | Type | Description |
1251
- | --- | --- | --- |
1252
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1253
- | inviteLink | <code>String</code> | The invite link to revoke |
1254
- | [options] | <code>Object</code> | Additional Telegram query options |
1255
-
1256
- <a name="TelegramBot+approveChatJoinRequest"></a>
1257
-
1258
- ### telegramBot.approveChatJoinRequest(chatId, userId, [options]) ⇒ <code>Promise</code>
1259
- Use this method to approve a chat join request.
1260
-
1261
- The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right.**
1262
-
1263
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1264
- **Returns**: <code>Promise</code> - True on success
1265
- **See**: https://core.telegram.org/bots/api#approvechatjoinrequest
1266
-
1267
- | Param | Type | Description |
1268
- | --- | --- | --- |
1269
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1270
- | userId | <code>Number</code> | Unique identifier of the target user |
1271
- | [options] | <code>Object</code> | Additional Telegram query options |
1272
-
1273
- <a name="TelegramBot+declineChatJoinRequest"></a>
1274
-
1275
- ### telegramBot.declineChatJoinRequest(chatId, userId, [options]) ⇒ <code>Promise</code>
1276
- Use this method to decline a chat join request.
1277
-
1278
- The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right**.
1279
-
1280
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1281
- **Returns**: <code>Promise</code> - True on success
1282
- **See**: https://core.telegram.org/bots/api#declinechatjoinrequest
1283
-
1284
- | Param | Type | Description |
1285
- | --- | --- | --- |
1286
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1287
- | userId | <code>Number</code> | Unique identifier of the target user |
1288
- | [options] | <code>Object</code> | Additional Telegram query options |
1289
-
1290
- <a name="TelegramBot+setChatPhoto"></a>
1291
-
1292
- ### telegramBot.setChatPhoto(chatId, photo, [options], [fileOptions]) ⇒ <code>Promise</code>
1293
- Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.
1294
-
1295
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1296
-
1297
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1298
- **Returns**: <code>Promise</code> - True on success
1299
- **See**: https://core.telegram.org/bots/api#setchatphoto
1300
-
1301
- | Param | Type | Description |
1302
- | --- | --- | --- |
1303
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1304
- | photo | <code>stream.Stream</code> \| <code>Buffer</code> | A file path or a Stream. |
1305
- | [options] | <code>Object</code> | Additional Telegram query options |
1306
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
1307
-
1308
- <a name="TelegramBot+deleteChatPhoto"></a>
1309
-
1310
- ### telegramBot.deleteChatPhoto(chatId, [options]) ⇒ <code>Promise</code>
1311
- Use this method to delete a chat photo. **Photos can't be changed for private chats**.
1312
-
1313
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1314
-
1315
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1316
- **Returns**: <code>Promise</code> - True on success
1317
- **See**: https://core.telegram.org/bots/api#deletechatphoto
1318
-
1319
- | Param | Type | Description |
1320
- | --- | --- | --- |
1321
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1322
- | [options] | <code>Object</code> | Additional Telegram query options |
1323
-
1324
- <a name="TelegramBot+setChatTitle"></a>
1325
-
1326
- ### telegramBot.setChatTitle(chatId, title, [options]) ⇒ <code>Promise</code>
1327
- Use this method to change the title of a chat. **Titles can't be changed for private chats**.
1328
-
1329
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1330
-
1331
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1332
- **Returns**: <code>Promise</code> - True on success
1333
- **See**: https://core.telegram.org/bots/api#setchattitle
1334
-
1335
- | Param | Type | Description |
1336
- | --- | --- | --- |
1337
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1338
- | title | <code>String</code> | New chat title, 1-255 characters |
1339
- | [options] | <code>Object</code> | Additional Telegram query options |
1340
-
1341
- <a name="TelegramBot+setChatDescription"></a>
1342
-
1343
- ### telegramBot.setChatDescription(chatId, description, [options]) ⇒ <code>Promise</code>
1344
- Use this method to change the description of a group, a supergroup or a channel.
1345
-
1346
- The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
1347
-
1348
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1349
- **Returns**: <code>Promise</code> - True on success
1350
- **See**: https://core.telegram.org/bots/api#setchatdescription
1351
-
1352
- | Param | Type | Description |
1353
- | --- | --- | --- |
1354
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1355
- | description | <code>String</code> | New chat title, 0-255 characters |
1356
- | [options] | <code>Object</code> | Additional Telegram query options |
1357
-
1358
- <a name="TelegramBot+pinChatMessage"></a>
1359
-
1360
- ### telegramBot.pinChatMessage(chatId, messageId, [options]) ⇒ <code>Promise</code>
1361
- Use this method to pin a message in a supergroup.
1362
-
1363
- If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
1364
- right in a supergroup or `can_edit_messages` administrator right in a channel.
1365
-
1366
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1367
- **Returns**: <code>Promise</code> - True on success
1368
- **See**: https://core.telegram.org/bots/api#pinchatmessage
1369
-
1370
- | Param | Type | Description |
1371
- | --- | --- | --- |
1372
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1373
- | messageId | <code>Number</code> | Identifier of a message to pin |
1374
- | [options] | <code>Object</code> | Additional Telegram query options |
1375
-
1376
- <a name="TelegramBot+unpinChatMessage"></a>
1377
-
1378
- ### telegramBot.unpinChatMessage(chatId, [options]) ⇒ <code>Promise</code>
1379
- Use this method to remove a message from the list of pinned messages in a chat
1380
-
1381
- If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
1382
- right in a supergroup or `can_edit_messages` administrator right in a channel.
1383
-
1384
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1385
- **Returns**: <code>Promise</code> - True on success
1386
- **See**: https://core.telegram.org/bots/api#unpinchatmessage
1387
-
1388
- | Param | Type | Description |
1389
- | --- | --- | --- |
1390
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1391
- | [options] | <code>Object</code> | Additional Telegram query options |
1392
-
1393
- <a name="TelegramBot+unpinAllChatMessages"></a>
1394
-
1395
- ### telegramBot.unpinAllChatMessages(chatId, [options]) ⇒ <code>Promise</code>
1396
- Use this method to clear the list of pinned messages in a chat.
1397
-
1398
- If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
1399
- right in a supergroup or `can_edit_messages` administrator right in a channel.
1400
-
1401
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1402
- **Returns**: <code>Promise</code> - True on success
1403
- **See**: https://core.telegram.org/bots/api#unpinallchatmessages
1404
-
1405
- | Param | Type | Description |
1406
- | --- | --- | --- |
1407
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1408
- | [options] | <code>Object</code> | Additional Telegram query options |
1409
-
1410
- <a name="TelegramBot+leaveChat"></a>
1411
-
1412
- ### telegramBot.leaveChat(chatId, [options]) ⇒ <code>Promise</code>
1413
- Use this method for your bot to leave a group, supergroup or channel
1414
-
1415
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1416
- **Returns**: <code>Promise</code> - True on success
1417
- **See**: https://core.telegram.org/bots/api#leavechat
1418
-
1419
- | Param | Type | Description |
1420
- | --- | --- | --- |
1421
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
1422
- | [options] | <code>Object</code> | Additional Telegram query options |
1423
-
1424
- <a name="TelegramBot+getChat"></a>
1425
-
1426
- ### telegramBot.getChat(chatId, [options]) ⇒ <code>Promise</code>
1427
- Use this method to get up to date information about the chat
1428
- (current name of the user for one-on-one conversations, current
1429
- username of a user, group or channel, etc.).
1430
-
1431
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1432
- **Returns**: <code>Promise</code> - [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success
1433
- **See**: https://core.telegram.org/bots/api#getchat
1434
-
1435
- | Param | Type | Description |
1436
- | --- | --- | --- |
1437
- | 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 |
1438
- | [options] | <code>Object</code> | Additional Telegram query options |
1439
-
1440
- <a name="TelegramBot+getChatAdministrators"></a>
1441
-
1442
- ### telegramBot.getChatAdministrators(chatId, [options]) ⇒ <code>Promise</code>
1443
- Use this method to get a list of administrators in a chat
1444
-
1445
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1446
- **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.
1447
- If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned
1448
- **See**: https://core.telegram.org/bots/api#getchatadministrators
1449
-
1450
- | Param | Type | Description |
1451
- | --- | --- | --- |
1452
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
1453
- | [options] | <code>Object</code> | Additional Telegram query options |
1454
-
1455
- <a name="TelegramBot+getChatMemberCount"></a>
1456
-
1457
- ### telegramBot.getChatMemberCount(chatId, [options]) ⇒ <code>Promise</code>
1458
- Use this method to get the number of members in a chat.
1459
-
1460
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1461
- **Returns**: <code>Promise</code> - Int on success
1462
- **See**: https://core.telegram.org/bots/api#getchatmembercount
1463
-
1464
- | Param | Type | Description |
1465
- | --- | --- | --- |
1466
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
1467
- | [options] | <code>Object</code> | Additional Telegram query options |
1468
-
1469
- <a name="TelegramBot+getChatMember"></a>
1470
-
1471
- ### telegramBot.getChatMember(chatId, userId, [options]) ⇒ <code>Promise</code>
1472
- Use this method to get information about a member of a chat.
1473
-
1474
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1475
- **Returns**: <code>Promise</code> - [ChatMember](https://core.telegram.org/bots/api#chatmember) object on success
1476
- **See**: https://core.telegram.org/bots/api#getchatmember
1477
-
1478
- | Param | Type | Description |
1479
- | --- | --- | --- |
1480
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup |
1481
- | userId | <code>Number</code> | Unique identifier of the target user |
1482
- | [options] | <code>Object</code> | Additional Telegram query options |
1483
-
1484
- <a name="TelegramBot+setChatStickerSet"></a>
1485
-
1486
- ### telegramBot.setChatStickerSet(chatId, stickerSetName, [options]) ⇒ <code>Promise</code>
1487
- Use this method to set a new group sticker set for a supergroup.
1488
-
1489
- The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
1490
-
1491
- **Note:** Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
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#setchatstickerset
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
- | stickerSetName | <code>String</code> | Name of the sticker set to be set as the group sticker set |
1501
- | [options] | <code>Object</code> | Additional Telegram query options |
1502
-
1503
- <a name="TelegramBot+deleteChatStickerSet"></a>
1504
-
1505
- ### telegramBot.deleteChatStickerSet(chatId, [options]) ⇒ <code>Promise</code>
1506
- Use this method to delete a group sticker set from a supergroup.
1507
-
1508
- Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
1509
-
1510
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1511
- **Returns**: <code>Promise</code> - True on success
1512
- **See**: https://core.telegram.org/bots/api#deletechatstickerset
1513
-
1514
- | Param | Type | Description |
1515
- | --- | --- | --- |
1516
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1517
- | [options] | <code>Object</code> | Additional Telegram query options |
1518
-
1519
- <a name="TelegramBot+getForumTopicIconStickers"></a>
1520
-
1521
- ### telegramBot.getForumTopicIconStickers(chatId, [options]) ⇒ <code>Promise</code>
1522
- Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.
1523
-
1524
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1525
- **Returns**: <code>Promise</code> - Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects
1526
- **See**: https://core.telegram.org/bots/api#getforumtopiciconstickers
1527
-
1528
- | Param | Type | Description |
1529
- | --- | --- | --- |
1530
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1531
- | [options] | <code>Object</code> | Additional Telegram query options |
1532
-
1533
- <a name="TelegramBot+createForumTopic"></a>
1534
-
1535
- ### telegramBot.createForumTopic(chatId, name, [options])
1536
- Use this method to create a topic in a forum supergroup chat.
1537
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
1538
-
1539
- Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.
1540
-
1541
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1542
- **See**: https://core.telegram.org/bots/api#createforumtopic
1543
-
1544
- | Param | Type | Description |
1545
- | --- | --- | --- |
1546
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1547
- | name | <code>String</code> | Topic name, 1-128 characters |
1548
- | [options] | <code>Object</code> | Additional Telegram query options |
1549
-
1550
- <a name="TelegramBot+editForumTopic"></a>
1551
-
1552
- ### telegramBot.editForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
1553
- Use this method to edit name and icon of a topic in a forum supergroup chat.
1554
- The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.
1555
-
1556
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1557
- **Returns**: <code>Promise</code> - True on success
1558
- **See**: https://core.telegram.org/bots/api#editforumtopic
1559
-
1560
- | Param | Type | Description |
1561
- | --- | --- | --- |
1562
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1563
- | messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
1564
- | [options] | <code>Object</code> | Additional Telegram query options |
1565
-
1566
- <a name="TelegramBot+closeForumTopic"></a>
1567
-
1568
- ### telegramBot.closeForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
1569
- Use this method to close an open topic in a forum supergroup chat.
1570
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
1571
-
1572
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1573
- **Returns**: <code>Promise</code> - True on success
1574
- **See**: https://core.telegram.org/bots/api#closeforumtopic
1575
-
1576
- | Param | Type | Description |
1577
- | --- | --- | --- |
1578
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1579
- | messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
1580
- | [options] | <code>Object</code> | Additional Telegram query options |
1581
-
1582
- <a name="TelegramBot+reopenForumTopic"></a>
1583
-
1584
- ### telegramBot.reopenForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
1585
- Use this method to reopen a closed topic in a forum supergroup chat.
1586
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
1587
-
1588
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1589
- **Returns**: <code>Promise</code> - True on success
1590
- **See**: https://core.telegram.org/bots/api#reopenforumtopic
1591
-
1592
- | Param | Type | Description |
1593
- | --- | --- | --- |
1594
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1595
- | messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
1596
- | [options] | <code>Object</code> | Additional Telegram query options |
1597
-
1598
- <a name="TelegramBot+deleteForumTopic"></a>
1599
-
1600
- ### telegramBot.deleteForumTopic(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
1601
- Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
1602
- The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.
1603
-
1604
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1605
- **Returns**: <code>Promise</code> - True on success
1606
- **See**: https://core.telegram.org/bots/api#deleteforumtopic
1607
-
1608
- | Param | Type | Description |
1609
- | --- | --- | --- |
1610
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1611
- | messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
1612
- | [options] | <code>Object</code> | Additional Telegram query options |
1613
-
1614
- <a name="TelegramBot+unpinAllForumTopicMessages"></a>
1615
-
1616
- ### telegramBot.unpinAllForumTopicMessages(chatId, messageThreadId, [options]) ⇒ <code>Promise</code>
1617
- Use this method to clear the list of pinned messages in a forum topic.
1618
- The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
1619
-
1620
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1621
- **Returns**: <code>Promise</code> - True on success
1622
- **See**: https://core.telegram.org/bots/api#unpinallforumtopicmessages
1623
-
1624
- | Param | Type | Description |
1625
- | --- | --- | --- |
1626
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1627
- | messageThreadId | <code>Number</code> | Unique identifier for the target message thread of the forum topic |
1628
- | [options] | <code>Object</code> | Additional Telegram query options |
1629
-
1630
- <a name="TelegramBot+editGeneralForumTopic"></a>
1631
-
1632
- ### telegramBot.editGeneralForumTopic(chatId, name, [options]) ⇒ <code>Promise</code>
1633
- Use this method to edit the name of the 'General' topic in a forum supergroup chat.
1634
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
1635
- The topic will be automatically unhidden if it was hidden.
1636
-
1637
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1638
- **Returns**: <code>Promise</code> - True on success
1639
- **See**: https://core.telegram.org/bots/api#editgeneralforumtopic
1640
-
1641
- | Param | Type | Description |
1642
- | --- | --- | --- |
1643
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1644
- | name | <code>String</code> | New topic name, 1-128 characters |
1645
- | [options] | <code>Object</code> | Additional Telegram query options |
1646
-
1647
- <a name="TelegramBot+closeGeneralForumTopic"></a>
1648
-
1649
- ### telegramBot.closeGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
1650
- Use this method to close an open 'General' topic in a forum supergroup chat.
1651
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
1652
- The topic will be automatically unhidden if it was hidden.
1653
-
1654
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1655
- **Returns**: <code>Promise</code> - True on success
1656
- **See**: https://core.telegram.org/bots/api#closegeneralforumtopic
1657
-
1658
- | Param | Type | Description |
1659
- | --- | --- | --- |
1660
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1661
- | [options] | <code>Object</code> | Additional Telegram query options |
1662
-
1663
- <a name="TelegramBot+reopenGeneralForumTopic"></a>
1664
-
1665
- ### telegramBot.reopenGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
1666
- Use this method to reopen a closed 'General' topic in a forum supergroup chat.
1667
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
1668
- The topic will be automatically unhidden if it was hidden.
1669
-
1670
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1671
- **Returns**: <code>Promise</code> - True on success
1672
- **See**: https://core.telegram.org/bots/api#reopengeneralforumtopic
1673
-
1674
- | Param | Type | Description |
1675
- | --- | --- | --- |
1676
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1677
- | [options] | <code>Object</code> | Additional Telegram query options |
1678
-
1679
- <a name="TelegramBot+hideGeneralForumTopic"></a>
1680
-
1681
- ### telegramBot.hideGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
1682
- Use this method to hide the 'General' topic in a forum supergroup chat.
1683
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
1684
- The topic will be automatically closed if it was open.
1685
-
1686
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1687
- **Returns**: <code>Promise</code> - True on success
1688
- **See**: https://core.telegram.org/bots/api#hidegeneralforumtopic
1689
-
1690
- | Param | Type | Description |
1691
- | --- | --- | --- |
1692
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1693
- | [options] | <code>Object</code> | Additional Telegram query options |
1694
-
1695
- <a name="TelegramBot+unhideGeneralForumTopic"></a>
1696
-
1697
- ### telegramBot.unhideGeneralForumTopic(chatId, [options]) ⇒ <code>Promise</code>
1698
- Use this method to unhide the 'General' topic in a forum supergroup chat.
1699
- The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
1700
-
1701
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1702
- **Returns**: <code>Promise</code> - True on success
1703
- **See**: https://core.telegram.org/bots/api#unhidegeneralforumtopic
1704
-
1705
- | Param | Type | Description |
1706
- | --- | --- | --- |
1707
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1708
- | [options] | <code>Object</code> | Additional Telegram query options |
1709
-
1710
- <a name="TelegramBot+unpinAllGeneralForumTopicMessages"></a>
1711
-
1712
- ### telegramBot.unpinAllGeneralForumTopicMessages(chatId, [options]) ⇒ <code>Promise</code>
1713
- Use this method to clear the list of pinned messages in a General forum topic.
1714
- The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
1715
-
1716
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1717
- **Returns**: <code>Promise</code> - True on success
1718
- **See**: https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
1719
-
1720
- | Param | Type | Description |
1721
- | --- | --- | --- |
1722
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) |
1723
- | [options] | <code>Object</code> | Additional Telegram query options |
1724
-
1725
- <a name="TelegramBot+answerCallbackQuery"></a>
1726
-
1727
- ### telegramBot.answerCallbackQuery(callbackQueryId, [options]) ⇒ <code>Promise</code>
1728
- Use this method to send answers to callback queries sent from
1729
- [inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).
1730
-
1731
- The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
1732
-
1733
- This method has **older, compatible signatures ([1][answerCallbackQuery-v0.27.1])([2][answerCallbackQuery-v0.29.0])**
1734
- that are being deprecated.
1735
-
1736
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1737
- **Returns**: <code>Promise</code> - True on success
1738
- **See**: https://core.telegram.org/bots/api#answercallbackquery
1739
-
1740
- | Param | Type | Description |
1741
- | --- | --- | --- |
1742
- | callbackQueryId | <code>String</code> | Unique identifier for the query to be answered |
1743
- | [options] | <code>Object</code> | Additional Telegram query options |
1744
-
1745
- <a name="TelegramBot+getUserChatBoosts"></a>
1746
-
1747
- ### telegramBot.getUserChatBoosts(chatId, user_id, [options]) ⇒ <code>Promise</code>
1748
- Use this method to get the list of boosts added to a chat by a use.
1749
- Requires administrator rights in the chat
1750
-
1751
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1752
- **Returns**: <code>Promise</code> - On success, returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object
1753
- **See**: https://core.telegram.org/bots/api#getuserchatboosts
1754
-
1755
- | Param | Type | Description |
1756
- | --- | --- | --- |
1757
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
1758
- | user_id | <code>Number</code> | Unique identifier of the target user |
1759
- | [options] | <code>Object</code> | Additional Telegram query options |
1760
-
1761
- <a name="TelegramBot+getBusinessConnection"></a>
1762
-
1763
- ### telegramBot.getBusinessConnection(businessConnectionId, [options]) ⇒ <code>Promise</code>
1764
- Use this method to get information about the connection of the bot with a business account
1765
-
1766
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1767
- **Returns**: <code>Promise</code> - On success, returns [BusinessConnection](https://core.telegram.org/bots/api#businessconnection) object
1768
- **See**: https://core.telegram.org/bots/api#getbusinessconnection
1769
-
1770
- | Param | Type | Description |
1771
- | --- | --- | --- |
1772
- | businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
1773
- | [options] | <code>Object</code> | Additional Telegram query options |
1774
-
1775
- <a name="TelegramBot+setMyCommands"></a>
1776
-
1777
- ### telegramBot.setMyCommands(commands, [options]) ⇒ <code>Promise</code>
1778
- Use this method to change the list of the bot's commands.
1779
-
1780
- See https://core.telegram.org/bots#commands for more details about bot commands
1781
-
1782
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1783
- **Returns**: <code>Promise</code> - True on success
1784
- **See**: https://core.telegram.org/bots/api#setmycommands
1785
-
1786
- | Param | Type | Description |
1787
- | --- | --- | --- |
1788
- | 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. |
1789
- | [options] | <code>Object</code> | Additional Telegram query options |
1790
-
1791
- <a name="TelegramBot+deleteMyCommands"></a>
1792
-
1793
- ### telegramBot.deleteMyCommands([options]) ⇒ <code>Promise</code>
1794
- Use this method to delete the list of the bot's commands for the given scope and user language.
1795
-
1796
- After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.
1797
-
1798
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1799
- **Returns**: <code>Promise</code> - True on success
1800
- **See**: https://core.telegram.org/bots/api#deletemycommands
1801
-
1802
- | Param | Type | Description |
1803
- | --- | --- | --- |
1804
- | [options] | <code>Object</code> | Additional Telegram query options |
1805
-
1806
- <a name="TelegramBot+getMyCommands"></a>
1807
-
1808
- ### telegramBot.getMyCommands([options]) ⇒ <code>Promise</code>
1809
- Use this method to get the current list of the bot's commands for the given scope and user language.
1810
-
1811
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1812
- **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.
1813
- **See**: https://core.telegram.org/bots/api#getmycommands
1814
-
1815
- | Param | Type | Description |
1816
- | --- | --- | --- |
1817
- | [options] | <code>Object</code> | Additional Telegram query options |
1818
-
1819
- <a name="TelegramBot+setMyName"></a>
1820
-
1821
- ### telegramBot.setMyName([options]) ⇒ <code>Promise</code>
1822
- Use this method to change the bot's name.
1823
-
1824
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1825
- **Returns**: <code>Promise</code> - True on success
1826
- **See**: https://core.telegram.org/bots/api#setmyname
1827
-
1828
- | Param | Type | Description |
1829
- | --- | --- | --- |
1830
- | [options] | <code>Object</code> | Additional Telegram query options |
1831
-
1832
- <a name="TelegramBot+getMyName"></a>
1833
-
1834
- ### telegramBot.getMyName([options]) ⇒ <code>Promise</code>
1835
- Use this method to get the current bot name for the given user language.
1836
-
1837
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1838
- **Returns**: <code>Promise</code> - [BotName](https://core.telegram.org/bots/api#botname) on success
1839
- **See**: https://core.telegram.org/bots/api#getmyname
1840
-
1841
- | Param | Type | Description |
1842
- | --- | --- | --- |
1843
- | [options] | <code>Object</code> | Additional Telegram query options |
1844
-
1845
- <a name="TelegramBot+setMyDescription"></a>
1846
-
1847
- ### telegramBot.setMyDescription([options]) ⇒ <code>Promise</code>
1848
- Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
1849
-
1850
- Returns True on success.
1851
-
1852
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1853
- **Returns**: <code>Promise</code> - True on success
1854
- **See**: https://core.telegram.org/bots/api#setmydescription
1855
-
1856
- | Param | Type | Description |
1857
- | --- | --- | --- |
1858
- | [options] | <code>Object</code> | Additional Telegram query options |
1859
-
1860
- <a name="TelegramBot+getMyDescription"></a>
1861
-
1862
- ### telegramBot.getMyDescription([options]) ⇒ <code>Promise</code>
1863
- Use this method to get the current bot description for the given user language.
1864
-
1865
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1866
- **Returns**: <code>Promise</code> - Returns [BotDescription](https://core.telegram.org/bots/api#botdescription) on success.
1867
- **See**: https://core.telegram.org/bots/api#getmydescription
1868
-
1869
- | Param | Type | Description |
1870
- | --- | --- | --- |
1871
- | [options] | <code>Object</code> | Additional Telegram query options |
1872
-
1873
- <a name="TelegramBot+setMyShortDescription"></a>
1874
-
1875
- ### telegramBot.setMyShortDescription([options]) ⇒ <code>Promise</code>
1876
- Use this method to change the bot's short description, which is shown on the bot's profile page
1877
- and is sent together with the link when users share the bot.
1878
-
1879
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1880
- **Returns**: <code>Promise</code> - Returns True on success.
1881
- **See**: https://core.telegram.org/bots/api#setmyshortdescription
1882
-
1883
- | Param | Type | Description |
1884
- | --- | --- | --- |
1885
- | [options] | <code>Object</code> | Additional Telegram query options |
1886
-
1887
- <a name="TelegramBot+getMyShortDescription"></a>
1888
-
1889
- ### telegramBot.getMyShortDescription([options]) ⇒ <code>Promise</code>
1890
- Use this method to get the current bot short description for the given user language.
1891
-
1892
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1893
- **Returns**: <code>Promise</code> - Returns [BotShortDescription](https://core.telegram.org/bots/api#botshortdescription) on success.
1894
- **See**: https://core.telegram.org/bots/api#getmyshortdescription
1895
-
1896
- | Param | Type | Description |
1897
- | --- | --- | --- |
1898
- | [options] | <code>Object</code> | Additional Telegram query options |
1899
-
1900
- <a name="TelegramBot+setChatMenuButton"></a>
1901
-
1902
- ### telegramBot.setChatMenuButton([options]) ⇒ <code>Promise</code>
1903
- Use this method to change the bot's menu button in a private chat, or the default menu button.
1904
-
1905
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1906
- **Returns**: <code>Promise</code> - True on success
1907
- **See**: https://core.telegram.org/bots/api#setchatmenubutton
1908
-
1909
- | Param | Type | Description |
1910
- | --- | --- | --- |
1911
- | [options] | <code>Object</code> | Additional Telegram query options |
1912
-
1913
- <a name="TelegramBot+getChatMenuButton"></a>
1914
-
1915
- ### telegramBot.getChatMenuButton([options]) ⇒ <code>Promise</code>
1916
- Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
1917
-
1918
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1919
- **Returns**: <code>Promise</code> - [MenuButton](https://core.telegram.org/bots/api#menubutton) on success
1920
- **See**: https://core.telegram.org/bots/api#getchatmenubutton
1921
-
1922
- | Param | Type | Description |
1923
- | --- | --- | --- |
1924
- | [options] | <code>Object</code> | Additional Telegram query options |
1925
-
1926
- <a name="TelegramBot+setMyDefaultAdministratorRights"></a>
1927
-
1928
- ### telegramBot.setMyDefaultAdministratorRights([options]) ⇒ <code>Promise</code>
1929
- Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
1930
-
1931
- These rights will be suggested to users, but they are are free to modify the list before adding the bot.
1932
-
1933
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1934
- **Returns**: <code>Promise</code> - True on success
1935
- **See**: https://core.telegram.org/bots/api#getchatmenubutton
1936
-
1937
- | Param | Type | Description |
1938
- | --- | --- | --- |
1939
- | [options] | <code>Object</code> | Additional Telegram query options |
1940
-
1941
- <a name="TelegramBot+getMyDefaultAdministratorRights"></a>
1942
-
1943
- ### telegramBot.getMyDefaultAdministratorRights([options]) ⇒ <code>Promise</code>
1944
- Use this method to get the current default administrator rights of the bot.
1945
-
1946
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1947
- **Returns**: <code>Promise</code> - [ChatAdministratorRights](https://core.telegram.org/bots/api#chatadministratorrights) on success
1948
- **See**: https://core.telegram.org/bots/api#getmydefaultadministratorrights
1949
-
1950
- | Param | Type | Description |
1951
- | --- | --- | --- |
1952
- | [options] | <code>Object</code> | Additional Telegram query options |
1953
-
1954
- <a name="TelegramBot+editMessageText"></a>
1955
-
1956
- ### telegramBot.editMessageText(text, [options]) ⇒ <code>Promise</code>
1957
- 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).
1958
-
1959
- Note: that **you must provide one of chat_id, message_id, or inline_message_id** in your request.
1960
-
1961
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1962
- **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
1963
- **See**: https://core.telegram.org/bots/api#editmessagetext
1964
-
1965
- | Param | Type | Description |
1966
- | --- | --- | --- |
1967
- | text | <code>String</code> | New text of the message |
1968
- | [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
1969
-
1970
- <a name="TelegramBot+editMessageCaption"></a>
1971
-
1972
- ### telegramBot.editMessageCaption(caption, [options]) ⇒ <code>Promise</code>
1973
- Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
1974
-
1975
- Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
1976
-
1977
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1978
- **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
1979
- **See**: https://core.telegram.org/bots/api#editmessagecaption
1980
-
1981
- | Param | Type | Description |
1982
- | --- | --- | --- |
1983
- | caption | <code>String</code> | New caption of the message |
1984
- | [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
1985
-
1986
- <a name="TelegramBot+editMessageMedia"></a>
1987
-
1988
- ### telegramBot.editMessageMedia(media, [options]) ⇒ <code>Promise</code>
1989
- Use this method to edit animation, audio, document, photo, or video messages.
1990
-
1991
- If a message is a part of a message album, then it can be edited only to a photo or a video.
1992
-
1993
- Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
1994
- Use previously uploaded file via its file_id or specify a URL.
1995
-
1996
- Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
1997
-
1998
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
1999
- **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
2000
- **See**: https://core.telegram.org/bots/api#editmessagemedia
2001
-
2002
- | Param | Type | Description |
2003
- | --- | --- | --- |
2004
- | media | <code>Object</code> | A JSON-serialized object for a new media content of the message |
2005
- | [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
2006
-
2007
- <a name="TelegramBot+editMessageReplyMarkup"></a>
2008
-
2009
- ### telegramBot.editMessageReplyMarkup(replyMarkup, [options]) ⇒ <code>Promise</code>
2010
- Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
2011
-
2012
- Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
2013
-
2014
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2015
- **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
2016
- **See**: https://core.telegram.org/bots/api#editmessagetext
2017
-
2018
- | Param | Type | Description |
2019
- | --- | --- | --- |
2020
- | replyMarkup | <code>Object</code> | A JSON-serialized object for an inline keyboard. |
2021
- | [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
2022
-
2023
- <a name="TelegramBot+stopPoll"></a>
2024
-
2025
- ### telegramBot.stopPoll(chatId, pollId, [options]) ⇒ <code>Promise</code>
2026
- Use this method to stop a poll which was sent by the bot.
2027
-
2028
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2029
- **Returns**: <code>Promise</code> - On success, the stopped [Poll](https://core.telegram.org/bots/api#poll) is returned
2030
- **See**: https://core.telegram.org/bots/api#stoppoll
2031
-
2032
- | Param | Type | Description |
2033
- | --- | --- | --- |
2034
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
2035
- | pollId | <code>Number</code> | Identifier of the original message with the poll |
2036
- | [options] | <code>Object</code> | Additional Telegram query options |
2037
-
2038
- <a name="TelegramBot+sendSticker"></a>
2039
-
2040
- ### telegramBot.sendSticker(chatId, sticker, [options], [fileOptions]) ⇒ <code>Promise</code>
2041
- Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
2042
- or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.
2043
-
2044
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2045
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
2046
- **See**: https://core.telegram.org/bots/api#sendsticker
2047
-
2048
- | Param | Type | Description |
2049
- | --- | --- | --- |
2050
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
2051
- | 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. |
2052
- | [options] | <code>Object</code> | Additional Telegram query options |
2053
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
2054
-
2055
- <a name="TelegramBot+getStickerSet"></a>
2056
-
2057
- ### telegramBot.getStickerSet(name, [options]) ⇒ <code>Promise</code>
2058
- Use this method to get a sticker set.
2059
-
2060
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2061
- **Returns**: <code>Promise</code> - On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned
2062
- **See**: https://core.telegram.org/bots/api#getstickerset
2063
-
2064
- | Param | Type | Description |
2065
- | --- | --- | --- |
2066
- | name | <code>String</code> | Name of the sticker set |
2067
- | [options] | <code>Object</code> | Additional Telegram query options |
2068
-
2069
- <a name="TelegramBot+getCustomEmojiStickers"></a>
2070
-
2071
- ### telegramBot.getCustomEmojiStickers(custom_emoji_ids, [options]) ⇒ <code>Promise</code>
2072
- Use this method to get information about custom emoji stickers by their identifiers.
2073
-
2074
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2075
- **Returns**: <code>Promise</code> - Array of [Sticker](https://core.telegram.org/bots/api#sticker) objects.
2076
- **See**: https://core.telegram.org/bots/api#getcustomemojistickers
2077
-
2078
- | Param | Type | Description |
2079
- | --- | --- | --- |
2080
- | custom_emoji_ids | <code>Array</code> | List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. |
2081
- | [options] | <code>Object</code> | Additional Telegram query options |
2082
-
2083
- <a name="TelegramBot+uploadStickerFile"></a>
2084
-
2085
- ### telegramBot.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions]) ⇒ <code>Promise</code>
2086
- Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
2087
- times).
2088
-
2089
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2090
- **Returns**: <code>Promise</code> - On success, a [File](https://core.telegram.org/bots/api#file) object is returned
2091
- **See**: https://core.telegram.org/bots/api#uploadstickerfile
2092
-
2093
- | Param | Type | Default | Description |
2094
- | --- | --- | --- | --- |
2095
- | userId | <code>Number</code> | | User identifier of sticker file owner |
2096
- | 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. |
2097
- | stickerFormat | <code>String</code> | <code>static</code> | Allow values: `static`, `animated` or `video` |
2098
- | [options] | <code>Object</code> | | Additional Telegram query options |
2099
- | [fileOptions] | <code>Object</code> | | Optional file related meta-data |
2100
-
2101
- <a name="TelegramBot+createNewStickerSet"></a>
2102
-
2103
- ### telegramBot.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions]) ⇒ <code>Promise</code>
2104
- Use this method to create new sticker set owned by a user.
2105
-
2106
- The bot will be able to edit the created sticker set.
2107
-
2108
- You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
2109
-
2110
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2111
- **Returns**: <code>Promise</code> - True on success
2112
- **See**: https://core.telegram.org/bots/api#createnewstickerset
2113
-
2114
- | Param | Type | Description |
2115
- | --- | --- | --- |
2116
- | userId | <code>Number</code> | User identifier of created sticker set owner |
2117
- | 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. |
2118
- | title | <code>String</code> | Sticker set title, 1-64 characters |
2119
- | 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. |
2120
- | emojis | <code>String</code> | One or more emoji corresponding to the sticker |
2121
- | [options] | <code>Object</code> | Additional Telegram query options |
2122
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
2123
-
2124
- <a name="TelegramBot+addStickerToSet"></a>
2125
-
2126
- ### telegramBot.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions]) ⇒ <code>Promise</code>
2127
- Use this method to add a new sticker to a set created by the bot.
2128
-
2129
- You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
2130
-
2131
- Animated stickers can be added to animated sticker sets and only to them
2132
-
2133
- Note:
2134
- - Emoji sticker sets can have up to 200 sticker
2135
- - Static or Animated sticker sets can have up to 120 stickers
2136
-
2137
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2138
- **Returns**: <code>Promise</code> - True on success
2139
- **See**: https://core.telegram.org/bots/api#addstickertoset
2140
-
2141
- | Param | Type | Default | Description |
2142
- | --- | --- | --- | --- |
2143
- | userId | <code>Number</code> | | User identifier of sticker set owner |
2144
- | name | <code>String</code> | | Sticker set name |
2145
- | 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. |
2146
- | emojis | <code>String</code> | | One or more emoji corresponding to the sticker |
2147
- | stickerType | <code>String</code> | <code>png_sticker</code> | Allow values: `png_sticker`, `tgs_sticker`, or `webm_sticker`. |
2148
- | [options] | <code>Object</code> | | Additional Telegram query options |
2149
- | [fileOptions] | <code>Object</code> | | Optional file related meta-data |
2150
-
2151
- <a name="TelegramBot+setStickerPositionInSet"></a>
2152
-
2153
- ### telegramBot.setStickerPositionInSet(sticker, position, [options]) ⇒ <code>Promise</code>
2154
- Use this method to move a sticker in a set created by the bot to a specific position.
2155
-
2156
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2157
- **Returns**: <code>Promise</code> - True on success
2158
- **See**: https://core.telegram.org/bots/api#setstickerpositioninset
2159
-
2160
- | Param | Type | Description |
2161
- | --- | --- | --- |
2162
- | sticker | <code>String</code> | File identifier of the sticker |
2163
- | position | <code>Number</code> | New sticker position in the set, zero-based |
2164
- | [options] | <code>Object</code> | Additional Telegram query options |
2165
-
2166
- <a name="TelegramBot+deleteStickerFromSet"></a>
2167
-
2168
- ### telegramBot.deleteStickerFromSet(sticker, [options]) ⇒ <code>Promise</code>
2169
- Use this method to delete a sticker from a set created by the bot.
2170
-
2171
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2172
- **Returns**: <code>Promise</code> - True on success
2173
- **See**: https://core.telegram.org/bots/api#deletestickerfromset
2174
- **Todo**
2175
-
2176
- - [ ] Add tests for this method!
2177
-
2178
-
2179
- | Param | Type | Description |
2180
- | --- | --- | --- |
2181
- | sticker | <code>String</code> | File identifier of the sticker |
2182
- | [options] | <code>Object</code> | Additional Telegram query options |
2183
-
2184
- <a name="TelegramBot+replaceStickerInSet"></a>
2185
-
2186
- ### telegramBot.replaceStickerInSet(user_id, name, sticker, [options]) ⇒ <code>Promise</code>
2187
- Use this method to replace an existing sticker in a sticker set with a new one
2188
-
2189
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2190
- **Returns**: <code>Promise</code> - True on success
2191
- **See**: https://core.telegram.org/bots/api#replacestickerinset
2192
- **Todo**
2193
-
2194
- - [ ] Add tests for this method!
2195
-
2196
-
2197
- | Param | Type | Description |
2198
- | --- | --- | --- |
2199
- | user_id | <code>Number</code> | User identifier of the sticker set owner |
2200
- | name | <code>String</code> | Sticker set name |
2201
- | sticker | <code>String</code> | File identifier of the sticker |
2202
- | [options] | <code>Object</code> | Additional Telegram query options |
2203
-
2204
- <a name="TelegramBot+setStickerEmojiList"></a>
2205
-
2206
- ### telegramBot.setStickerEmojiList(sticker, emojiList, [options]) ⇒ <code>Promise</code>
2207
- Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
2208
-
2209
- The sticker must belong to a sticker set created by the bot.
2210
-
2211
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2212
- **Returns**: <code>Promise</code> - True on success
2213
- **See**: https://core.telegram.org/bots/api#setstickeremojilist
2214
-
2215
- | Param | Type | Description |
2216
- | --- | --- | --- |
2217
- | sticker | <code>String</code> | File identifier of the sticker |
2218
- | emojiList | <code>Array</code> | A JSON-serialized list of 1-20 emoji associated with the sticker |
2219
- | [options] | <code>Object</code> | Additional Telegram query options |
2220
-
2221
- <a name="TelegramBot+setStickerKeywords"></a>
2222
-
2223
- ### telegramBot.setStickerKeywords(sticker, [options]) ⇒ <code>Promise</code>
2224
- Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.
2225
-
2226
- The sticker must belong to a sticker set created by the bot.
2227
-
2228
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2229
- **Returns**: <code>Promise</code> - True on success
2230
- **See**: https://core.telegram.org/bots/api#setstickerkeywords
2231
-
2232
- | Param | Type | Description |
2233
- | --- | --- | --- |
2234
- | sticker | <code>String</code> | File identifier of the sticker |
2235
- | [options] | <code>Object</code> | Additional Telegram query options |
2236
-
2237
- <a name="TelegramBot+setStickerMaskPosition"></a>
2238
-
2239
- ### telegramBot.setStickerMaskPosition(sticker, [options]) ⇒ <code>Promise</code>
2240
- Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.
2241
-
2242
- The sticker must belong to a sticker set created by the bot.
2243
-
2244
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2245
- **Returns**: <code>Promise</code> - True on success
2246
- **See**: https://core.telegram.org/bots/api#setstickermaskposition
2247
-
2248
- | Param | Type | Description |
2249
- | --- | --- | --- |
2250
- | sticker | <code>String</code> | File identifier of the sticker |
2251
- | [options] | <code>Object</code> | Additional Telegram query options |
2252
-
2253
- <a name="TelegramBot+setStickerSetTitle"></a>
2254
-
2255
- ### telegramBot.setStickerSetTitle(name, title, [options]) ⇒ <code>Promise</code>
2256
- Use this method to set the title of a created sticker set.
2257
-
2258
- The sticker must belong to a sticker set created by the bot.
2259
-
2260
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2261
- **Returns**: <code>Promise</code> - True on success
2262
- **See**: https://core.telegram.org/bots/api#setstickersettitle
2263
-
2264
- | Param | Type | Description |
2265
- | --- | --- | --- |
2266
- | name | <code>String</code> | Sticker set name |
2267
- | title | <code>String</code> | Sticker set title, 1-64 characters |
2268
- | [options] | <code>Object</code> | Additional Telegram query options |
2269
-
2270
- <a name="TelegramBot+setStickerSetThumbnail"></a>
2271
-
2272
- ### telegramBot.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions]) ⇒ <code>Promise</code>
2273
- Use this method to add a thumb to a set created by the bot.
2274
-
2275
- Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only
2276
-
2277
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2278
- **Returns**: <code>Promise</code> - True on success
2279
- **See**: https://core.telegram.org/bots/api#setstickersetthumbnail
2280
-
2281
- | Param | Type | Description |
2282
- | --- | --- | --- |
2283
- | userId | <code>Number</code> | User identifier of sticker set owner |
2284
- | name | <code>String</code> | Sticker set name |
2285
- | 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. |
2286
- | [options] | <code>Object</code> | Additional Telegram query options |
2287
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
2288
-
2289
- <a name="TelegramBot+setCustomEmojiStickerSetThumbnail"></a>
2290
-
2291
- ### telegramBot.setCustomEmojiStickerSetThumbnail(name, [options]) ⇒ <code>Promise</code>
2292
- Use this method to set the thumbnail of a custom emoji sticker set.
2293
-
2294
- The sticker must belong to a sticker set created by the bot.
2295
-
2296
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2297
- **Returns**: <code>Promise</code> - True on success
2298
- **See**: https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
2299
-
2300
- | Param | Type | Description |
2301
- | --- | --- | --- |
2302
- | name | <code>String</code> | Sticker set name |
2303
- | [options] | <code>Object</code> | Additional Telegram query options |
2304
-
2305
- <a name="TelegramBot+deleteStickerSet"></a>
2306
-
2307
- ### telegramBot.deleteStickerSet(name, [options]) ⇒ <code>Promise</code>
2308
- Use this method to delete a sticker set that was created by the bot.
2309
-
2310
- The sticker must belong to a sticker set created by the bot.
2311
-
2312
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2313
- **Returns**: <code>Promise</code> - True on success
2314
- **See**: https://core.telegram.org/bots/api#deletestickerset
2315
-
2316
- | Param | Type | Description |
2317
- | --- | --- | --- |
2318
- | name | <code>String</code> | Sticker set name |
2319
- | [options] | <code>Object</code> | Additional Telegram query options |
2320
-
2321
- <a name="TelegramBot+answerInlineQuery"></a>
2322
-
2323
- ### telegramBot.answerInlineQuery(inlineQueryId, results, [options]) ⇒ <code>Promise</code>
2324
- Send answers to an inline query.
2325
-
2326
- Note: No more than 50 results per query are allowed.
2327
-
2328
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2329
- **Returns**: <code>Promise</code> - On success, True is returned
2330
- **See**: https://core.telegram.org/bots/api#answerinlinequery
2331
-
2332
- | Param | Type | Description |
2333
- | --- | --- | --- |
2334
- | inlineQueryId | <code>String</code> | Unique identifier of the query |
2335
- | results | <code>Array.&lt;InlineQueryResult&gt;</code> | An array of results for the inline query |
2336
- | [options] | <code>Object</code> | Additional Telegram query options |
2337
-
2338
- <a name="TelegramBot+answerWebAppQuery"></a>
2339
-
2340
- ### telegramBot.answerWebAppQuery(webAppQueryId, result, [options]) ⇒ <code>Promise</code>
2341
- Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
2342
- and send a corresponding message on behalf of the user to the chat from which the query originated.
2343
-
2344
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2345
- **Returns**: <code>Promise</code> - On success, a [SentWebAppMessage](https://core.telegram.org/bots/api#sentwebappmessage) object is returned
2346
- **See**: https://core.telegram.org/bots/api#answerwebappquery
2347
-
2348
- | Param | Type | Description |
2349
- | --- | --- | --- |
2350
- | webAppQueryId | <code>String</code> | Unique identifier for the query to be answered |
2351
- | result | <code>InlineQueryResult</code> | object that represents one result of an inline query |
2352
- | [options] | <code>Object</code> | Additional Telegram query options |
2353
-
2354
- <a name="TelegramBot+sendInvoice"></a>
2355
-
2356
- ### telegramBot.sendInvoice(chatId, title, description, payload, providerToken, currency, prices, [options]) ⇒ <code>Promise</code>
2357
- Use this method to send an invoice.
2358
-
2359
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2360
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
2361
- **See**: https://core.telegram.org/bots/api#sendinvoice
2362
-
2363
- | Param | Type | Description |
2364
- | --- | --- | --- |
2365
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
2366
- | title | <code>String</code> | Product name, 1-32 characters |
2367
- | description | <code>String</code> | Product description, 1-255 characters |
2368
- | payload | <code>String</code> | Bot defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. |
2369
- | providerToken | <code>String</code> | Payments provider token, obtained via `@BotFather` |
2370
- | currency | <code>String</code> | Three-letter ISO 4217 currency code |
2371
- | prices | <code>Array</code> | Breakdown of prices |
2372
- | [options] | <code>Object</code> | Additional Telegram query options |
2373
-
2374
- <a name="TelegramBot+createInvoiceLink"></a>
2375
-
2376
- ### telegramBot.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options]) ⇒ <code>Promise</code>
2377
- Use this method to create a link for an invoice.
2378
-
2379
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2380
- **Returns**: <code>Promise</code> - The created invoice link as String on success.
2381
- **See**: https://core.telegram.org/bots/api#createinvoicelink
2382
-
2383
- | Param | Type | Description |
2384
- | --- | --- | --- |
2385
- | title | <code>String</code> | Product name, 1-32 characters |
2386
- | description | <code>String</code> | Product description, 1-255 characters |
2387
- | payload | <code>String</code> | Bot defined invoice payload |
2388
- | providerToken | <code>String</code> | Payment provider token |
2389
- | currency | <code>String</code> | Three-letter ISO 4217 currency code |
2390
- | prices | <code>Array</code> | Breakdown of prices |
2391
- | [options] | <code>Object</code> | Additional Telegram query options |
2392
-
2393
- <a name="TelegramBot+answerShippingQuery"></a>
2394
-
2395
- ### telegramBot.answerShippingQuery(shippingQueryId, ok, [options]) ⇒ <code>Promise</code>
2396
- Use this method to reply to shipping queries.
2397
-
2398
- If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
2399
- the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a shipping_query field to the bot
2400
-
2401
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2402
- **Returns**: <code>Promise</code> - On success, True is returned
2403
- **See**: https://core.telegram.org/bots/api#answershippingquery
2404
-
2405
- | Param | Type | Description |
2406
- | --- | --- | --- |
2407
- | shippingQueryId | <code>String</code> | Unique identifier for the query to be answered |
2408
- | ok | <code>Boolean</code> | Specify if delivery of the product is possible |
2409
- | [options] | <code>Object</code> | Additional Telegram query options |
2410
-
2411
- <a name="TelegramBot+answerPreCheckoutQuery"></a>
2412
-
2413
- ### telegramBot.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options]) ⇒ <code>Promise</code>
2414
- Use this method to respond to such pre-checkout queries
2415
-
2416
- Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of
2417
- an [Update](https://core.telegram.org/bots/api#update) with the field *pre_checkout_query*.
2418
-
2419
- **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
2420
-
2421
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2422
- **Returns**: <code>Promise</code> - On success, True is returned
2423
- **See**: https://core.telegram.org/bots/api#answerprecheckoutquery
2424
-
2425
- | Param | Type | Description |
2426
- | --- | --- | --- |
2427
- | preCheckoutQueryId | <code>String</code> | Unique identifier for the query to be answered |
2428
- | ok | <code>Boolean</code> | Specify if every order details are ok |
2429
- | [options] | <code>Object</code> | Additional Telegram query options |
2430
-
2431
- <a name="TelegramBot+sendGame"></a>
2432
-
2433
- ### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ <code>Promise</code>
2434
- Use this method to send a game.
2435
-
2436
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2437
- **Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
2438
- **See**: https://core.telegram.org/bots/api#sendgame
2439
-
2440
- | Param | Type | Description |
2441
- | --- | --- | --- |
2442
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
2443
- | gameShortName | <code>String</code> | name of the game to be sent. Set up your games via `@BotFather`. |
2444
- | [options] | <code>Object</code> | Additional Telegram query options |
2445
-
2446
- <a name="TelegramBot+setGameScore"></a>
2447
-
2448
- ### telegramBot.setGameScore(userId, score, [options]) ⇒ <code>Promise</code>
2449
- Use this method to set the score of the specified user in a game message.
2450
-
2451
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2452
- **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
2453
- **See**: https://core.telegram.org/bots/api#setgamescore
2454
-
2455
- | Param | Type | Description |
2456
- | --- | --- | --- |
2457
- | userId | <code>Number</code> | Unique identifier of the target user |
2458
- | score | <code>Number</code> | New score value, must be non-negative |
2459
- | [options] | <code>Object</code> | Additional Telegram query options |
2460
-
2461
- <a name="TelegramBot+getGameHighScores"></a>
2462
-
2463
- ### telegramBot.getGameHighScores(userId, [options]) ⇒ <code>Promise</code>
2464
- Use this method to get data for high score tables.
2465
-
2466
- Will return the score of the specified user and several of their neighbors in a game.
2467
-
2468
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2469
- **Returns**: <code>Promise</code> - On success, returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects
2470
- **See**: https://core.telegram.org/bots/api#getgamehighscores
2471
-
2472
- | Param | Type | Description |
2473
- | --- | --- | --- |
2474
- | userId | <code>Number</code> | Unique identifier of the target user |
2475
- | [options] | <code>Object</code> | Additional Telegram query options |
2476
-
2477
- <a name="TelegramBot+deleteMessage"></a>
2478
-
2479
- ### telegramBot.deleteMessage(chatId, messageId, [options]) ⇒ <code>Promise</code>
2480
- Use this method to delete a message, including service messages, with the following limitations:
2481
- - A message can only be deleted if it was sent less than 48 hours ago.
2482
- - A dice message can only be deleted if it was sent more than 24 hours ago.
2483
- - Bots can delete outgoing messages in groups and supergroups.
2484
- - Bots can delete incoming messages in groups, supergroups and channels.
2485
- - Bots granted `can_post_messages` permissions can delete outgoing messages in channels.
2486
- - If the bot is an administrator of a group, it can delete any message there.
2487
- - If the bot has `can_delete_messages` permission in a supergroup, it can delete any message there.
2488
-
2489
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2490
- **Returns**: <code>Promise</code> - True on success
2491
- **See**: https://core.telegram.org/bots/api#deletemessage
2492
-
2493
- | Param | Type | Description |
2494
- | --- | --- | --- |
2495
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
2496
- | messageId | <code>Number</code> | Unique identifier of the target message |
2497
- | [options] | <code>Object</code> | Additional Telegram query options |
2498
-
2499
- <a name="TelegramBot+deleteMessages"></a>
2500
-
2501
- ### telegramBot.deleteMessages(chatId, messageIds, [options]) ⇒ <code>Promise.&lt;Boolean&gt;</code>
2502
- Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.
2503
-
2504
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2505
- **Returns**: <code>Promise.&lt;Boolean&gt;</code> - True on success
2506
- **See**: https://core.telegram.org/bots/api#deletemessages
2507
-
2508
- | Param | Type | Description |
2509
- | --- | --- | --- |
2510
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
2511
- | messageIds | <code>Array.&lt;(Number\|String)&gt;</code> | Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted |
2512
- | [options] | <code>Object</code> | Additional Telegram query options |
2513
-
2514
- <a name="TelegramBot+refundStarPayment"></a>
2515
-
2516
- ### telegramBot.refundStarPayment(userId, telegramPaymentChargeId, [options]) ⇒ <code>Promise</code>
2517
- Use this method to issue a refund for a payment made via Telegram Stars.
2518
-
2519
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2520
- **Returns**: <code>Promise</code> - On success, True is returned
2521
- **See**: https://core.telegram.org/bots/api#refundstarpayment
2522
-
2523
- | Param | Type | Description |
2524
- | --- | --- | --- |
2525
- | userId | <code>Number</code> | Identifier of the user whose payment will be refunded |
2526
- | telegramPaymentChargeId | <code>String</code> | Telegram payment identifier of the payment to refund |
2527
- | [options] | <code>Object</code> | Additional Telegram query options |
2528
-
2529
- <a name="TelegramBot+getStarTransactions"></a>
2530
-
2531
- ### telegramBot.getStarTransactions([options]) ⇒ <code>Promise</code>
2532
- Use this method to get the current status of the balance of Telegram Stars
2533
- that can be withdrawn by the bot or transferred to another business account.
2534
-
2535
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2536
- **Returns**: <code>Promise</code> - On success, returns a StarTransactions object
2537
- **See**: https://core.telegram.org/bots/api#getstartransactions
2538
-
2539
- | Param | Type | Description |
2540
- | --- | --- | --- |
2541
- | [options] | <code>Object</code> | Additional Telegram query options |
2542
-
2543
- <a name="TelegramBot+sendPaidMedia"></a>
2544
-
2545
- ### telegramBot.sendPaidMedia(chatId, starCount, media, [options]) ⇒ <code>Promise</code>
2546
- Use this method to send paid media.
2547
-
2548
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2549
- **Returns**: <code>Promise</code> - On success, the sent Message object is returned
2550
- **See**: https://core.telegram.org/bots/api#sendpaidmedia
2551
-
2552
- | Param | Type | Description |
2553
- | --- | --- | --- |
2554
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
2555
- | starCount | <code>Number</code> | The number of Telegram Stars that must be paid to buy access to the media |
2556
- | media | <code>Array</code> | A JSON-serialized array describing the media to be sent; currently supports photos and videos |
2557
- | [options] | <code>Object</code> | Additional Telegram query options |
2558
-
2559
- <a name="TelegramBot+createChatSubscriptionInviteLink"></a>
2560
-
2561
- ### telegramBot.createChatSubscriptionInviteLink(chatId, [options]) ⇒ <code>Promise</code>
2562
- Use this method to create a subscription invite link for a channel chat.
2563
-
2564
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2565
- **Returns**: <code>Promise</code> - On success, the new invite link as a ChatInviteLink object is returned
2566
- **See**: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
2567
-
2568
- | Param | Type | Description |
2569
- | --- | --- | --- |
2570
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target channel chat or username of the target channel (in the format `@channelusername`) |
2571
- | [options] | <code>Object</code> | Additional Telegram query options |
2572
-
2573
- <a name="TelegramBot+editChatSubscriptionInviteLink"></a>
2574
-
2575
- ### telegramBot.editChatSubscriptionInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
2576
- Use this method to edit a subscription invite link created by the bot.
2577
-
2578
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2579
- **Returns**: <code>Promise</code> - On success, the edited invite link as a ChatInviteLink object is returned
2580
- **See**: https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
2581
-
2582
- | Param | Type | Description |
2583
- | --- | --- | --- |
2584
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target channel chat or username of the target channel (in the format `@channelusername`) |
2585
- | inviteLink | <code>String</code> | The invite link to edit |
2586
- | [options] | <code>Object</code> | Additional Telegram query options |
2587
-
2588
- <a name="TelegramBot+getAvailableGifts"></a>
2589
-
2590
- ### telegramBot.getAvailableGifts([options]) ⇒ <code>Promise</code>
2591
- Use this method to get the list of gifts that can be sent by the bot.
2592
-
2593
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2594
- **Returns**: <code>Promise</code> - On success, returns a Gifts object
2595
- **See**: https://core.telegram.org/bots/api#getavailablegifts
2596
-
2597
- | Param | Type | Description |
2598
- | --- | --- | --- |
2599
- | [options] | <code>Object</code> | Additional Telegram query options |
2600
-
2601
- <a name="TelegramBot+sendGift"></a>
2602
-
2603
- ### telegramBot.sendGift(userId, giftId, [options]) ⇒ <code>Promise</code>
2604
- Use this method to send a gift to a user.
2605
-
2606
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2607
- **Returns**: <code>Promise</code> - On success, True is returned
2608
- **See**: https://core.telegram.org/bots/api#sendgift
2609
-
2610
- | Param | Type | Description |
2611
- | --- | --- | --- |
2612
- | userId | <code>Number</code> | Unique identifier of the target user that will receive the gift |
2613
- | giftId | <code>String</code> | Identifier of the gift |
2614
- | [options] | <code>Object</code> | Additional Telegram query options |
2615
-
2616
- <a name="TelegramBot+editUserStarSubscription"></a>
2617
-
2618
- ### telegramBot.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options]) ⇒ <code>Promise</code>
2619
- Use this method to edit a subscription paid through Telegram Stars.
2620
-
2621
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2622
- **Returns**: <code>Promise</code> - On success, True is returned
2623
- **See**: https://core.telegram.org/bots/api#edituserstarsubscription
2624
-
2625
- | Param | Type | Description |
2626
- | --- | --- | --- |
2627
- | userId | <code>Number</code> | Identifier of the user whose subscription will be edited |
2628
- | telegramPaymentChargeId | <code>String</code> | Telegram payment identifier of the subscription payment |
2629
- | isCanceled | <code>Boolean</code> | Pass True to cancel the user's subscription |
2630
- | [options] | <code>Object</code> | Additional Telegram query options |
2631
-
2632
- <a name="TelegramBot+savePreparedInlineMessage"></a>
2633
-
2634
- ### telegramBot.savePreparedInlineMessage(userId, result, [options]) ⇒ <code>Promise</code>
2635
- Use this method to store an inline message that can be sent on behalf of a user.
2636
-
2637
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2638
- **Returns**: <code>Promise</code> - On success, returns a PreparedInlineMessage object
2639
- **See**: https://core.telegram.org/bots/api#savepreparedinlinemessage
2640
-
2641
- | Param | Type | Description |
2642
- | --- | --- | --- |
2643
- | userId | <code>Number</code> | Unique identifier of the target user |
2644
- | result | <code>Object</code> | An object describing the message to be sent |
2645
- | [options] | <code>Object</code> | Additional Telegram query options |
2646
-
2647
- <a name="TelegramBot+verifyUser"></a>
2648
-
2649
- ### telegramBot.verifyUser(userId, [options]) ⇒ <code>Promise</code>
2650
- Use this method to verify a user that is managed by the bot.
2651
-
2652
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2653
- **Returns**: <code>Promise</code> - On success, True is returned
2654
- **See**: https://core.telegram.org/bots/api#verifyuser
2655
-
2656
- | Param | Type | Description |
2657
- | --- | --- | --- |
2658
- | userId | <code>Number</code> | Unique identifier of the target user |
2659
- | [options] | <code>Object</code> | Additional Telegram query options |
2660
-
2661
- <a name="TelegramBot+verifyChat"></a>
2662
-
2663
- ### telegramBot.verifyChat(chatId, [options]) ⇒ <code>Promise</code>
2664
- Use this method to verify a chat that is managed by the bot.
2665
-
2666
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2667
- **Returns**: <code>Promise</code> - On success, True is returned
2668
- **See**: https://core.telegram.org/bots/api#verifychat
2669
-
2670
- | Param | Type | Description |
2671
- | --- | --- | --- |
2672
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
2673
- | [options] | <code>Object</code> | Additional Telegram query options |
2674
-
2675
- <a name="TelegramBot+removeUserVerification"></a>
2676
-
2677
- ### telegramBot.removeUserVerification(userId, [options]) ⇒ <code>Promise</code>
2678
- Use this method to remove verification for a user that is managed by the bot.
2679
-
2680
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2681
- **Returns**: <code>Promise</code> - On success, True is returned
2682
- **See**: https://core.telegram.org/bots/api#removeuserverification
2683
-
2684
- | Param | Type | Description |
2685
- | --- | --- | --- |
2686
- | userId | <code>Number</code> | Unique identifier of the target user |
2687
- | [options] | <code>Object</code> | Additional Telegram query options |
2688
-
2689
- <a name="TelegramBot+removeChatVerification"></a>
2690
-
2691
- ### telegramBot.removeChatVerification(chatId, [options]) ⇒ <code>Promise</code>
2692
- Use this method to remove verification for a chat that is managed by the bot.
2693
-
2694
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2695
- **Returns**: <code>Promise</code> - On success, True is returned
2696
- **See**: https://core.telegram.org/bots/api#removechatverification
2697
-
2698
- | Param | Type | Description |
2699
- | --- | --- | --- |
2700
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
2701
- | [options] | <code>Object</code> | Additional Telegram query options |
2702
-
2703
- <a name="TelegramBot+readBusinessMessage"></a>
2704
-
2705
- ### telegramBot.readBusinessMessage(businessConnectionId, messageId, [options]) ⇒ <code>Promise</code>
2706
- Use this method to mark incoming messages as read on behalf of a business account.
2707
-
2708
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2709
- **Returns**: <code>Promise</code> - True on success
2710
- **See**: https://core.telegram.org/bots/api#readbusinessmessage
2711
-
2712
- | Param | Type | Description |
2713
- | --- | --- | --- |
2714
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2715
- | messageId | <code>Number</code> | Unique identifier of the message to mark as read |
2716
- | [options] | <code>Object</code> | Additional Telegram query options |
2717
-
2718
- <a name="TelegramBot+deleteBusinessMessages"></a>
2719
-
2720
- ### telegramBot.deleteBusinessMessages(businessConnectionId, messageIds, [options]) ⇒ <code>Promise</code>
2721
- Use this method to delete messages on behalf of a business account.
2722
-
2723
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2724
- **Returns**: <code>Promise</code> - True on success
2725
- **See**: https://core.telegram.org/bots/api#deletebusinessmessages
2726
-
2727
- | Param | Type | Description |
2728
- | --- | --- | --- |
2729
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2730
- | messageIds | <code>Array.&lt;Number&gt;</code> | Unique identifiers of 1-100 messages to delete |
2731
- | [options] | <code>Object</code> | Additional Telegram query options |
2732
-
2733
- <a name="TelegramBot+setBusinessAccountName"></a>
2734
-
2735
- ### telegramBot.setBusinessAccountName(businessConnectionId, [options]) ⇒ <code>Promise</code>
2736
- Use this method to change the first and last name of a managed business account.
2737
-
2738
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2739
- **Returns**: <code>Promise</code> - True on success
2740
- **See**: https://core.telegram.org/bots/api#setbusinessaccountname
2741
-
2742
- | Param | Type | Description |
2743
- | --- | --- | --- |
2744
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2745
- | [options] | <code>Object</code> | Additional Telegram query options |
2746
-
2747
- <a name="TelegramBot+setBusinessAccountUsername"></a>
2748
-
2749
- ### telegramBot.setBusinessAccountUsername(businessConnectionId, [options]) ⇒ <code>Promise</code>
2750
- Use this method to change the username of a managed business account.
2751
-
2752
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2753
- **Returns**: <code>Promise</code> - True on success
2754
- **See**: https://core.telegram.org/bots/api#setbusinessaccountusername
2755
-
2756
- | Param | Type | Description |
2757
- | --- | --- | --- |
2758
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2759
- | [options] | <code>Object</code> | Additional Telegram query options |
2760
-
2761
- <a name="TelegramBot+setBusinessAccountBio"></a>
2762
-
2763
- ### telegramBot.setBusinessAccountBio(businessConnectionId, [options]) ⇒ <code>Promise</code>
2764
- Use this method to change the bio of a managed business account.
2765
-
2766
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2767
- **Returns**: <code>Promise</code> - True on success
2768
- **See**: https://core.telegram.org/bots/api#setbusinessaccountbio
2769
-
2770
- | Param | Type | Description |
2771
- | --- | --- | --- |
2772
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2773
- | [options] | <code>Object</code> | Additional Telegram query options |
2774
-
2775
- <a name="TelegramBot+setBusinessAccountProfilePhoto"></a>
2776
-
2777
- ### telegramBot.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options]) ⇒ <code>Promise</code>
2778
- Use this method to change the profile photo of a managed business account.
2779
-
2780
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2781
- **Returns**: <code>Promise</code> - True on success
2782
- **See**: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
2783
-
2784
- | Param | Type | Description |
2785
- | --- | --- | --- |
2786
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2787
- | photo | <code>Object</code> | InputProfilePhoto object |
2788
- | [options] | <code>Object</code> | Additional Telegram query options |
2789
-
2790
- <a name="TelegramBot+removeBusinessAccountProfilePhoto"></a>
2791
-
2792
- ### telegramBot.removeBusinessAccountProfilePhoto(businessConnectionId, [options]) ⇒ <code>Promise</code>
2793
- Use this method to remove the profile photo of a managed business account.
2794
-
2795
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2796
- **Returns**: <code>Promise</code> - True on success
2797
- **See**: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
2798
-
2799
- | Param | Type | Description |
2800
- | --- | --- | --- |
2801
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2802
- | [options] | <code>Object</code> | Additional Telegram query options |
2803
-
2804
- <a name="TelegramBot+setBusinessAccountGiftSettings"></a>
2805
-
2806
- ### telegramBot.setBusinessAccountGiftSettings(businessConnectionId, [options]) ⇒ <code>Promise</code>
2807
- Use this method to change the gift settings of a managed business account.
2808
-
2809
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2810
- **Returns**: <code>Promise</code> - True on success
2811
- **See**: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
2812
-
2813
- | Param | Type | Description |
2814
- | --- | --- | --- |
2815
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2816
- | [options] | <code>Object</code> | Additional Telegram query options |
2817
-
2818
- <a name="TelegramBot+getBusinessAccountStarBalance"></a>
2819
-
2820
- ### telegramBot.getBusinessAccountStarBalance(businessConnectionId, [options]) ⇒ <code>Promise</code>
2821
- Use this method to get the current Star balance of a managed business account.
2822
-
2823
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2824
- **Returns**: <code>Promise</code> - Returns a StarAmount object
2825
- **See**: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
2826
-
2827
- | Param | Type | Description |
2828
- | --- | --- | --- |
2829
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2830
- | [options] | <code>Object</code> | Additional Telegram query options |
2831
-
2832
- <a name="TelegramBot+transferBusinessAccountStars"></a>
2833
-
2834
- ### telegramBot.transferBusinessAccountStars(businessConnectionId, starCount, [options]) ⇒ <code>Promise</code>
2835
- Use this method to transfer Stars from the business account balance to the bot owner's balance.
2836
-
2837
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2838
- **Returns**: <code>Promise</code> - Returns a StarAmount object
2839
- **See**: https://core.telegram.org/bots/api#transferbusinessaccountstars
2840
-
2841
- | Param | Type | Description |
2842
- | --- | --- | --- |
2843
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2844
- | starCount | <code>Number</code> | Number of Telegram Stars to transfer, 1-10000 |
2845
- | [options] | <code>Object</code> | Additional Telegram query options |
2846
-
2847
- <a name="TelegramBot+getBusinessAccountGifts"></a>
2848
-
2849
- ### telegramBot.getBusinessAccountGifts(businessConnectionId, [options]) ⇒ <code>Promise</code>
2850
- Use this method to get the list of gifts received by a managed business account.
2851
-
2852
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2853
- **Returns**: <code>Promise</code> - Returns an Array of OwnedGift objects
2854
- **See**: https://core.telegram.org/bots/api#getbusinessaccountgifts
2855
-
2856
- | Param | Type | Description |
2857
- | --- | --- | --- |
2858
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2859
- | [options] | <code>Object</code> | Additional Telegram query options |
2860
-
2861
- <a name="TelegramBot+convertGiftToStars"></a>
2862
-
2863
- ### telegramBot.convertGiftToStars(businessConnectionId, ownedGiftId, [options]) ⇒ <code>Promise</code>
2864
- Use this method to convert a given regular gift to Telegram Stars.
2865
-
2866
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2867
- **Returns**: <code>Promise</code> - Returns a StarAmount object
2868
- **See**: https://core.telegram.org/bots/api#convertgifttostars
2869
-
2870
- | Param | Type | Description |
2871
- | --- | --- | --- |
2872
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2873
- | ownedGiftId | <code>String</code> | Identifier of the regular gift |
2874
- | [options] | <code>Object</code> | Additional Telegram query options |
2875
-
2876
- <a name="TelegramBot+upgradeGift"></a>
2877
-
2878
- ### telegramBot.upgradeGift(businessConnectionId, ownedGiftId, [options]) ⇒ <code>Promise</code>
2879
- Use this method to upgrade a regular gift to a unique or upgrade a unique gift to an upgraded collectible gift.
2880
-
2881
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2882
- **Returns**: <code>Promise</code> - Returns the updated OwnedGift object
2883
- **See**: https://core.telegram.org/bots/api#upgradegift
2884
-
2885
- | Param | Type | Description |
2886
- | --- | --- | --- |
2887
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2888
- | ownedGiftId | <code>String</code> | Identifier of the regular gift to upgrade |
2889
- | [options] | <code>Object</code> | Additional Telegram query options |
2890
-
2891
- <a name="TelegramBot+transferGift"></a>
2892
-
2893
- ### telegramBot.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options]) ⇒ <code>Promise</code>
2894
- Use this method to transfer a regular gift to another user.
2895
-
2896
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2897
- **Returns**: <code>Promise</code> - True on success
2898
- **See**: https://core.telegram.org/bots/api#transfergift
2899
-
2900
- | Param | Type | Description |
2901
- | --- | --- | --- |
2902
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2903
- | ownedGiftId | <code>String</code> | Identifier of the gift to transfer |
2904
- | newOwnerChatId | <code>Number</code> \| <code>String</code> | Unique identifier of the new owner of the gift |
2905
- | [options] | <code>Object</code> | Additional Telegram query options |
2906
-
2907
- <a name="TelegramBot+postStory"></a>
2908
-
2909
- ### telegramBot.postStory(businessConnectionId, content, [options]) ⇒ <code>Promise</code>
2910
- Use this method to post a story on behalf of a managed business account.
2911
-
2912
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2913
- **Returns**: <code>Promise</code> - Returns a Story object
2914
- **See**: https://core.telegram.org/bots/api#poststory
2915
-
2916
- | Param | Type | Description |
2917
- | --- | --- | --- |
2918
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2919
- | content | <code>Object</code> | InputStoryContent object |
2920
- | [options] | <code>Object</code> | Additional Telegram query options |
2921
-
2922
- <a name="TelegramBot+editStory"></a>
2923
-
2924
- ### telegramBot.editStory(businessConnectionId, storyId, [options]) ⇒ <code>Promise</code>
2925
- Use this method to edit a story previously posted on behalf of a managed business account.
2926
-
2927
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2928
- **Returns**: <code>Promise</code> - Returns the edited Story object
2929
- **See**: https://core.telegram.org/bots/api#editstory
2930
-
2931
- | Param | Type | Description |
2932
- | --- | --- | --- |
2933
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2934
- | storyId | <code>Number</code> | Identifier of the story to edit |
2935
- | [options] | <code>Object</code> | Additional Telegram query options |
2936
-
2937
- <a name="TelegramBot+deleteStory"></a>
2938
-
2939
- ### telegramBot.deleteStory(businessConnectionId, storyId, [options]) ⇒ <code>Promise</code>
2940
- Use this method to delete a story previously posted on behalf of a managed business account.
2941
-
2942
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2943
- **Returns**: <code>Promise</code> - True on success
2944
- **See**: https://core.telegram.org/bots/api#deletestory
2945
-
2946
- | Param | Type | Description |
2947
- | --- | --- | --- |
2948
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2949
- | storyId | <code>Number</code> | Identifier of the story to delete |
2950
- | [options] | <code>Object</code> | Additional Telegram query options |
2951
-
2952
- <a name="TelegramBot+giftPremiumSubscription"></a>
2953
-
2954
- ### telegramBot.giftPremiumSubscription(userId, monthCount, starCount, [options]) ⇒ <code>Promise</code>
2955
- Use this method to gift a Telegram Premium subscription to a user.
2956
-
2957
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2958
- **Returns**: <code>Promise</code> - Returns the Gift object that was paid for
2959
- **See**: https://core.telegram.org/bots/api#giftpremiumsubscription
2960
-
2961
- | Param | Type | Description |
2962
- | --- | --- | --- |
2963
- | userId | <code>Number</code> \| <code>String</code> | Unique identifier of the target user |
2964
- | monthCount | <code>Number</code> | Number of months the subscription will be active for, 1-36 |
2965
- | starCount | <code>Number</code> | Number of Telegram Stars that will be paid for the subscription, 1-10000 |
2966
- | [options] | <code>Object</code> | Additional Telegram query options |
2967
-
2968
- <a name="TelegramBot+setUserEmojiStatus"></a>
2969
-
2970
- ### telegramBot.setUserEmojiStatus(userId, [options]) ⇒ <code>Promise</code>
2971
- Use this method to set the emoji status of a user.
2972
-
2973
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2974
- **Returns**: <code>Promise</code> - True on success
2975
- **See**: https://core.telegram.org/bots/api#setuseremojistatus
2976
-
2977
- | Param | Type | Description |
2978
- | --- | --- | --- |
2979
- | userId | <code>Number</code> \| <code>String</code> | Unique identifier of the target user |
2980
- | [options] | <code>Object</code> | Additional Telegram query options |
2981
-
2982
- <a name="TelegramBot+sendChecklist"></a>
2983
-
2984
- ### telegramBot.sendChecklist(businessConnectionId, title, tasks, [options]) ⇒ <code>Promise</code>
2985
- Use this method to send a checklist on behalf of a managed business account.
2986
-
2987
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2988
- **Returns**: <code>Promise</code> - On success, the sent Message is returned
2989
- **See**: https://core.telegram.org/bots/api#sendchecklist
2990
-
2991
- | Param | Type | Description |
2992
- | --- | --- | --- |
2993
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
2994
- | title | <code>String</code> | Title of the checklist, 1-255 characters after entities parsing |
2995
- | tasks | <code>Array</code> | List of 1-100 tasks in the checklist |
2996
- | [options] | <code>Object</code> | Additional Telegram query options |
2997
-
2998
- <a name="TelegramBot+editMessageChecklist"></a>
2999
-
3000
- ### telegramBot.editMessageChecklist(businessConnectionId, messageId, [options]) ⇒ <code>Promise</code>
3001
- Use this method to edit a checklist message on behalf of a managed business account.
3002
-
3003
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3004
- **Returns**: <code>Promise</code> - On success, the edited Message is returned
3005
- **See**: https://core.telegram.org/bots/api#editmessagechecklist
3006
-
3007
- | Param | Type | Description |
3008
- | --- | --- | --- |
3009
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
3010
- | messageId | <code>Number</code> | Unique identifier of the message to edit |
3011
- | [options] | <code>Object</code> | Additional Telegram query options |
3012
-
3013
- <a name="TelegramBot+getMyStarBalance"></a>
3014
-
3015
- ### telegramBot.getMyStarBalance([options]) ⇒ <code>Promise</code>
3016
- Use this method to get the current number of Telegram Stars owned by the bot.
3017
-
3018
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3019
- **Returns**: <code>Promise</code> - Returns a StarAmount object
3020
- **See**: https://core.telegram.org/bots/api#getmystarbalance
3021
-
3022
- | Param | Type | Description |
3023
- | --- | --- | --- |
3024
- | [options] | <code>Object</code> | Additional Telegram query options |
3025
-
3026
- <a name="TelegramBot+approveSuggestedPost"></a>
3027
-
3028
- ### telegramBot.approveSuggestedPost(businessConnectionId, messageId, [options]) ⇒ <code>Promise</code>
3029
- Use this method to approve a suggested post in a channel chat.
3030
-
3031
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3032
- **Returns**: <code>Promise</code> - True on success
3033
- **See**: https://core.telegram.org/bots/api#approvesuggestedpost
3034
-
3035
- | Param | Type | Description |
3036
- | --- | --- | --- |
3037
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
3038
- | messageId | <code>Number</code> | Unique identifier of the suggested post message |
3039
- | [options] | <code>Object</code> | Additional Telegram query options |
3040
-
3041
- <a name="TelegramBot+declineSuggestedPost"></a>
3042
-
3043
- ### telegramBot.declineSuggestedPost(businessConnectionId, messageId, [options]) ⇒ <code>Promise</code>
3044
- Use this method to decline a suggested post in a channel chat.
3045
-
3046
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3047
- **Returns**: <code>Promise</code> - True on success
3048
- **See**: https://core.telegram.org/bots/api#declinesuggestedpost
3049
-
3050
- | Param | Type | Description |
3051
- | --- | --- | --- |
3052
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
3053
- | messageId | <code>Number</code> | Unique identifier of the suggested post message |
3054
- | [options] | <code>Object</code> | Additional Telegram query options |
3055
-
3056
- <a name="TelegramBot+sendMessageDraft"></a>
3057
-
3058
- ### telegramBot.sendMessageDraft(chatId, text, [options]) ⇒ <code>Promise</code>
3059
- Use this method to send a draft message to the bot's user in private chat.
3060
-
3061
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3062
- **Returns**: <code>Promise</code> - On success, the sent Message is returned
3063
- **See**: https://core.telegram.org/bots/api#sendmessagedraft
3064
-
3065
- | Param | Type | Description |
3066
- | --- | --- | --- |
3067
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier of the target private chat |
3068
- | text | <code>String</code> | Text of the message, 1-4096 characters after entities parsing |
3069
- | [options] | <code>Object</code> | Additional Telegram query options |
3070
-
3071
- <a name="TelegramBot+getUserGifts"></a>
3072
-
3073
- ### telegramBot.getUserGifts(userId, [options]) ⇒ <code>Promise</code>
3074
- Use this method to get gifts received by a user in a private chat.
3075
-
3076
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3077
- **Returns**: <code>Promise</code> - Array of OwnedGift objects
3078
- **See**: https://core.telegram.org/bots/api#getusergifts
3079
-
3080
- | Param | Type | Description |
3081
- | --- | --- | --- |
3082
- | userId | <code>Number</code> \| <code>String</code> | Unique identifier of the target user |
3083
- | [options] | <code>Object</code> | Additional Telegram query options |
3084
-
3085
- <a name="TelegramBot+getChatGifts"></a>
3086
-
3087
- ### telegramBot.getChatGifts(chatId, [options]) ⇒ <code>Promise</code>
3088
- Use this method to get gifts received by a chat.
3089
-
3090
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3091
- **Returns**: <code>Promise</code> - Array of OwnedGift objects
3092
- **See**: https://core.telegram.org/bots/api#getchatgifts
3093
-
3094
- | Param | Type | Description |
3095
- | --- | --- | --- |
3096
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier of the target chat |
3097
- | [options] | <code>Object</code> | Additional Telegram query options |
3098
-
3099
- <a name="TelegramBot+repostStory"></a>
3100
-
3101
- ### telegramBot.repostStory(businessConnectionId, storyId, targetBusinessConnectionIds, [options]) ⇒ <code>Promise</code>
3102
- Use this method to repost a story on behalf of a managed business account.
3103
-
3104
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3105
- **Returns**: <code>Promise</code> - Array of Story objects
3106
- **See**: https://core.telegram.org/bots/api#repoststory
3107
-
3108
- | Param | Type | Description |
3109
- | --- | --- | --- |
3110
- | businessConnectionId | <code>String</code> | Unique identifier of the business connection |
3111
- | storyId | <code>Number</code> | Identifier of the story to repost |
3112
- | targetBusinessConnectionIds | <code>Array.&lt;(Number\|String)&gt;</code> | Identifiers of the business connections to post the story to |
3113
- | [options] | <code>Object</code> | Additional Telegram query options |
3114
-
3115
- <a name="TelegramBot+setMyProfilePhoto"></a>
3116
-
3117
- ### telegramBot.setMyProfilePhoto(photo, [options]) ⇒ <code>Promise</code>
3118
- Use this method to set the profile photo of the bot.
3119
-
3120
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3121
- **Returns**: <code>Promise</code> - True on success
3122
- **See**: https://core.telegram.org/bots/api#setmyprofilephoto
3123
-
3124
- | Param | Type | Description |
3125
- | --- | --- | --- |
3126
- | photo | <code>Object</code> | InputProfilePhoto object |
3127
- | [options] | <code>Object</code> | Additional Telegram query options |
3128
-
3129
- <a name="TelegramBot+removeMyProfilePhoto"></a>
3130
-
3131
- ### telegramBot.removeMyProfilePhoto([options]) ⇒ <code>Promise</code>
3132
- Use this method to remove the profile photo of the bot.
3133
-
3134
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3135
- **Returns**: <code>Promise</code> - True on success
3136
- **See**: https://core.telegram.org/bots/api#removemyprofilephoto
3137
-
3138
- | Param | Type | Description |
3139
- | --- | --- | --- |
3140
- | [options] | <code>Object</code> | Additional Telegram query options |
3141
-
3142
- <a name="TelegramBot+getUserProfileAudios"></a>
3143
-
3144
- ### telegramBot.getUserProfileAudios(userId, [options]) ⇒ <code>Promise</code>
3145
- Use this method to get the profile audios of a user.
3146
-
3147
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3148
- **Returns**: <code>Promise</code> - Array of Audio objects
3149
- **See**: https://core.telegram.org/bots/api#getuserprofileaudios
3150
-
3151
- | Param | Type | Description |
3152
- | --- | --- | --- |
3153
- | userId | <code>Number</code> \| <code>String</code> | Unique identifier of the target user |
3154
- | [options] | <code>Object</code> | Additional Telegram query options |
3155
-
3156
- <a name="TelegramBot+setChatMemberTag"></a>
3157
-
3158
- ### telegramBot.setChatMemberTag(chatId, userId, [options]) ⇒ <code>Promise</code>
3159
- Use this method to set the tag that is applied to a specific user in a specific group chat.
3160
-
3161
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3162
- **Returns**: <code>Promise</code> - True on success
3163
- **See**: https://core.telegram.org/bots/api#setchatmembertag
3164
-
3165
- | Param | Type | Description |
3166
- | --- | --- | --- |
3167
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target group |
3168
- | userId | <code>Number</code> \| <code>String</code> | Unique identifier of the target user |
3169
- | [options] | <code>Object</code> | Additional Telegram query options |
3170
-
3171
- <a name="TelegramBot+getManagedBotToken"></a>
3172
-
3173
- ### telegramBot.getManagedBotToken(botId, [options]) ⇒ <code>Promise</code>
3174
- Use this method to get the current managable bot token for the bot.
3175
-
3176
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3177
- **Returns**: <code>Promise</code> - Returns a ManagedBotToken object
3178
- **See**: https://core.telegram.org/bots/api#getmanagedbottoken
3179
-
3180
- | Param | Type | Description |
3181
- | --- | --- | --- |
3182
- | botId | <code>Number</code> | Identifier of the bot to get the token for |
3183
- | [options] | <code>Object</code> | Additional Telegram query options |
3184
-
3185
- <a name="TelegramBot+replaceManagedBotToken"></a>
3186
-
3187
- ### telegramBot.replaceManagedBotToken(botId, [options]) ⇒ <code>Promise</code>
3188
- Use this method to replace the managable bot token for the bot with a new one.
3189
-
3190
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3191
- **Returns**: <code>Promise</code> - Returns a ManagedBotToken object
3192
- **See**: https://core.telegram.org/bots/api#replacemanagedbottoken
3193
-
3194
- | Param | Type | Description |
3195
- | --- | --- | --- |
3196
- | botId | <code>Number</code> | Identifier of the bot whose token will be replaced |
3197
- | [options] | <code>Object</code> | Additional Telegram query options |
3198
-
3199
- <a name="TelegramBot+savePreparedKeyboardButton"></a>
3200
-
3201
- ### telegramBot.savePreparedKeyboardButton(button, [options]) ⇒ <code>Promise</code>
3202
- Use this method to save a prepared keyboard button for later use.
3203
-
3204
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3205
- **Returns**: <code>Promise</code> - Returns a PreparedKeyboardButton object
3206
- **See**: https://core.telegram.org/bots/api#savepreparedkeyboardbutton
3207
-
3208
- | Param | Type | Description |
3209
- | --- | --- | --- |
3210
- | button | <code>Object</code> | KeyboardButton object to save |
3211
- | [options] | <code>Object</code> | Additional Telegram query options |
3212
-
3213
- <a name="TelegramBot+answerGuestQuery"></a>
3214
-
3215
- ### telegramBot.answerGuestQuery(guestQueryId, text, [options]) ⇒ <code>Promise</code>
3216
- Use this method to answer a guest query in a Telegram Web App.
3217
-
3218
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3219
- **Returns**: <code>Promise</code> - True on success
3220
- **See**: https://core.telegram.org/bots/api#answerguestquery
3221
-
3222
- | Param | Type | Description |
3223
- | --- | --- | --- |
3224
- | guestQueryId | <code>String</code> | Unique identifier for the query to be answered |
3225
- | text | <code>String</code> | Text of the message |
3226
- | [options] | <code>Object</code> | Additional Telegram query options |
3227
-
3228
- <a name="TelegramBot+deleteAllMessageReactions"></a>
3229
-
3230
- ### telegramBot.deleteAllMessageReactions(chatId, messageId, [options]) ⇒ <code>Promise</code>
3231
- Use this method to remove multiple reactions from a message.
3232
-
3233
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3234
- **Returns**: <code>Promise</code> - True on success
3235
- **See**: https://core.telegram.org/bots/api#deletemessagereactions
3236
-
3237
- | Param | Type | Description |
3238
- | --- | --- | --- |
3239
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3240
- | messageId | <code>Number</code> | Unique identifier of the target message |
3241
- | [options] | <code>Object</code> | Additional Telegram query options |
3242
-
3243
- <a name="TelegramBot+deleteMessageReaction"></a>
3244
-
3245
- ### telegramBot.deleteMessageReaction(chatId, messageId, [options]) ⇒ <code>Promise</code>
3246
- Use this method to remove a reaction from a message.
3247
-
3248
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3249
- **Returns**: <code>Promise</code> - True on success
3250
- **See**: https://core.telegram.org/bots/api#deletemessagereaction
3251
-
3252
- | Param | Type | Description |
3253
- | --- | --- | --- |
3254
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3255
- | messageId | <code>Number</code> | Unique identifier of the target message |
3256
- | [options] | <code>Object</code> | Additional Telegram query options |
3257
-
3258
- <a name="TelegramBot+sendLivePhoto"></a>
3259
-
3260
- ### telegramBot.sendLivePhoto(chatId, photo, video, [options], [fileOptions]) ⇒ <code>Promise</code>
3261
- Use this method to send a live photo.
3262
-
3263
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3264
- **Returns**: <code>Promise</code> - On success, the sent Message object is returned
3265
- **See**: https://core.telegram.org/bots/api#sendlivephoto
3266
-
3267
- | Param | Type | Description |
3268
- | --- | --- | --- |
3269
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3270
- | photo | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream, Buffer, or file_id |
3271
- | video | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path, Stream, Buffer, or file_id |
3272
- | [options] | <code>Object</code> | Additional Telegram query options |
3273
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
3274
-
3275
- <a name="TelegramBot+getManagedBotAccessSettings"></a>
3276
-
3277
- ### telegramBot.getManagedBotAccessSettings([options]) ⇒ <code>Promise</code>
3278
- Use this method to get the current access settings of the bot for managed bots.
3279
-
3280
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3281
- **Returns**: <code>Promise</code> - Returns a ManagedBotAccessSettings object
3282
- **See**: https://core.telegram.org/bots/api#getmanagedbotaccesssettings
3283
-
3284
- | Param | Type | Description |
3285
- | --- | --- | --- |
3286
- | [options] | <code>Object</code> | Additional Telegram query options |
3287
-
3288
- <a name="TelegramBot+setManagedBotAccessSettings"></a>
3289
-
3290
- ### telegramBot.setManagedBotAccessSettings([options]) ⇒ <code>Promise</code>
3291
- Use this method to change the access settings of the bot for managed bots.
3292
-
3293
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3294
- **Returns**: <code>Promise</code> - True on success
3295
- **See**: https://core.telegram.org/bots/api#setmanagedbotaccesssettings
3296
-
3297
- | Param | Type | Description |
3298
- | --- | --- | --- |
3299
- | [options] | <code>Object</code> | Additional Telegram query options |
3300
-
3301
- <a name="TelegramBot+getUserPersonalChatMessages"></a>
3302
-
3303
- ### telegramBot.getUserPersonalChatMessages(userId, [options]) ⇒ <code>Promise</code>
3304
- Use this method to get messages from a user's personal chat with the bot.
3305
-
3306
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3307
- **Returns**: <code>Promise</code> - Array of Message objects
3308
- **See**: https://core.telegram.org/bots/api#getuserpersonalchatmessages
3309
-
3310
- | Param | Type | Description |
3311
- | --- | --- | --- |
3312
- | userId | <code>Number</code> | Unique identifier of the target user |
3313
- | [options] | <code>Object</code> | Additional Telegram query options |
3314
-
3315
- <a name="TelegramBot+sendRichMessage"></a>
3316
-
3317
- ### telegramBot.sendRichMessage(chatId, content, [options]) ⇒ <code>Promise</code>
3318
- Use this method to send a rich message.
3319
-
3320
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3321
- **Returns**: <code>Promise</code> - On success, the sent Message object is returned
3322
- **See**: https://core.telegram.org/bots/api#sendrichmessage
3323
-
3324
- | Param | Type | Description |
3325
- | --- | --- | --- |
3326
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3327
- | content | <code>Object</code> | An InputRichMessageContent object |
3328
- | [options] | <code>Object</code> | Additional Telegram query options |
3329
-
3330
- <a name="TelegramBot+sendRichMessageDraft"></a>
3331
-
3332
- ### telegramBot.sendRichMessageDraft(chatId, content, [options]) ⇒ <code>Promise</code>
3333
- Use this method to send a rich message draft.
3334
-
3335
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3336
- **Returns**: <code>Promise</code> - On success, a Message object is returned
3337
- **See**: https://core.telegram.org/bots/api#sendrichmessagedraft
3338
-
3339
- | Param | Type | Description |
3340
- | --- | --- | --- |
3341
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3342
- | content | <code>Object</code> | An InputRichMessageContent object |
3343
- | [options] | <code>Object</code> | Additional Telegram query options |
3344
-
3345
- <a name="TelegramBot+answerChatJoinRequestQuery"></a>
3346
-
3347
- ### telegramBot.answerChatJoinRequestQuery(chatJoinRequestId, queryId, [options]) ⇒ <code>Promise</code>
3348
- Use this method to answer a chat join request query.
3349
-
3350
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3351
- **Returns**: <code>Promise</code> - True on success
3352
- **See**: https://core.telegram.org/bots/api#answerchatjoinrequestquery
3353
-
3354
- | Param | Type | Description |
3355
- | --- | --- | --- |
3356
- | chatJoinRequestId | <code>Number</code> | Unique identifier of the chat join request |
3357
- | queryId | <code>String</code> | Unique identifier for the query to be answered |
3358
- | [options] | <code>Object</code> | Additional Telegram query options |
3359
-
3360
- <a name="TelegramBot+sendChatJoinRequestWebApp"></a>
3361
-
3362
- ### telegramBot.sendChatJoinRequestWebApp(chatJoinRequestId, webApp, [options]) ⇒ <code>Promise</code>
3363
- Use this method to send a Web App message to a chat join request.
3364
-
3365
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3366
- **Returns**: <code>Promise</code> - True on success
3367
- **See**: https://core.telegram.org/bots/api#sendchatjoinrequestwebapp
3368
-
3369
- | Param | Type | Description |
3370
- | --- | --- | --- |
3371
- | chatJoinRequestId | <code>Number</code> | Unique identifier of the chat join request |
3372
- | webApp | <code>Object</code> | A SentWebAppMessage object |
3373
- | [options] | <code>Object</code> | Additional Telegram query options |
3374
-
3375
- <a name="TelegramBot+editEphemeralMessageText"></a>
3376
-
3377
- ### telegramBot.editEphemeralMessageText(chatId, ephemeralMessageId, text, [options]) ⇒ <code>Promise</code>
3378
- Use this method to edit the text of an ephemeral message.
3379
-
3380
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3381
- **Returns**: <code>Promise</code> - On success, the edited Message object is returned
3382
- **See**: https://core.telegram.org/bots/api#editephemeralmessagetext
3383
-
3384
- | Param | Type | Description |
3385
- | --- | --- | --- |
3386
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3387
- | ephemeralMessageId | <code>String</code> | Unique identifier of the ephemeral message |
3388
- | text | <code>String</code> | New text of the message |
3389
- | [options] | <code>Object</code> | Additional Telegram query options |
3390
-
3391
- <a name="TelegramBot+editEphemeralMessageMedia"></a>
3392
-
3393
- ### telegramBot.editEphemeralMessageMedia(chatId, ephemeralMessageId, media, [options], [fileOptions]) ⇒ <code>Promise</code>
3394
- Use this method to edit the media of an ephemeral message.
3395
-
3396
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3397
- **Returns**: <code>Promise</code> - On success, the edited Message object is returned
3398
- **See**: https://core.telegram.org/bots/api#editephemeralmessagemedia
3399
-
3400
- | Param | Type | Description |
3401
- | --- | --- | --- |
3402
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3403
- | ephemeralMessageId | <code>String</code> | Unique identifier of the ephemeral message |
3404
- | media | <code>Object</code> | An InputMedia object |
3405
- | [options] | <code>Object</code> | Additional Telegram query options |
3406
- | [fileOptions] | <code>Object</code> | Optional file related meta-data |
3407
-
3408
- <a name="TelegramBot+editEphemeralMessageCaption"></a>
3409
-
3410
- ### telegramBot.editEphemeralMessageCaption(chatId, ephemeralMessageId, [options]) ⇒ <code>Promise</code>
3411
- Use this method to edit the caption of an ephemeral message.
3412
-
3413
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3414
- **Returns**: <code>Promise</code> - On success, the edited Message object is returned
3415
- **See**: https://core.telegram.org/bots/api#editephemeralmessagecaption
3416
-
3417
- | Param | Type | Description |
3418
- | --- | --- | --- |
3419
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3420
- | ephemeralMessageId | <code>String</code> | Unique identifier of the ephemeral message |
3421
- | [options] | <code>Object</code> | Additional Telegram query options |
3422
-
3423
- <a name="TelegramBot+editEphemeralMessageReplyMarkup"></a>
3424
-
3425
- ### telegramBot.editEphemeralMessageReplyMarkup(chatId, ephemeralMessageId, [options]) ⇒ <code>Promise</code>
3426
- Use this method to edit the reply markup of an ephemeral message.
3427
-
3428
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3429
- **Returns**: <code>Promise</code> - On success, the edited Message object is returned
3430
- **See**: https://core.telegram.org/bots/api#editephemeralmessagereplymarkup
3431
-
3432
- | Param | Type | Description |
3433
- | --- | --- | --- |
3434
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3435
- | ephemeralMessageId | <code>String</code> | Unique identifier of the ephemeral message |
3436
- | [options] | <code>Object</code> | Additional Telegram query options |
3437
-
3438
- <a name="TelegramBot+deleteEphemeralMessage"></a>
3439
-
3440
- ### telegramBot.deleteEphemeralMessage(chatId, ephemeralMessageId, [options]) ⇒ <code>Promise</code>
3441
- Use this method to delete an ephemeral message.
3442
-
3443
- **Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
3444
- **Returns**: <code>Promise</code> - True on success
3445
- **See**: https://core.telegram.org/bots/api#deleteephemeralmessage
3446
-
3447
- | Param | Type | Description |
3448
- | --- | --- | --- |
3449
- | chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
3450
- | ephemeralMessageId | <code>String</code> | Unique identifier of the ephemeral message |
3451
- | [options] | <code>Object</code> | Additional Telegram query options |
3452
-
3453
- <a name="TelegramBot.errors"></a>
3454
-
3455
- ### TelegramBot.errors : <code>Object</code>
3456
- The different errors the library uses.
3457
-
3458
- **Kind**: static property of [<code>TelegramBot</code>](#TelegramBot)
3459
- <a name="TelegramBot.messageTypes"></a>
3460
-
3461
- ### TelegramBot.messageTypes : <code>Array.&lt;String&gt;</code>
3462
- The types of message updates the library handles.
3463
-
3464
- **Kind**: static property of [<code>TelegramBot</code>](#TelegramBot)
3465
- * * *
3466
-
3467
-
3468
- [usage-sending-files-performance]:https://github.com/ZeroBot-net/tg-bot-api/tree/master/doc/usage.md#sending-files-performance
3469
- [setWebHook-v0.25.0]:https://github.com/ZeroBot-net/tg-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#telegrambotsetwebhookurl-cert
3470
- [getUpdates-v0.25.0]:https://github.com/ZeroBot-net/tg-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#TelegramBot+getUpdates
3471
- [getUserProfilePhotos-v0.25.0]:https://github.com/ZeroBot-net/tg-bot-api/tree/4e5a493cadfaad5589a8d79e55d9e0d103000ce4#TelegramBot+getUserProfilePhotos
3472
- [answerCallbackQuery-v0.27.1]:https://github.com/ZeroBot-net/tg-bot-api/blob/v0.27.1/doc/api.md#TelegramBot+answerCallbackQuery
3473
- [answerCallbackQuery-v0.29.0]:https://github.com/ZeroBot-net/tg-bot-api/blob/v0.29.0/doc/api.md#TelegramBot+answerCallbackQuery