@aracna/telegram-bot 1.9.13 → 2.0.1
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/apis/telegram-api.d.ts +9 -0
- package/apis/telegram-api.js +55 -0
- package/apis/telegram-file-api.d.ts +7 -0
- package/apis/telegram-file-api.js +14 -0
- package/classes/client.d.ts +46 -0
- package/classes/client.js +409 -0
- package/definitions/constants.d.ts +10 -0
- package/definitions/constants.js +53 -1
- package/definitions/enums.d.ts +1 -20
- package/definitions/enums.js +2 -22
- package/definitions/interfaces.d.ts +91 -75
- package/definitions/interfaces.js +0 -1
- package/definitions/telegram-api-definitions.d.ts +12 -0
- package/definitions/telegram-api-definitions.js +2 -0
- package/definitions/types.d.ts +4 -3
- package/index.d.ts +656 -416
- package/index.js +236 -20
- package/loggers/class-logger.d.ts +2 -0
- package/loggers/{module.logger.js → class-logger.js} +2 -2
- package/package.json +13 -4
- package/requests/add-requests.d.ts +3 -0
- package/requests/add-requests.js +14 -0
- package/requests/answer-requests.d.ts +7 -0
- package/requests/answer-requests.js +23 -0
- package/requests/approve-requests.d.ts +3 -0
- package/requests/approve-requests.js +7 -0
- package/requests/ban-requests.d.ts +4 -0
- package/requests/ban-requests.js +11 -0
- package/requests/close-requests.d.ts +4 -0
- package/requests/close-requests.js +11 -0
- package/requests/copy-requests.d.ts +4 -0
- package/requests/copy-requests.js +11 -0
- package/requests/create-requests.d.ts +7 -0
- package/requests/create-requests.js +30 -0
- package/requests/decline-requests.d.ts +3 -0
- package/requests/decline-requests.js +7 -0
- package/requests/delete-requests.d.ts +10 -0
- package/requests/delete-requests.js +35 -0
- package/requests/download-requests.d.ts +3 -0
- package/requests/download-requests.js +29 -0
- package/requests/edit-requests.d.ts +12 -0
- package/requests/edit-requests.js +46 -0
- package/requests/export-requests.d.ts +3 -0
- package/requests/export-requests.js +7 -0
- package/requests/forward-requests.d.ts +4 -0
- package/requests/forward-requests.js +11 -0
- package/requests/get-requests.d.ts +23 -0
- package/requests/get-requests.js +92 -0
- package/requests/hide-requests.d.ts +3 -0
- package/requests/hide-requests.js +7 -0
- package/requests/leave-requests.d.ts +3 -0
- package/requests/leave-requests.js +7 -0
- package/requests/log-requests.d.ts +2 -0
- package/requests/log-requests.js +7 -0
- package/requests/pin-requests.d.ts +3 -0
- package/requests/pin-requests.js +7 -0
- package/requests/promote-requests.d.ts +3 -0
- package/requests/promote-requests.js +7 -0
- package/requests/refund-requests.d.ts +3 -0
- package/requests/refund-requests.js +7 -0
- package/requests/reopen-requests.d.ts +4 -0
- package/requests/reopen-requests.js +11 -0
- package/requests/replace-requests.d.ts +3 -0
- package/requests/replace-requests.js +14 -0
- package/requests/restrict-requests.d.ts +3 -0
- package/requests/restrict-requests.js +7 -0
- package/requests/revoke-requests.d.ts +3 -0
- package/requests/revoke-requests.js +7 -0
- package/requests/send-requests.d.ts +24 -0
- package/requests/send-requests.js +102 -0
- package/requests/set-requests.d.ts +24 -0
- package/requests/set-requests.js +95 -0
- package/requests/stop-requests.d.ts +4 -0
- package/requests/stop-requests.js +11 -0
- package/requests/unban-requests.d.ts +4 -0
- package/requests/unban-requests.js +11 -0
- package/requests/unhide-requests.d.ts +3 -0
- package/requests/unhide-requests.js +7 -0
- package/requests/unpin-requests.d.ts +6 -0
- package/requests/unpin-requests.js +19 -0
- package/requests/upload-requests.d.ts +3 -0
- package/requests/upload-requests.js +7 -0
- package/requests/webhook-requests.d.ts +6 -0
- package/requests/webhook-requests.js +20 -0
- package/utils/callback-query-utils.d.ts +3 -0
- package/utils/callback-query-utils.js +25 -0
- package/utils/command-utils.d.ts +5 -0
- package/utils/command-utils.js +28 -0
- package/utils/context-utils.d.ts +11 -0
- package/utils/context-utils.js +42 -0
- package/utils/html-utils.d.ts +2 -0
- package/utils/html-utils.js +18 -0
- package/utils/inline-keyboard-utils.d.ts +12 -0
- package/utils/inline-keyboard-utils.js +43 -0
- package/utils/reply-to-message-utils.d.ts +6 -0
- package/utils/reply-to-message-utils.js +36 -0
- package/utils/start-message-utils.d.ts +6 -0
- package/utils/start-message-utils.js +40 -0
- package/builders/button.builder.d.ts +0 -11
- package/builders/button.builder.js +0 -31
- package/childs/add.d.ts +0 -6
- package/childs/add.js +0 -10
- package/childs/answer.d.ts +0 -9
- package/childs/answer.js +0 -19
- package/childs/ban.d.ts +0 -6
- package/childs/ban.js +0 -10
- package/childs/create.d.ts +0 -6
- package/childs/create.js +0 -17
- package/childs/delete.d.ts +0 -8
- package/childs/delete.js +0 -19
- package/childs/download.d.ts +0 -8
- package/childs/download.js +0 -32
- package/childs/edit.d.ts +0 -10
- package/childs/edit.js +0 -22
- package/childs/export.d.ts +0 -5
- package/childs/export.js +0 -10
- package/childs/forward.d.ts +0 -6
- package/childs/forward.js +0 -15
- package/childs/get.d.ts +0 -15
- package/childs/get.js +0 -37
- package/childs/leave.d.ts +0 -5
- package/childs/leave.js +0 -10
- package/childs/pin.d.ts +0 -6
- package/childs/pin.js +0 -10
- package/childs/polling.d.ts +0 -9
- package/childs/polling.js +0 -34
- package/childs/privates/send.private.d.ts +0 -7
- package/childs/privates/send.private.js +0 -19
- package/childs/promote.d.ts +0 -6
- package/childs/promote.js +0 -10
- package/childs/restrict.d.ts +0 -6
- package/childs/restrict.js +0 -15
- package/childs/send.d.ts +0 -31
- package/childs/send.js +0 -130
- package/childs/set.d.ts +0 -17
- package/childs/set.js +0 -44
- package/childs/stop.d.ts +0 -7
- package/childs/stop.js +0 -13
- package/childs/unban.d.ts +0 -5
- package/childs/unban.js +0 -10
- package/childs/unpin.d.ts +0 -5
- package/childs/unpin.js +0 -10
- package/childs/upload.d.ts +0 -7
- package/childs/upload.js +0 -10
- package/childs/webhook.d.ts +0 -8
- package/childs/webhook.js +0 -22
- package/loggers/module.logger.d.ts +0 -2
- package/modules/api.d.ts +0 -5
- package/modules/api.js +0 -24
- package/modules/builder.d.ts +0 -4
- package/modules/builder.js +0 -8
- package/modules/child.d.ts +0 -5
- package/modules/child.js +0 -10
- package/modules/configuration.d.ts +0 -8
- package/modules/configuration.js +0 -10
- package/modules/dummy.d.ts +0 -9
- package/modules/dummy.js +0 -56
- package/modules/telegram.d.ts +0 -87
- package/modules/telegram.js +0 -358
- package/utils/callback.query.utils.d.ts +0 -5
- package/utils/callback.query.utils.js +0 -26
- package/utils/command.utils.d.ts +0 -7
- package/utils/command.utils.js +0 -29
- package/utils/context.utils.d.ts +0 -13
- package/utils/context.utils.js +0 -41
- package/utils/html.utils.d.ts +0 -5
- package/utils/html.utils.js +0 -20
- package/utils/inline.keyboard.utils.d.ts +0 -4
- package/utils/inline.keyboard.utils.js +0 -26
- package/utils/reply.to.message.utils.d.ts +0 -6
- package/utils/reply.to.message.utils.js +0 -27
- package/utils/start.utils.d.ts +0 -7
- package/utils/start.utils.js +0 -32
package/index.d.ts
CHANGED
|
@@ -1,497 +1,737 @@
|
|
|
1
|
-
import { AddStickerToSet } from '@aracna/telegram-bot-types';
|
|
2
|
-
import { AnswerCallbackQuery } from '@aracna/telegram-bot-types';
|
|
3
|
-
import { AnswerInlineQuery } from '@aracna/telegram-bot-types';
|
|
4
|
-
import { AnswerPreCheckoutQuery } from '@aracna/telegram-bot-types';
|
|
5
|
-
import { AnswerShippingQuery } from '@aracna/telegram-bot-types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
1
|
+
import type { AddStickerToSet } from '@aracna/telegram-bot-types';
|
|
2
|
+
import type { AnswerCallbackQuery } from '@aracna/telegram-bot-types';
|
|
3
|
+
import type { AnswerInlineQuery } from '@aracna/telegram-bot-types';
|
|
4
|
+
import type { AnswerPreCheckoutQuery } from '@aracna/telegram-bot-types';
|
|
5
|
+
import type { AnswerShippingQuery } from '@aracna/telegram-bot-types';
|
|
6
|
+
import type { AnswerWebAppQuery } from '@aracna/telegram-bot-types';
|
|
7
|
+
import type { ApproveChatJoinRequest } from '@aracna/telegram-bot-types';
|
|
8
|
+
import type { BanChatMember } from '@aracna/telegram-bot-types';
|
|
9
|
+
import type { BanChatSenderChat } from '@aracna/telegram-bot-types';
|
|
10
|
+
import type { BotCommand } from '@aracna/telegram-bot-types';
|
|
11
|
+
import type { BotDescription } from '@aracna/telegram-bot-types';
|
|
12
|
+
import type { BotName } from '@aracna/telegram-bot-types';
|
|
13
|
+
import type { BotShortDescription } from '@aracna/telegram-bot-types';
|
|
14
|
+
import type { BusinessConnection } from '@aracna/telegram-bot-types';
|
|
15
|
+
import type { BusinessMessagesDeleted } from '@aracna/telegram-bot-types';
|
|
16
|
+
import type { CallbackQuery as CallbackQuery_2 } from '@aracna/telegram-bot-types';
|
|
17
|
+
import type { Chat } from '@aracna/telegram-bot-types';
|
|
18
|
+
import type { ChatAdministratorRights } from '@aracna/telegram-bot-types';
|
|
19
|
+
import type { ChatBoostRemoved } from '@aracna/telegram-bot-types';
|
|
20
|
+
import type { ChatBoostUpdated } from '@aracna/telegram-bot-types';
|
|
21
|
+
import type { ChatInviteLink } from '@aracna/telegram-bot-types';
|
|
22
|
+
import type { ChatJoinRequest } from '@aracna/telegram-bot-types';
|
|
23
|
+
import type { ChatMember } from '@aracna/telegram-bot-types';
|
|
24
|
+
import type { ChatMemberUpdated } from '@aracna/telegram-bot-types';
|
|
25
|
+
import type { ChosenInlineResult } from '@aracna/telegram-bot-types';
|
|
26
|
+
import type { CloseForumTopic } from '@aracna/telegram-bot-types';
|
|
27
|
+
import type { CloseGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
28
|
+
import type { Context as Context_2 } from 'vm';
|
|
29
|
+
import type { CopyMessage } from '@aracna/telegram-bot-types';
|
|
30
|
+
import type { CopyMessages } from '@aracna/telegram-bot-types';
|
|
31
|
+
import type { CreateChatInviteLink } from '@aracna/telegram-bot-types';
|
|
32
|
+
import type { CreateChatSubscriptionInviteLink } from '@aracna/telegram-bot-types';
|
|
33
|
+
import type { CreateForumTopic } from '@aracna/telegram-bot-types';
|
|
34
|
+
import type { CreateInvoiceLink } from '@aracna/telegram-bot-types';
|
|
35
|
+
import type { CreateNewStickerSet } from '@aracna/telegram-bot-types';
|
|
36
|
+
import type { DeclineChatJoinRequest } from '@aracna/telegram-bot-types';
|
|
37
|
+
import type { DeleteChatPhoto } from '@aracna/telegram-bot-types';
|
|
38
|
+
import type { DeleteChatStickerSet } from '@aracna/telegram-bot-types';
|
|
39
|
+
import type { DeleteForumTopic } from '@aracna/telegram-bot-types';
|
|
40
|
+
import type { DeleteMessage } from '@aracna/telegram-bot-types';
|
|
41
|
+
import type { DeleteMessages } from '@aracna/telegram-bot-types';
|
|
42
|
+
import type { DeleteMyCommands } from '@aracna/telegram-bot-types';
|
|
43
|
+
import type { DeleteStickerFromSet } from '@aracna/telegram-bot-types';
|
|
44
|
+
import type { DeleteStickerSet } from '@aracna/telegram-bot-types';
|
|
45
|
+
import type { DeleteWebhook } from '@aracna/telegram-bot-types';
|
|
46
|
+
import type { EditChatInviteLink } from '@aracna/telegram-bot-types';
|
|
47
|
+
import type { EditChatSubscriptionInviteLink } from '@aracna/telegram-bot-types';
|
|
48
|
+
import type { EditForumTopic } from '@aracna/telegram-bot-types';
|
|
49
|
+
import type { EditGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
50
|
+
import type { EditMessageCaption } from '@aracna/telegram-bot-types';
|
|
51
|
+
import type { EditMessageLiveLocation } from '@aracna/telegram-bot-types';
|
|
52
|
+
import type { EditMessageMedia } from '@aracna/telegram-bot-types';
|
|
53
|
+
import type { EditMessageReplyMarkup } from '@aracna/telegram-bot-types';
|
|
54
|
+
import type { EditMessageText } from '@aracna/telegram-bot-types';
|
|
55
|
+
import type { ExportChatInviteLink } from '@aracna/telegram-bot-types';
|
|
22
56
|
import { FetchError } from '@aracna/core';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
57
|
+
import type { FetchResponse } from '@aracna/core';
|
|
58
|
+
import type { File as File_2 } from '@aracna/telegram-bot-types';
|
|
59
|
+
import type { ForumTopic } from '@aracna/telegram-bot-types';
|
|
60
|
+
import type { ForwardMessage } from '@aracna/telegram-bot-types';
|
|
61
|
+
import type { ForwardMessages } from '@aracna/telegram-bot-types';
|
|
62
|
+
import type { GameHighScore } from '@aracna/telegram-bot-types';
|
|
63
|
+
import type { GetBusinessConnection } from '@aracna/telegram-bot-types';
|
|
64
|
+
import type { GetChat } from '@aracna/telegram-bot-types';
|
|
65
|
+
import type { GetChatAdministrators } from '@aracna/telegram-bot-types';
|
|
66
|
+
import type { GetChatMember } from '@aracna/telegram-bot-types';
|
|
67
|
+
import type { GetChatMemberCount } from '@aracna/telegram-bot-types';
|
|
68
|
+
import type { GetChatMenuButton } from '@aracna/telegram-bot-types';
|
|
69
|
+
import type { GetCustomEmojiStickers } from '@aracna/telegram-bot-types';
|
|
70
|
+
import type { GetFile } from '@aracna/telegram-bot-types';
|
|
71
|
+
import type { GetGameHighScores } from '@aracna/telegram-bot-types';
|
|
72
|
+
import type { GetMyCommands } from '@aracna/telegram-bot-types';
|
|
73
|
+
import type { GetMyDefaultAdministratorRights } from '@aracna/telegram-bot-types';
|
|
74
|
+
import type { GetMyDescription } from '@aracna/telegram-bot-types';
|
|
75
|
+
import type { GetMyName } from '@aracna/telegram-bot-types';
|
|
76
|
+
import type { GetMyShortDescription } from '@aracna/telegram-bot-types';
|
|
77
|
+
import type { GetStarTransactions } from '@aracna/telegram-bot-types';
|
|
78
|
+
import type { GetStickerSet } from '@aracna/telegram-bot-types';
|
|
79
|
+
import type { GetUpdates } from '@aracna/telegram-bot-types';
|
|
80
|
+
import type { GetUserChatBoosts } from '@aracna/telegram-bot-types';
|
|
81
|
+
import type { GetUserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
82
|
+
import type { HideGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
83
|
+
import type { InlineKeyboardButton } from '@aracna/telegram-bot-types';
|
|
84
|
+
import type { InlineQuery } from '@aracna/telegram-bot-types';
|
|
85
|
+
import type { InputMediaAudio } from '@aracna/telegram-bot-types';
|
|
86
|
+
import type { InputMediaDocument } from '@aracna/telegram-bot-types';
|
|
87
|
+
import type { InputMediaPhoto } from '@aracna/telegram-bot-types';
|
|
88
|
+
import type { InputMediaVideo } from '@aracna/telegram-bot-types';
|
|
89
|
+
import type { LeaveChat } from '@aracna/telegram-bot-types';
|
|
90
|
+
import { Logger } from '@aracna/core';
|
|
91
|
+
import type { LoginUrl } from '@aracna/telegram-bot-types';
|
|
92
|
+
import type { MenuButton } from '@aracna/telegram-bot-types';
|
|
93
|
+
import type { Message } from '@aracna/telegram-bot-types';
|
|
94
|
+
import type { MessageEntity } from '@aracna/telegram-bot-types';
|
|
95
|
+
import type { MessageId } from '@aracna/telegram-bot-types';
|
|
96
|
+
import type { MessageReactionCountUpdated } from '@aracna/telegram-bot-types';
|
|
97
|
+
import type { MessageReactionUpdated } from '@aracna/telegram-bot-types';
|
|
98
|
+
import type { PinChatMessage } from '@aracna/telegram-bot-types';
|
|
99
|
+
import type { Poll } from '@aracna/telegram-bot-types';
|
|
100
|
+
import type { PollAnswer } from '@aracna/telegram-bot-types';
|
|
101
|
+
import type { PreCheckoutQuery } from '@aracna/telegram-bot-types';
|
|
102
|
+
import type { PromoteChatMember } from '@aracna/telegram-bot-types';
|
|
103
|
+
import { Queue } from '@aracna/core';
|
|
104
|
+
import type { RefundStarPayment } from '@aracna/telegram-bot-types';
|
|
105
|
+
import type { ReopenForumTopic } from '@aracna/telegram-bot-types';
|
|
106
|
+
import type { ReopenGeneralForumTopic } from '@aracna/telegram-bot-types';
|
|
107
|
+
import type { ReplaceStickerInSet } from '@aracna/telegram-bot-types';
|
|
49
108
|
import { RequestMethod } from '@aracna/core';
|
|
50
109
|
import { RestAPI } from '@aracna/core';
|
|
51
|
-
import { RestApiConfig } from '@aracna/core';
|
|
52
|
-
import { RestrictChatMember } from '@aracna/telegram-bot-types';
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
110
|
+
import type { RestApiConfig } from '@aracna/core';
|
|
111
|
+
import type { RestrictChatMember } from '@aracna/telegram-bot-types';
|
|
112
|
+
import type { RevokeChatInviteLink } from '@aracna/telegram-bot-types';
|
|
113
|
+
import type { SendAnimation } from '@aracna/telegram-bot-types';
|
|
114
|
+
import type { SendAudio } from '@aracna/telegram-bot-types';
|
|
115
|
+
import type { SendChatAction } from '@aracna/telegram-bot-types';
|
|
116
|
+
import type { SendContact } from '@aracna/telegram-bot-types';
|
|
117
|
+
import type { SendDice } from '@aracna/telegram-bot-types';
|
|
118
|
+
import type { SendDocument } from '@aracna/telegram-bot-types';
|
|
119
|
+
import type { SendGame } from '@aracna/telegram-bot-types';
|
|
120
|
+
import type { SendInvoice } from '@aracna/telegram-bot-types';
|
|
121
|
+
import type { SendLocation } from '@aracna/telegram-bot-types';
|
|
122
|
+
import type { SendMediaGroup } from '@aracna/telegram-bot-types';
|
|
123
|
+
import type { SendMessage } from '@aracna/telegram-bot-types';
|
|
124
|
+
import type { SendPaidMedia } from '@aracna/telegram-bot-types';
|
|
125
|
+
import type { SendPhoto } from '@aracna/telegram-bot-types';
|
|
126
|
+
import type { SendPoll } from '@aracna/telegram-bot-types';
|
|
127
|
+
import type { SendSticker } from '@aracna/telegram-bot-types';
|
|
128
|
+
import type { SendVenue } from '@aracna/telegram-bot-types';
|
|
129
|
+
import type { SendVideo } from '@aracna/telegram-bot-types';
|
|
130
|
+
import type { SendVideoNote } from '@aracna/telegram-bot-types';
|
|
131
|
+
import type { SendVoice } from '@aracna/telegram-bot-types';
|
|
132
|
+
import type { SentWebAppMessage } from '@aracna/telegram-bot-types';
|
|
133
|
+
import type { SetChatAdministratorCustomTitle } from '@aracna/telegram-bot-types';
|
|
134
|
+
import type { SetChatDescription } from '@aracna/telegram-bot-types';
|
|
135
|
+
import type { SetChatMenuButton } from '@aracna/telegram-bot-types';
|
|
136
|
+
import type { SetChatPermissions } from '@aracna/telegram-bot-types';
|
|
137
|
+
import type { SetChatPhoto } from '@aracna/telegram-bot-types';
|
|
138
|
+
import type { SetChatStickerSet } from '@aracna/telegram-bot-types';
|
|
139
|
+
import type { SetChatTitle } from '@aracna/telegram-bot-types';
|
|
140
|
+
import type { SetCustomEmojiStickerSetThumbnail } from '@aracna/telegram-bot-types';
|
|
141
|
+
import type { SetGameScore } from '@aracna/telegram-bot-types';
|
|
142
|
+
import type { SetMessageReaction } from '@aracna/telegram-bot-types';
|
|
143
|
+
import type { SetMyCommands } from '@aracna/telegram-bot-types';
|
|
144
|
+
import type { SetMyDefaultAdministratorRights } from '@aracna/telegram-bot-types';
|
|
145
|
+
import type { SetMyDescription } from '@aracna/telegram-bot-types';
|
|
146
|
+
import type { SetMyName } from '@aracna/telegram-bot-types';
|
|
147
|
+
import type { SetMyShortDescription } from '@aracna/telegram-bot-types';
|
|
148
|
+
import type { SetPassportDataErrors } from '@aracna/telegram-bot-types';
|
|
149
|
+
import type { SetStickerEmojiList } from '@aracna/telegram-bot-types';
|
|
150
|
+
import type { SetStickerKeywords } from '@aracna/telegram-bot-types';
|
|
151
|
+
import type { SetStickerMaskPosition } from '@aracna/telegram-bot-types';
|
|
152
|
+
import type { SetStickerPositionInSet } from '@aracna/telegram-bot-types';
|
|
153
|
+
import type { SetStickerSetThumbnail } from '@aracna/telegram-bot-types';
|
|
154
|
+
import type { SetStickerSetTitle } from '@aracna/telegram-bot-types';
|
|
155
|
+
import type { SetWebhook } from '@aracna/telegram-bot-types';
|
|
156
|
+
import type { ShippingQuery } from '@aracna/telegram-bot-types';
|
|
157
|
+
import type { StarTransactions } from '@aracna/telegram-bot-types';
|
|
158
|
+
import type { Sticker } from '@aracna/telegram-bot-types';
|
|
159
|
+
import type { StickerSet } from '@aracna/telegram-bot-types';
|
|
160
|
+
import type { StopMessageLiveLocation } from '@aracna/telegram-bot-types';
|
|
161
|
+
import type { StopPoll } from '@aracna/telegram-bot-types';
|
|
162
|
+
import type { SwitchInlineQueryChosenChat } from '@aracna/telegram-bot-types';
|
|
163
|
+
import type { UnbanChatMember } from '@aracna/telegram-bot-types';
|
|
164
|
+
import type { UnbanChatSenderChat } from '@aracna/telegram-bot-types';
|
|
165
|
+
import type { UnpinAllChatMessages } from '@aracna/telegram-bot-types';
|
|
166
|
+
import type { UnpinAllForumTopicMessages } from '@aracna/telegram-bot-types';
|
|
167
|
+
import type { UnpinAllGeneralForumTopicMessages } from '@aracna/telegram-bot-types';
|
|
168
|
+
import type { UnpinChatMessage } from '@aracna/telegram-bot-types';
|
|
169
|
+
import type { Update } from '@aracna/telegram-bot-types';
|
|
170
|
+
import type { UploadStickerFile } from '@aracna/telegram-bot-types';
|
|
171
|
+
import type { User } from '@aracna/telegram-bot-types';
|
|
172
|
+
import type { UserChatBoosts } from '@aracna/telegram-bot-types';
|
|
173
|
+
import type { UserProfilePhotos } from '@aracna/telegram-bot-types';
|
|
174
|
+
import type { WebAppInfo } from '@aracna/telegram-bot-types';
|
|
175
|
+
import type { WebhookInfo } from '@aracna/telegram-bot-types';
|
|
176
|
+
|
|
177
|
+
export declare function addTelegramStickerToSet(token: string, body: AddStickerToSet): Promise<boolean | FetchError>;
|
|
178
|
+
|
|
179
|
+
export declare function answerTelegramCallbackQuery(token: string, body: AnswerCallbackQuery): Promise<boolean | FetchError>;
|
|
180
|
+
|
|
181
|
+
export declare function answerTelegramInlineQuery(token: string, body: AnswerInlineQuery): Promise<boolean | FetchError>;
|
|
182
|
+
|
|
183
|
+
export declare function answerTelegramPreCheckoutQuery(token: string, body: AnswerPreCheckoutQuery): Promise<boolean | FetchError>;
|
|
184
|
+
|
|
185
|
+
export declare function answerTelegramShippingQuery(token: string, body: AnswerShippingQuery): Promise<boolean | FetchError>;
|
|
186
|
+
|
|
187
|
+
export declare function answerTelegramWebAppQuery(token: string, body: AnswerWebAppQuery): Promise<SentWebAppMessage | FetchError>;
|
|
188
|
+
|
|
189
|
+
declare class API extends RestAPI<TelegramApiDefinitions.Config> {
|
|
190
|
+
queue: Queue;
|
|
191
|
+
post<V, W, X = undefined>(path: string, body: W | undefined, config: TelegramApiDefinitions.Config): Promise<V | FetchError<X>>;
|
|
192
|
+
transformBody<V>(method: RequestMethod, path: string, body: V, config: TelegramApiDefinitions.Config): Promise<V | FormData | undefined>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare class API_2 extends RestAPI<TelegramApiDefinitions.Config> {
|
|
196
|
+
get<V, W = undefined>(path: string, config: TelegramApiDefinitions.Config): Promise<V | FetchError<W>>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export declare function approveTelegramChatJoinRequest(token: string, body: ApproveChatJoinRequest): Promise<boolean | FetchError>;
|
|
200
|
+
|
|
201
|
+
export declare function banTelegramChatMember(token: string, body: BanChatMember): Promise<boolean | FetchError>;
|
|
202
|
+
|
|
203
|
+
export declare function banTelegramChatSenderChat(token: string, body: BanChatSenderChat): Promise<boolean | FetchError>;
|
|
204
|
+
|
|
205
|
+
export declare interface CallbackQuery<T = unknown> extends CallbackQuery_2 {
|
|
206
|
+
body: CallbackQueryBody<T>;
|
|
84
207
|
}
|
|
85
208
|
|
|
86
|
-
declare
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
shippingQuery(id: string, ok: boolean, parameters?: Partial<AnswerShippingQuery>): Promise<boolean | FetchError>;
|
|
209
|
+
export declare interface CallbackQueryBody<T = unknown> {
|
|
210
|
+
c?: bigint | number;
|
|
211
|
+
d: T;
|
|
212
|
+
m?: string;
|
|
91
213
|
}
|
|
92
214
|
|
|
93
|
-
declare
|
|
94
|
-
post<V, W, X = undefined>(path: string, body?: W, config?: RestApiConfig<void>): Promise<V | FetchError<X>>;
|
|
95
|
-
transformBody<V>(method: RequestMethod, path: string, body: V, config: RestApiConfig<void>): Promise<FormData>;
|
|
96
|
-
}
|
|
215
|
+
export declare function closeTelegramForumTopic(token: string, body: CloseForumTopic): Promise<boolean | FetchError>;
|
|
97
216
|
|
|
98
|
-
declare
|
|
99
|
-
chatMember(chatID: number, userID: number, parameters?: Partial<BanChatMember>): Promise<boolean | FetchError>;
|
|
100
|
-
}
|
|
217
|
+
export declare function closeTelegramGeneralForumTopic(token: string, body: CloseGeneralForumTopic): Promise<boolean | FetchError>;
|
|
101
218
|
|
|
102
|
-
declare
|
|
103
|
-
button: ButtonBuilder;
|
|
104
|
-
}
|
|
219
|
+
export declare function closeTelegramWebhook(token: string): Promise<boolean | FetchError>;
|
|
105
220
|
|
|
106
|
-
declare
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
221
|
+
export declare interface Context {
|
|
222
|
+
business_connection: BusinessConnection;
|
|
223
|
+
business_message: Message;
|
|
224
|
+
callback_query: CallbackQuery;
|
|
225
|
+
channel_post: Message;
|
|
226
|
+
chat_boost: ChatBoostUpdated;
|
|
227
|
+
chat_join_request: ChatJoinRequest;
|
|
228
|
+
chat_member: ChatMemberUpdated;
|
|
229
|
+
chosen_inline_result: ChosenInlineResult;
|
|
230
|
+
deleted_business_messages: BusinessMessagesDeleted;
|
|
231
|
+
document: Message;
|
|
232
|
+
edited_business_message: Message;
|
|
233
|
+
edited_channel_post: Message;
|
|
234
|
+
edited_message: Message;
|
|
235
|
+
inline_query: InlineQuery;
|
|
236
|
+
message: Message;
|
|
237
|
+
message_reaction: MessageReactionUpdated;
|
|
238
|
+
message_reaction_count: MessageReactionCountUpdated;
|
|
239
|
+
my_chat_member: ChatMemberUpdated;
|
|
240
|
+
poll: Poll;
|
|
241
|
+
poll_answer: PollAnswer;
|
|
242
|
+
pre_checkout_query: PreCheckoutQuery;
|
|
243
|
+
removed_chat_boost: ChatBoostRemoved;
|
|
244
|
+
reply_to_message: ReplyToMessage;
|
|
245
|
+
shipping_query: ShippingQuery;
|
|
246
|
+
start: Start;
|
|
115
247
|
}
|
|
116
248
|
|
|
117
|
-
export declare
|
|
118
|
-
body: CallbackQueryBody<T>;
|
|
119
|
-
}
|
|
249
|
+
export declare function copyTelegramMessage(token: string, body: CopyMessage): Promise<MessageId | FetchError>;
|
|
120
250
|
|
|
121
|
-
export declare
|
|
122
|
-
c?: number;
|
|
123
|
-
d: T;
|
|
124
|
-
t: string;
|
|
125
|
-
}
|
|
251
|
+
export declare function copyTelegramMessages(token: string, body: CopyMessages): Promise<MessageId[] | FetchError>;
|
|
126
252
|
|
|
127
|
-
export declare
|
|
128
|
-
static decodeBody<T>(data?: string): CallbackQueryBody<T>;
|
|
129
|
-
static encodeBody<T>(data: T, type: string, chatID?: number): string;
|
|
130
|
-
}
|
|
253
|
+
export declare function createTelegramChatInviteLink(token: string, body: CreateChatInviteLink): Promise<ChatInviteLink | FetchError>;
|
|
131
254
|
|
|
132
|
-
declare
|
|
133
|
-
protected telegram: Telegram;
|
|
134
|
-
constructor(telegram: Telegram);
|
|
135
|
-
}
|
|
255
|
+
export declare function createTelegramChatSubscriptionInviteLink(token: string, body: CreateChatSubscriptionInviteLink): Promise<ChatInviteLink | FetchError>;
|
|
136
256
|
|
|
137
|
-
export declare
|
|
138
|
-
static getByContext<T extends UpdateType>(context: Context_2[T]): string;
|
|
139
|
-
static get(string?: string): string;
|
|
140
|
-
static omit(string: string): string;
|
|
141
|
-
}
|
|
257
|
+
export declare function createTelegramForumTopic(token: string, body: CreateForumTopic): Promise<ForumTopic | FetchError>;
|
|
142
258
|
|
|
143
|
-
declare
|
|
144
|
-
post: {
|
|
145
|
-
callback: {
|
|
146
|
-
success: <T, U>(body: T, result: U | Error) => void;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
}
|
|
259
|
+
export declare function createTelegramInvoiceLink(token: string, body: CreateInvoiceLink): Promise<string | FetchError>;
|
|
150
260
|
|
|
151
|
-
declare
|
|
152
|
-
api: ConfigurationAPI;
|
|
153
|
-
default: ConfigurationDefault;
|
|
154
|
-
handler: ConfigurationHandler;
|
|
155
|
-
}
|
|
261
|
+
export declare function createTelegramNewStickerSet(token: string, body: CreateNewStickerSet): Promise<boolean | FetchError>;
|
|
156
262
|
|
|
157
|
-
declare
|
|
158
|
-
buttons: {
|
|
159
|
-
text: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
160
|
-
url: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
161
|
-
login: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
162
|
-
callback: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
163
|
-
query: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
164
|
-
queryCurrentChat: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
165
|
-
game: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
166
|
-
pay: (chatID: number) => Promise<InlineKeyboardButton[]>;
|
|
167
|
-
};
|
|
168
|
-
}
|
|
263
|
+
export declare function declineTelegramChatJoinRequest(token: string, body: DeclineChatJoinRequest): Promise<boolean | FetchError>;
|
|
169
264
|
|
|
170
|
-
declare
|
|
171
|
-
send: {
|
|
172
|
-
buttons: {
|
|
173
|
-
empty: (chatID: number) => Error;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
}
|
|
265
|
+
export declare function decodeTelegramCallbackQueryBody<T>(data?: string): CallbackQueryBody<T>;
|
|
177
266
|
|
|
178
|
-
export declare
|
|
179
|
-
[UpdateType.CALLBACK_QUERY]: CallbackQuery;
|
|
180
|
-
[UpdateType.CHANNEL_POST]: Message;
|
|
181
|
-
[UpdateType.CHAT_JOIN_REQUEST]: ChatJoinRequest;
|
|
182
|
-
[UpdateType.CHAT_MEMBER]: ChatMemberUpdated;
|
|
183
|
-
[UpdateType.CHOSEN_INLINE_RESULT]: ChosenInlineResult;
|
|
184
|
-
[UpdateType.DOCUMENT]: Message;
|
|
185
|
-
[UpdateType.EDITED_CHANNEL_POST]: Message;
|
|
186
|
-
[UpdateType.EDITED_MESSAGE]: Message;
|
|
187
|
-
[UpdateType.INLINE_QUERY]: InlineQuery;
|
|
188
|
-
[UpdateType.MESSAGE]: Message;
|
|
189
|
-
[UpdateType.MY_CHAT_MEMBER]: ChatMemberUpdated;
|
|
190
|
-
[UpdateType.POLL]: Poll;
|
|
191
|
-
[UpdateType.POLL_ANSWER]: PollAnswer;
|
|
192
|
-
[UpdateType.PRE_CHECKOUT_QUERY]: PreCheckoutQuery;
|
|
193
|
-
[UpdateType.REPLY_TO_MESSAGE]: ReplyToMessage;
|
|
194
|
-
[UpdateType.SHIPPING_QUERY]: ShippingQuery;
|
|
195
|
-
[UpdateType.START]: Start;
|
|
196
|
-
}
|
|
267
|
+
export declare function decodeTelegramReplyToMessageBody<T>(entities: MessageEntity[]): ReplyToMessageBody<T>;
|
|
197
268
|
|
|
198
|
-
export declare
|
|
199
|
-
static getChatID<T extends UpdateType>(context: Context[T]): number;
|
|
200
|
-
static getChatType<T extends UpdateType>(context: Context[T]): string;
|
|
201
|
-
static getChat<T extends UpdateType>(context: Context[T]): Chat;
|
|
202
|
-
static getUserID<T extends UpdateType>(context: Context[T]): number;
|
|
203
|
-
static getUserFirstName<T extends UpdateType>(context: Context[T]): string;
|
|
204
|
-
static getUserLastName<T extends UpdateType>(context: Context[T]): string;
|
|
205
|
-
static getUserUsername<T extends UpdateType>(context: Context[T]): string;
|
|
206
|
-
static getUser<T extends UpdateType>(context: Context[T]): User;
|
|
207
|
-
}
|
|
269
|
+
export declare function decodeTelegramStartBody<T>(text: string | undefined): StartBody<T>;
|
|
208
270
|
|
|
209
|
-
declare
|
|
210
|
-
stickerSet(userID: number, type: string, name: string, title: string, stickers: InputSticker[], parameters: Partial<CreateNewStickerSet>): Promise<boolean | FetchError>;
|
|
211
|
-
}
|
|
271
|
+
export declare const DEFAULT_TELEGRAM_ALLOWED_UPDATES: string[];
|
|
212
272
|
|
|
213
|
-
declare
|
|
214
|
-
chatPhoto(chatID: number): Promise<boolean | FetchError>;
|
|
215
|
-
chatStickerSet(chatID: number): Promise<boolean | FetchError>;
|
|
216
|
-
message(chatID: number, message: number): Promise<boolean | FetchError>;
|
|
217
|
-
stickerFromSet(sticker: string): Promise<boolean | FetchError>;
|
|
218
|
-
}
|
|
273
|
+
export declare const DEFAULT_TELEGRAM_CALLBACK_QUERY_BODY: () => CallbackQueryBody<any>;
|
|
219
274
|
|
|
220
|
-
declare
|
|
221
|
-
api: API;
|
|
222
|
-
file(id: string): Promise<Buffer | FetchError>;
|
|
223
|
-
userFirstProfilePhoto(id: number): Promise<Buffer | FetchError | Error>;
|
|
224
|
-
}
|
|
275
|
+
export declare const DEFAULT_TELEGRAM_CLIENT_LISTENER_OPTIONS: () => TelegramClientListenerOptions;
|
|
225
276
|
|
|
226
|
-
declare
|
|
227
|
-
messageCaption(parameters: EditMessageCaption): Promise<Message | FetchError>;
|
|
228
|
-
messageLiveLocation(latitude: number, longitude: number, parameters: Partial<EditMessageLiveLocation>): Promise<Message | FetchError>;
|
|
229
|
-
messageMedia(media: InputMedia, parameters: Partial<EditMessageMedia>): Promise<Message | FetchError>;
|
|
230
|
-
messageReplyMarkup(parameters: EditMessageReplyMarkup): Promise<Message | FetchError>;
|
|
231
|
-
messageText(text: string, parameters: Partial<EditMessageText>): Promise<Message | FetchError>;
|
|
232
|
-
}
|
|
277
|
+
export declare const DEFAULT_TELEGRAM_CLIENT_POLLING_MS: number;
|
|
233
278
|
|
|
234
|
-
declare
|
|
235
|
-
chatInviteLink(chatID: number): Promise<string | FetchError>;
|
|
236
|
-
}
|
|
279
|
+
export declare const DEFAULT_TELEGRAM_REPLY_TO_MESSAGE_BODY: () => ReplyToMessageBody<any>;
|
|
237
280
|
|
|
238
|
-
declare
|
|
239
|
-
message(chatID: number, fromChatID: number, messageID: number, parameters?: Partial<ForwardMessage>): Promise<Message | FetchError>;
|
|
240
|
-
}
|
|
281
|
+
export declare const DEFAULT_TELEGRAM_START_MESSAGE_BODY: () => StartBody<any>;
|
|
241
282
|
|
|
242
|
-
declare
|
|
243
|
-
chat(id: number): Promise<Chat | FetchError>;
|
|
244
|
-
chatAdministrators(id: number): Promise<ChatMember[] | FetchError>;
|
|
245
|
-
chatMember(chatID: number, userID: number): Promise<ChatMember | FetchError>;
|
|
246
|
-
chatMemberCount(id: number): Promise<number | FetchError>;
|
|
247
|
-
commands(): Promise<BotCommand[] | FetchError>;
|
|
248
|
-
file(id: string): Promise<File_2 | FetchError>;
|
|
249
|
-
gameHighScores(userID: number, parameters?: Partial<GetGameHighScores>): Promise<GameHighScore | FetchError>;
|
|
250
|
-
me(): Promise<User | FetchError>;
|
|
251
|
-
stickerSet(name: string): Promise<StickerSet | FetchError>;
|
|
252
|
-
userProfilePhotos(id: number, parameters?: Partial<GetUserProfilePhotos>): Promise<UserProfilePhotos | FetchError>;
|
|
253
|
-
}
|
|
283
|
+
export declare function deleteTelegramChatPhoto(token: string, body: DeleteChatPhoto): Promise<boolean | FetchError>;
|
|
254
284
|
|
|
255
|
-
export declare
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
285
|
+
export declare function deleteTelegramChatStickerSet(token: string, body: DeleteChatStickerSet): Promise<boolean | FetchError>;
|
|
286
|
+
|
|
287
|
+
export declare function deleteTelegramCommands(token: string, body?: DeleteMyCommands): Promise<boolean | FetchError>;
|
|
288
|
+
|
|
289
|
+
export declare function deleteTelegramForumTopic(token: string, body: DeleteForumTopic): Promise<boolean | FetchError>;
|
|
290
|
+
|
|
291
|
+
export declare function deleteTelegramMessage(token: string, body: DeleteMessage): Promise<boolean | FetchError>;
|
|
292
|
+
|
|
293
|
+
export declare function deleteTelegramMessages(token: string, body: DeleteMessages): Promise<boolean | FetchError>;
|
|
294
|
+
|
|
295
|
+
export declare function deleteTelegramStickerFromSet(token: string, body: DeleteStickerFromSet): Promise<boolean | FetchError>;
|
|
296
|
+
|
|
297
|
+
export declare function deleteTelegramStickerSet(token: string, body: DeleteStickerSet): Promise<boolean | FetchError>;
|
|
298
|
+
|
|
299
|
+
export declare function deleteTelegramWebhook(token: string, body?: DeleteWebhook): Promise<boolean | FetchError>;
|
|
300
|
+
|
|
301
|
+
export declare function downloadTelegramFile(token: string, fileID: string): Promise<Blob | FetchError>;
|
|
302
|
+
|
|
303
|
+
export declare function downloadTelegramUserFirstProfilePhoto(token: string, userID: bigint | number): Promise<Blob | FetchError | Error>;
|
|
304
|
+
|
|
305
|
+
export declare interface EditMessageMediaAlternative extends Omit<EditMessageMedia, 'media'> {
|
|
306
|
+
media: InputMediaAlternative;
|
|
262
307
|
}
|
|
263
308
|
|
|
264
|
-
export declare
|
|
309
|
+
export declare function editTelegramChatInviteLink(token: string, body: EditChatInviteLink): Promise<ChatInviteLink | FetchError>;
|
|
265
310
|
|
|
266
|
-
export declare
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
311
|
+
export declare function editTelegramChatSubscriptionInviteLink(token: string, body: EditChatSubscriptionInviteLink): Promise<ChatInviteLink | FetchError>;
|
|
312
|
+
|
|
313
|
+
export declare function editTelegramForumTopic(token: string, body: EditForumTopic): Promise<boolean | FetchError>;
|
|
314
|
+
|
|
315
|
+
export declare function editTelegramGeneralForumTopic(token: string, body: EditGeneralForumTopic): Promise<boolean | FetchError>;
|
|
316
|
+
|
|
317
|
+
export declare function editTelegramMessageCaption(token: string, body: EditMessageCaption): Promise<Message | FetchError>;
|
|
318
|
+
|
|
319
|
+
export declare function editTelegramMessageLiveLocation(token: string, body: EditMessageLiveLocation): Promise<Message | FetchError>;
|
|
320
|
+
|
|
321
|
+
export declare function editTelegramMessageMedia(token: string, body: EditMessageMediaAlternative): Promise<Message | FetchError>;
|
|
322
|
+
|
|
323
|
+
export declare function editTelegramMessageReplyMarkup(token: string, body: EditMessageReplyMarkup): Promise<Message | FetchError>;
|
|
324
|
+
|
|
325
|
+
export declare function editTelegramMessageText(token: string, body: EditMessageText): Promise<Message | FetchError>;
|
|
326
|
+
|
|
327
|
+
export declare function encodeTelegramCallbackQueryBody<T>(data: T, options?: EncodeTelegramCallbackQueryBodyOptions): string;
|
|
328
|
+
|
|
329
|
+
export declare interface EncodeTelegramCallbackQueryBodyOptions {
|
|
330
|
+
chatID?: bigint | number;
|
|
331
|
+
command?: string;
|
|
270
332
|
}
|
|
271
333
|
|
|
272
|
-
export declare
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
334
|
+
export declare function encodeTelegramReplyToMessageBody<T>(data: T, options?: EncodeTelegramReplyToMessageBodyOptions): string;
|
|
335
|
+
|
|
336
|
+
export declare interface EncodeTelegramReplyToMessageBodyOptions {
|
|
337
|
+
chatID?: bigint | number;
|
|
338
|
+
command?: string;
|
|
276
339
|
}
|
|
277
340
|
|
|
278
|
-
export declare
|
|
279
|
-
|
|
341
|
+
export declare function encodeTelegramReplyToMessageBodyToAnchorTag<T>(data: T, options?: EncodeTelegramReplyToMessageBodyOptions): string;
|
|
342
|
+
|
|
343
|
+
export declare function encodeTelegramReplyToMessageBodyToURL<T>(data: T, options?: EncodeTelegramReplyToMessageBodyOptions): string;
|
|
344
|
+
|
|
345
|
+
export declare function encodeTelegramStartBody<T>(data: T, options?: EncodeTelegramStartBodyOptions): string;
|
|
346
|
+
|
|
347
|
+
export declare interface EncodeTelegramStartBodyOptions {
|
|
348
|
+
chatID?: bigint | number;
|
|
349
|
+
command?: string;
|
|
280
350
|
}
|
|
281
351
|
|
|
352
|
+
export declare function encodeTelegramStartBodyToAnchorTag<T>(username: string, children: string, data: T, options?: EncodeTelegramStartBodyOptions): string;
|
|
353
|
+
|
|
354
|
+
export declare function encodeTelegramStartBodyToText<T>(data: T, options?: EncodeTelegramStartBodyOptions): string;
|
|
355
|
+
|
|
356
|
+
export declare function encodeTelegramStartBodyToURL<T>(username: string, data: T, options?: EncodeTelegramStartBodyOptions): string;
|
|
357
|
+
|
|
358
|
+
export declare function exportTelegramChatInviteLink(token: string, body: ExportChatInviteLink): Promise<string | FetchError>;
|
|
359
|
+
|
|
360
|
+
export declare function forwardTelegramMessage(token: string, body: ForwardMessage): Promise<Message | FetchError>;
|
|
361
|
+
|
|
362
|
+
export declare function forwardTelegramMessages(token: string, body: ForwardMessages): Promise<MessageId[] | FetchError>;
|
|
363
|
+
|
|
364
|
+
export declare function getMyTelegramCommands(token: string, body?: GetMyCommands): Promise<BotCommand[] | FetchError>;
|
|
365
|
+
|
|
366
|
+
export declare function getMyTelegramDefaultAdministratorRights(token: string, body?: GetMyDefaultAdministratorRights): Promise<ChatAdministratorRights | FetchError>;
|
|
367
|
+
|
|
368
|
+
export declare function getMyTelegramDescription(token: string, body?: GetMyDescription): Promise<BotDescription | FetchError>;
|
|
369
|
+
|
|
370
|
+
export declare function getMyTelegramName(token: string, body?: GetMyName): Promise<BotName | FetchError>;
|
|
371
|
+
|
|
372
|
+
export declare function getMyTelegramShortDescription(token: string, body?: GetMyShortDescription): Promise<BotShortDescription | FetchError>;
|
|
373
|
+
|
|
374
|
+
export declare function getTelegramBusinessConnection(token: string, body: GetBusinessConnection): Promise<BusinessConnection | FetchError>;
|
|
375
|
+
|
|
376
|
+
export declare function getTelegramChat(token: string, body: GetChat): Promise<Chat | FetchError>;
|
|
377
|
+
|
|
378
|
+
export declare function getTelegramChatAdministrators(token: string, body: GetChatAdministrators): Promise<ChatMember[] | FetchError>;
|
|
379
|
+
|
|
380
|
+
export declare function getTelegramChatMember(token: string, body: GetChatMember): Promise<ChatMember | FetchError>;
|
|
381
|
+
|
|
382
|
+
export declare function getTelegramChatMemberCount(token: string, body: GetChatMemberCount): Promise<number | FetchError>;
|
|
383
|
+
|
|
384
|
+
export declare function getTelegramChatMenuButton(token: string, body: GetChatMenuButton): Promise<MenuButton | FetchError>;
|
|
385
|
+
|
|
386
|
+
export declare function getTelegramCommand(string: string | undefined): string | undefined;
|
|
387
|
+
|
|
388
|
+
export declare function getTelegramCommandByContext<T extends UpdateType>(context: Context_2[T]): string | undefined;
|
|
389
|
+
|
|
390
|
+
export declare function getTelegramContextChat<T extends UpdateType>(context: Context[T]): Chat | undefined;
|
|
391
|
+
|
|
392
|
+
export declare function getTelegramContextChatID<T extends UpdateType>(context: Context[T]): bigint | number | undefined;
|
|
393
|
+
|
|
394
|
+
export declare function getTelegramContextChatType<T extends UpdateType>(context: Context[T]): string | undefined;
|
|
395
|
+
|
|
396
|
+
export declare function getTelegramContextUser<T extends UpdateType>(context: Context[T]): User | undefined;
|
|
397
|
+
|
|
398
|
+
export declare function getTelegramContextUserFirstName<T extends UpdateType>(context: Context[T]): string | undefined;
|
|
399
|
+
|
|
400
|
+
export declare function getTelegramContextUserID<T extends UpdateType>(context: Context[T]): bigint | number | undefined;
|
|
401
|
+
|
|
402
|
+
export declare function getTelegramContextUserLastName<T extends UpdateType>(context: Context[T]): string | undefined;
|
|
403
|
+
|
|
404
|
+
export declare function getTelegramContextUserUsername<T extends UpdateType>(context: Context[T]): string | undefined;
|
|
405
|
+
|
|
406
|
+
export declare function getTelegramCustomEmojiStickers(token: string, body: GetCustomEmojiStickers): Promise<Sticker[] | FetchError>;
|
|
407
|
+
|
|
408
|
+
export declare function getTelegramFile(token: string, body: GetFile): Promise<File_2 | FetchError>;
|
|
409
|
+
|
|
410
|
+
export declare function getTelegramForumTopicIconStickers(token: string): Promise<Sticker[] | FetchError>;
|
|
411
|
+
|
|
412
|
+
export declare function getTelegramGameHighScores(token: string, body: GetGameHighScores): Promise<GameHighScore[] | FetchError>;
|
|
413
|
+
|
|
414
|
+
export declare function getTelegramInlineKeyboardCallbackButton<T>(text: string, data: T, options?: EncodeTelegramCallbackQueryBodyOptions): InlineKeyboardButton;
|
|
415
|
+
|
|
416
|
+
export declare function getTelegramInlineKeyboardGameButton(text: string, game: string): InlineKeyboardButton;
|
|
417
|
+
|
|
418
|
+
export declare function getTelegramInlineKeyboardLoginButton(text: string, url: string, fields?: Partial<LoginUrl>): InlineKeyboardButton;
|
|
419
|
+
|
|
420
|
+
export declare function getTelegramInlineKeyboardPayButton(text: string): InlineKeyboardButton;
|
|
421
|
+
|
|
422
|
+
export declare function getTelegramInlineKeyboardQueryButton(text: string, query: string): InlineKeyboardButton;
|
|
423
|
+
|
|
424
|
+
export declare function getTelegramInlineKeyboardQueryChosenChatButton(text: string, query: SwitchInlineQueryChosenChat): InlineKeyboardButton;
|
|
425
|
+
|
|
426
|
+
export declare function getTelegramInlineKeyboardQueryCurrentChatButton(text: string, query: string): InlineKeyboardButton;
|
|
427
|
+
|
|
428
|
+
export declare function getTelegramInlineKeyboardTextButton(text: string): InlineKeyboardButton;
|
|
429
|
+
|
|
430
|
+
export declare function getTelegramInlineKeyboardUrlButton(text: string, url: string): InlineKeyboardButton;
|
|
431
|
+
|
|
432
|
+
export declare function getTelegramInlineKeyboardWebAppButton(text: string, app: WebAppInfo): InlineKeyboardButton;
|
|
433
|
+
|
|
434
|
+
export declare function getTelegramMe(token: string): Promise<User | FetchError>;
|
|
435
|
+
|
|
436
|
+
export declare function getTelegramProgressHTML(value: number, min?: number, max?: number, size?: number): string;
|
|
437
|
+
|
|
438
|
+
export declare function getTelegramStarTransactions(token: string, body?: GetStarTransactions): Promise<StarTransactions | FetchError>;
|
|
439
|
+
|
|
440
|
+
export declare function getTelegramStickerSet(token: string, body: GetStickerSet): Promise<StickerSet | FetchError>;
|
|
441
|
+
|
|
442
|
+
export declare function getTelegramUpdates(token: string, body?: GetUpdates): Promise<Update[] | FetchError>;
|
|
443
|
+
|
|
444
|
+
export declare function getTelegramUserChatBoosts(token: string, body: GetUserChatBoosts): Promise<UserChatBoosts | FetchError>;
|
|
445
|
+
|
|
446
|
+
export declare function getTelegramUserProfilePhotos(token: string, body: GetUserProfilePhotos): Promise<UserProfilePhotos | FetchError>;
|
|
447
|
+
|
|
448
|
+
export declare function getTelegramWebhookInfo(token: string): Promise<WebhookInfo | FetchError>;
|
|
449
|
+
|
|
450
|
+
export declare function hideTelegramGeneralForumTopic(token: string, body: HideGeneralForumTopic): Promise<boolean | FetchError>;
|
|
451
|
+
|
|
282
452
|
export declare type InputFile = File | string;
|
|
283
453
|
|
|
284
|
-
declare interface InputMediaAlternative extends Omit<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo, 'media'> {
|
|
454
|
+
export declare interface InputMediaAlternative extends Omit<InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo, 'media'> {
|
|
285
455
|
media: InputFile;
|
|
286
456
|
}
|
|
287
457
|
|
|
288
|
-
declare
|
|
289
|
-
|
|
458
|
+
export declare interface InputPaidMediaAlternative extends Omit<InputMediaPhoto | InputMediaVideo, 'media'> {
|
|
459
|
+
media: InputFile;
|
|
290
460
|
}
|
|
291
461
|
|
|
292
|
-
export declare
|
|
293
|
-
chatID?: number;
|
|
294
|
-
data: T;
|
|
295
|
-
type: string;
|
|
296
|
-
}
|
|
462
|
+
export declare function leaveTelegramChat(token: string, body: LeaveChat): Promise<boolean | FetchError>;
|
|
297
463
|
|
|
298
|
-
declare
|
|
299
|
-
chatMessage(chatID: number, message: number, parameters?: Partial<PinChatMessage>): Promise<boolean | FetchError>;
|
|
300
|
-
}
|
|
464
|
+
export declare function logOutTelegram(token: string): Promise<boolean | FetchError>;
|
|
301
465
|
|
|
302
|
-
declare
|
|
303
|
-
active: boolean;
|
|
304
|
-
offset: number;
|
|
305
|
-
start(ms?: number, parameters?: Partial<GetUpdates>): void;
|
|
306
|
-
stop(): void;
|
|
307
|
-
private get;
|
|
308
|
-
}
|
|
466
|
+
export declare function omitTelegramCommand(string: string | undefined): string;
|
|
309
467
|
|
|
310
|
-
declare
|
|
311
|
-
chatMember(chatID: number, userID: number, parameters?: Partial<PromoteChatMember>): Promise<boolean | FetchError>;
|
|
312
|
-
}
|
|
468
|
+
export declare function pinTelegramChatMessage(token: string, body: PinChatMessage): Promise<boolean | FetchError>;
|
|
313
469
|
|
|
314
|
-
export declare
|
|
315
|
-
|
|
316
|
-
|
|
470
|
+
export declare function promoteTelegramChatMember(token: string, body: PromoteChatMember): Promise<boolean | FetchError>;
|
|
471
|
+
|
|
472
|
+
export declare function refundTelegramStarPayment(token: string, body: RefundStarPayment): Promise<boolean | FetchError>;
|
|
317
473
|
|
|
318
|
-
export declare
|
|
319
|
-
|
|
320
|
-
|
|
474
|
+
export declare const REGEXP_TELEGRAM_COMMAND: RegExp;
|
|
475
|
+
|
|
476
|
+
export declare const REGEXP_TELEGRAM_COMMAND_WITH_USERNAME: RegExp;
|
|
477
|
+
|
|
478
|
+
export declare function reopenTelegramForumTopic(token: string, body: ReopenForumTopic): Promise<boolean | FetchError>;
|
|
479
|
+
|
|
480
|
+
export declare function reopenTelegramGeneralForumTopic(token: string, body: ReopenGeneralForumTopic): Promise<boolean | FetchError>;
|
|
481
|
+
|
|
482
|
+
export declare function replaceTelegramStickerInSet(token: string, body: ReplaceStickerInSet): Promise<boolean | FetchError>;
|
|
483
|
+
|
|
484
|
+
export declare interface ReplyToMessage<T = unknown> extends Message {
|
|
485
|
+
body: ReplyToMessageBody<T>;
|
|
321
486
|
}
|
|
322
487
|
|
|
323
|
-
declare
|
|
324
|
-
|
|
488
|
+
export declare interface ReplyToMessageBody<T = unknown> {
|
|
489
|
+
c?: bigint | number;
|
|
490
|
+
d: T;
|
|
491
|
+
m?: string;
|
|
325
492
|
}
|
|
326
493
|
|
|
327
|
-
declare
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
dice(chatID: number, parameters?: Partial<SendDice>): Promise<Message | FetchError>;
|
|
336
|
-
game(chatID: number, gameShortName: string, parameters?: Partial<SendGame>): Promise<Message | FetchError>;
|
|
337
|
-
html(chatID: number, text: string, parameters?: Partial<SendMessage>): Promise<Message | FetchError>;
|
|
338
|
-
invoice(chatID: number, title: string, description: string, payload: string, providerToken: string, startParameter: string, currency: string, prices: LabeledPrice[], parameters?: Partial<SendInvoice>): Promise<Message | FetchError>;
|
|
339
|
-
location(chatID: number, latitude: number, longitude: number, parameters?: Partial<SendLocation>): Promise<Message | FetchError>;
|
|
340
|
-
mediaGroup(chatID: number, media: InputMediaAlternative[], parameters?: Partial<SendMediaGroup>): Promise<Message | FetchError>;
|
|
341
|
-
message(chatID: number, text: string, parameters?: Partial<SendMessage>): Promise<Message | FetchError>;
|
|
342
|
-
photo(chatID: number, file: InputFile, parameters?: Partial<SendPhoto>): Promise<Message | FetchError>;
|
|
343
|
-
poll(chatID: number, question: string, options: InputPollOption[], parameters?: Partial<SendPoll>): Promise<Message | FetchError>;
|
|
344
|
-
repliable<T>(chatID: number, text: string, data: T, type: string, parameters?: Partial<SendMessage>, fromChatID?: number): Promise<Message | FetchError>;
|
|
345
|
-
sticker(chatID: number, file: InputFile, parameters?: Partial<SendSticker>): Promise<Message | FetchError>;
|
|
346
|
-
venue(chatID: number, latitude: number, longitude: number, title: string, address: string, parameters?: Partial<SendVenue>): Promise<Message | FetchError>;
|
|
347
|
-
video(chatID: number, file: InputFile, parameters?: Partial<SendVideo>): Promise<Message | FetchError>;
|
|
348
|
-
videoNote(chatID: number, file: InputFile, parameters?: Partial<SendVideoNote>): Promise<Message | FetchError>;
|
|
349
|
-
voice(chatID: number, file: InputFile, parameters?: Partial<SendVoice>): Promise<Message | FetchError>;
|
|
350
|
-
private file;
|
|
494
|
+
export declare function restrictTelegramChatMember(token: string, body: RestrictChatMember): Promise<boolean | FetchError>;
|
|
495
|
+
|
|
496
|
+
export declare function revokeTelegramChatInviteLink(token: string, body: RevokeChatInviteLink): Promise<ChatInviteLink | FetchError>;
|
|
497
|
+
|
|
498
|
+
export declare function sanitizeTelegramHTML(text: string): string;
|
|
499
|
+
|
|
500
|
+
declare interface SendMediaGroupAlternative extends Omit<SendMediaGroup, 'media'> {
|
|
501
|
+
media: InputMediaAlternative[];
|
|
351
502
|
}
|
|
352
503
|
|
|
353
|
-
declare
|
|
354
|
-
|
|
355
|
-
repliable<T>(chatIDs: [number, number], text: string, data: T, type: string, parameters?: Partial<SendMessage>): Promise<Message | FetchError | Error>;
|
|
504
|
+
declare interface SendPaidMediaAlternative extends Omit<SendPaidMedia, 'media'> {
|
|
505
|
+
media: InputPaidMediaAlternative[];
|
|
356
506
|
}
|
|
357
507
|
|
|
358
|
-
declare
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
chatPhoto(chatID: number, photo: InputFile): Promise<boolean | FetchError>;
|
|
363
|
-
chatStickerSet(chatID: number, stickerSetName: string): Promise<boolean | FetchError>;
|
|
364
|
-
chatTitle(chatID: number, title: string): Promise<boolean | FetchError>;
|
|
365
|
-
commands(commands: BotCommand[], parameters?: Partial<SetMyCommands>): Promise<boolean | FetchError>;
|
|
366
|
-
gameScore(userID: number, score: number, parameters?: Partial<SetGameScore>): Promise<boolean | FetchError>;
|
|
367
|
-
passportDataErrors(userID: number, errors: PassportElementError[]): Promise<boolean | FetchError>;
|
|
368
|
-
stickerPositionInSet(sticker: string, position: number): Promise<boolean | FetchError>;
|
|
369
|
-
stickerSetThumb(name: string, userID: number, format: string, parameters?: Partial<SetStickerSetThumbnail>): Promise<boolean | FetchError>;
|
|
508
|
+
export declare interface SendRepliableMessage<T = unknown> extends SendMessage {
|
|
509
|
+
command?: string;
|
|
510
|
+
data: T;
|
|
511
|
+
from_chat_id?: bigint;
|
|
370
512
|
}
|
|
371
513
|
|
|
372
|
-
export declare
|
|
373
|
-
|
|
514
|
+
export declare function sendTelegramAnimation(token: string, body: SendAnimation): Promise<Message | FetchError>;
|
|
515
|
+
|
|
516
|
+
export declare function sendTelegramAudio(token: string, body: SendAudio): Promise<Message | FetchError>;
|
|
517
|
+
|
|
518
|
+
export declare function sendTelegramChatAction(token: string, body: SendChatAction): Promise<boolean | FetchError>;
|
|
519
|
+
|
|
520
|
+
export declare function sendTelegramContact(token: string, body: SendContact): Promise<Message | FetchError>;
|
|
521
|
+
|
|
522
|
+
export declare function sendTelegramDice(token: string, body: SendDice): Promise<Message | FetchError>;
|
|
523
|
+
|
|
524
|
+
export declare function sendTelegramDocument(token: string, body: SendDocument): Promise<Message | FetchError>;
|
|
525
|
+
|
|
526
|
+
export declare function sendTelegramGame(token: string, body: SendGame): Promise<Message | FetchError>;
|
|
527
|
+
|
|
528
|
+
export declare function sendTelegramInvoice(token: string, body: SendInvoice): Promise<Message | FetchError>;
|
|
529
|
+
|
|
530
|
+
export declare function sendTelegramLocation(token: string, body: SendLocation): Promise<Message | FetchError>;
|
|
531
|
+
|
|
532
|
+
export declare function sendTelegramMediaGroup(token: string, body: SendMediaGroupAlternative): Promise<Message[] | FetchError>;
|
|
533
|
+
|
|
534
|
+
export declare function sendTelegramMessage(token: string, body: SendMessage): Promise<Message | FetchError>;
|
|
535
|
+
|
|
536
|
+
export declare function sendTelegramMessageHTML(token: string, body: SendMessage): Promise<Message | FetchError>;
|
|
537
|
+
|
|
538
|
+
export declare function sendTelegramPaidMedia(token: string, body: SendPaidMediaAlternative): Promise<Message | FetchError>;
|
|
539
|
+
|
|
540
|
+
export declare function sendTelegramPhoto(token: string, body: SendPhoto): Promise<Message | FetchError>;
|
|
541
|
+
|
|
542
|
+
export declare function sendTelegramPoll(token: string, body: SendPoll): Promise<Message | FetchError>;
|
|
543
|
+
|
|
544
|
+
export declare function sendTelegramRepliableMessage<T>(token: string, body: SendRepliableMessage<T>): Promise<Message | FetchError>;
|
|
545
|
+
|
|
546
|
+
export declare function sendTelegramSticker(token: string, body: SendSticker): Promise<Message | FetchError>;
|
|
547
|
+
|
|
548
|
+
export declare function sendTelegramVenue(token: string, body: SendVenue): Promise<Message | FetchError>;
|
|
549
|
+
|
|
550
|
+
export declare function sendTelegramVideo(token: string, body: SendVideo): Promise<Message | FetchError>;
|
|
551
|
+
|
|
552
|
+
export declare function sendTelegramVideoNote(token: string, body: SendVideoNote): Promise<Message | FetchError>;
|
|
553
|
+
|
|
554
|
+
export declare function sendTelegramVoice(token: string, body: SendVoice): Promise<Message | FetchError>;
|
|
555
|
+
|
|
556
|
+
export declare function setMyTelegramCommands(token: string, body: SetMyCommands): Promise<boolean | FetchError>;
|
|
557
|
+
|
|
558
|
+
export declare function setMyTelegramDefaultAdministratorRights(token: string, body: SetMyDefaultAdministratorRights): Promise<boolean | FetchError>;
|
|
559
|
+
|
|
560
|
+
export declare function setMyTelegramDescription(token: string, body: SetMyDescription): Promise<boolean | FetchError>;
|
|
561
|
+
|
|
562
|
+
export declare function setMyTelegramName(token: string, body: SetMyName): Promise<boolean | FetchError>;
|
|
563
|
+
|
|
564
|
+
export declare function setMyTelegramShortDescription(token: string, body: SetMyShortDescription): Promise<boolean | FetchError>;
|
|
565
|
+
|
|
566
|
+
export declare function setTelegramChatAdministratorCustomTitle(token: string, body: SetChatAdministratorCustomTitle): Promise<boolean | FetchError>;
|
|
567
|
+
|
|
568
|
+
export declare function setTelegramChatDescription(token: string, body: SetChatDescription): Promise<boolean | FetchError>;
|
|
569
|
+
|
|
570
|
+
export declare function setTelegramChatMenuButton(token: string, body: SetChatMenuButton): Promise<boolean | FetchError>;
|
|
571
|
+
|
|
572
|
+
export declare function setTelegramChatPermissions(token: string, body: SetChatPermissions): Promise<boolean | FetchError>;
|
|
573
|
+
|
|
574
|
+
export declare function setTelegramChatPhoto(token: string, body: SetChatPhoto): Promise<boolean | FetchError>;
|
|
575
|
+
|
|
576
|
+
export declare function setTelegramChatStickerSet(token: string, body: SetChatStickerSet): Promise<boolean | FetchError>;
|
|
577
|
+
|
|
578
|
+
export declare function setTelegramChatTitle(token: string, body: SetChatTitle): Promise<boolean | FetchError>;
|
|
579
|
+
|
|
580
|
+
export declare function setTelegramCustomEmojiStickerSetThumbnail(token: string, body: SetCustomEmojiStickerSetThumbnail): Promise<boolean | FetchError>;
|
|
581
|
+
|
|
582
|
+
export declare function setTelegramGameScore(token: string, body: SetGameScore): Promise<boolean | FetchError>;
|
|
583
|
+
|
|
584
|
+
export declare function setTelegramMessageReaction(token: string, body: SetMessageReaction): Promise<boolean | FetchError>;
|
|
585
|
+
|
|
586
|
+
export declare function setTelegramPassportDataErrors(token: string, body: SetPassportDataErrors): Promise<boolean | FetchError>;
|
|
587
|
+
|
|
588
|
+
export declare function setTelegramStickerEmojiList(token: string, body: SetStickerEmojiList): Promise<boolean | FetchError>;
|
|
589
|
+
|
|
590
|
+
export declare function setTelegramStickerKeywords(token: string, body: SetStickerKeywords): Promise<boolean | FetchError>;
|
|
591
|
+
|
|
592
|
+
export declare function setTelegramStickerMaskPosition(token: string, body: SetStickerMaskPosition): Promise<boolean | FetchError>;
|
|
593
|
+
|
|
594
|
+
export declare function setTelegramStickerPositionInSet(token: string, body: SetStickerPositionInSet): Promise<boolean | FetchError>;
|
|
595
|
+
|
|
596
|
+
export declare function setTelegramStickerSetThumbnail(token: string, body: SetStickerSetThumbnail): Promise<boolean | FetchError>;
|
|
597
|
+
|
|
598
|
+
export declare function setTelegramStickerSetTitle(token: string, body: SetStickerSetTitle): Promise<boolean | FetchError>;
|
|
599
|
+
|
|
600
|
+
export declare function setTelegramWebhook(token: string, body: SetWebhook): Promise<boolean | FetchError>;
|
|
601
|
+
|
|
602
|
+
export declare interface Start<T = unknown> extends Message {
|
|
603
|
+
body: StartBody<T>;
|
|
374
604
|
}
|
|
375
605
|
|
|
376
|
-
export declare
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
static encodeBodyToAnchorTag<T>(username: string, data: T, type: string, children: string, chatID?: number): string;
|
|
606
|
+
export declare interface StartBody<T = unknown> {
|
|
607
|
+
c?: bigint | number;
|
|
608
|
+
d: T;
|
|
609
|
+
m?: string;
|
|
381
610
|
}
|
|
382
611
|
|
|
383
|
-
declare
|
|
384
|
-
|
|
385
|
-
|
|
612
|
+
export declare function stopTelegramMessageLiveLocation(token: string, body: StopMessageLiveLocation): Promise<Message | boolean | FetchError>;
|
|
613
|
+
|
|
614
|
+
export declare function stopTelegramPoll(token: string, body: StopPoll): Promise<Poll | FetchError>;
|
|
615
|
+
|
|
616
|
+
export declare const TelegramAPI: API;
|
|
617
|
+
|
|
618
|
+
export declare namespace TelegramApiDefinitions {
|
|
619
|
+
export interface Config extends RestApiConfig {
|
|
620
|
+
token: string | undefined;
|
|
621
|
+
}
|
|
622
|
+
export interface Response<T> extends FetchResponse<ResponseData<T>> {
|
|
623
|
+
}
|
|
624
|
+
export interface ResponseData<T> {
|
|
625
|
+
ok: boolean;
|
|
626
|
+
result: T;
|
|
627
|
+
}
|
|
386
628
|
}
|
|
387
629
|
|
|
388
|
-
export declare
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
builder: Builder;
|
|
400
|
-
/** CHILDS */
|
|
401
|
-
add: Add;
|
|
402
|
-
answer: Answer;
|
|
403
|
-
create: Create;
|
|
404
|
-
delete: Delete;
|
|
405
|
-
download: Download;
|
|
406
|
-
edit: Edit;
|
|
407
|
-
export: Export;
|
|
408
|
-
forward: Forward;
|
|
409
|
-
get: Get;
|
|
410
|
-
ban: Ban;
|
|
411
|
-
leave: Leave;
|
|
412
|
-
pin: Pin;
|
|
413
|
-
polling: Polling;
|
|
414
|
-
promote: Promote;
|
|
415
|
-
restrict: Restrict;
|
|
416
|
-
send: Send;
|
|
417
|
-
set: Set_2;
|
|
418
|
-
stop: Stop;
|
|
419
|
-
unban: Unban;
|
|
420
|
-
unpin: Unpin;
|
|
421
|
-
upload: Upload;
|
|
422
|
-
webhook: Webhook;
|
|
423
|
-
constructor(token: string, hostname?: string, port?: number);
|
|
424
|
-
on<T extends UpdateType, U extends HandlerOptions>(type: T, middleware: HandlerMiddleware<T>, key?: string, description?: string, options?: U): void;
|
|
630
|
+
export declare const TelegramClassLogger: Logger;
|
|
631
|
+
|
|
632
|
+
export declare class TelegramClient {
|
|
633
|
+
protected listeners: TelegramClientListener[];
|
|
634
|
+
protected readonly id: string;
|
|
635
|
+
protected offset?: number;
|
|
636
|
+
protected token: string;
|
|
637
|
+
constructor(token: string);
|
|
638
|
+
connect(mode: TelegramClientConnectionMode, options?: TelegramClientConnectionOptions): Promise<void | FetchError | Error>;
|
|
639
|
+
disconnect(options?: TelegramClientDisconnectOptions): Promise<void>;
|
|
640
|
+
on<T extends UpdateType, U extends TelegramClientListenerOptions>(type: T, middleware: TelegramClientListenerMiddleware<T>, options?: U): void;
|
|
425
641
|
handle(update: Update): void;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
642
|
+
protected handleBusinessConnection(connection: BusinessConnection): TelegramClientListener | undefined;
|
|
643
|
+
protected handleBusinessMessage(message: Message): TelegramClientListener | undefined;
|
|
644
|
+
protected handleCallbackQuery(query: CallbackQuery_2): TelegramClientListener | undefined;
|
|
645
|
+
protected handleChannelPost(post: Message): TelegramClientListener | undefined;
|
|
646
|
+
protected handleChatBoost(boost: ChatBoostUpdated): TelegramClientListener | undefined;
|
|
647
|
+
protected handleChatJoinRequest(request: ChatJoinRequest): TelegramClientListener | undefined;
|
|
648
|
+
protected handleChatMember(member: ChatMemberUpdated): TelegramClientListener | undefined;
|
|
649
|
+
protected handleChosenInlineResult(result: ChosenInlineResult): TelegramClientListener | undefined;
|
|
650
|
+
protected handleDeletedBusinessMessages(deleted: BusinessMessagesDeleted): TelegramClientListener | undefined;
|
|
651
|
+
protected handleEditedBusinessMessage(message: Message): TelegramClientListener | undefined;
|
|
652
|
+
protected handleEditedChannelPost(post: Message): TelegramClientListener | undefined;
|
|
653
|
+
protected handleEditedMessage(message: Message): TelegramClientListener | undefined;
|
|
654
|
+
protected handleInlineQuery(query: InlineQuery): TelegramClientListener | undefined;
|
|
655
|
+
protected handleMessage(message: Message): TelegramClientListener | undefined;
|
|
656
|
+
protected handleMessageReaction(reaction: MessageReactionUpdated): TelegramClientListener | undefined;
|
|
657
|
+
protected handleMessageReactionCount(count: MessageReactionCountUpdated): TelegramClientListener | undefined;
|
|
658
|
+
protected handleMyChatMember(member: ChatMemberUpdated): TelegramClientListener | undefined;
|
|
659
|
+
protected handlePoll(poll: Poll): TelegramClientListener | undefined;
|
|
660
|
+
protected handlePollAnswer(answer: PollAnswer): TelegramClientListener | undefined;
|
|
661
|
+
protected handlePreCheckoutQuery(query: PreCheckoutQuery): TelegramClientListener | undefined;
|
|
662
|
+
protected handleRemovedChatBoost(removed: ChatBoostRemoved): TelegramClientListener | undefined;
|
|
663
|
+
protected handleReplyToMessage(reply: Message): TelegramClientListener | undefined;
|
|
664
|
+
protected handleShippingQuery(query: ShippingQuery): TelegramClientListener | undefined;
|
|
665
|
+
protected handleStart(start: Message): TelegramClientListener | undefined;
|
|
666
|
+
protected poll(options?: TelegramClientConnectionOptionsPolling): Promise<void>;
|
|
667
|
+
protected findListener<T extends UpdateType, U extends TelegramClientListenerOptions>(type: UpdateType, command?: string): TelegramClientListener<T, U> | undefined;
|
|
668
|
+
getCommands(): BotCommand[];
|
|
669
|
+
getListeners(): TelegramClientListener[];
|
|
670
|
+
getToken(): string;
|
|
671
|
+
setToken(token: string): this;
|
|
672
|
+
protected get listenerIDs(): string[];
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export declare type TelegramClientConnectionMode = 'polling' | 'webhook';
|
|
676
|
+
|
|
677
|
+
export declare interface TelegramClientConnectionOptions {
|
|
678
|
+
polling?: TelegramClientConnectionOptionsPolling;
|
|
679
|
+
webhook?: TelegramClientConnectionOptionsWebhook;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export declare interface TelegramClientConnectionOptionsPolling extends GetUpdates {
|
|
683
|
+
ms?: number;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
export declare interface TelegramClientConnectionOptionsWebhook extends SetWebhook {
|
|
687
|
+
delete?: DeleteWebhook;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export declare interface TelegramClientDisconnectOptions {
|
|
691
|
+
webhook?: DeleteWebhook;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export declare interface TelegramClientListener<T extends UpdateType = any, U extends TelegramClientListenerOptions = TelegramClientListenerOptions> {
|
|
695
|
+
command?: string;
|
|
696
|
+
description?: string;
|
|
697
|
+
id: string;
|
|
698
|
+
middleware: TelegramClientListenerMiddleware<T>;
|
|
699
|
+
options: Omit<U, 'command' | 'description'>;
|
|
700
|
+
type: UpdateType;
|
|
446
701
|
}
|
|
447
702
|
|
|
448
|
-
export declare
|
|
703
|
+
export declare type TelegramClientListenerMiddleware<T extends UpdateType> = (context: Context[T]) => any;
|
|
449
704
|
|
|
450
|
-
export declare
|
|
451
|
-
|
|
705
|
+
export declare interface TelegramClientListenerOptions {
|
|
706
|
+
command?: string;
|
|
707
|
+
deleteOnCallbackQuery?: boolean;
|
|
708
|
+
deleteOnReply?: boolean;
|
|
709
|
+
deleteOnMessageStart?: boolean;
|
|
710
|
+
description?: string;
|
|
452
711
|
}
|
|
453
712
|
|
|
454
|
-
declare
|
|
455
|
-
first: string;
|
|
456
|
-
last: string;
|
|
457
|
-
}
|
|
713
|
+
export declare const TelegramFileAPI: API_2;
|
|
458
714
|
|
|
459
|
-
declare
|
|
460
|
-
|
|
715
|
+
export declare enum TelegramLoggerName {
|
|
716
|
+
CLASS = "TELEGRAM_CLASS"
|
|
461
717
|
}
|
|
462
718
|
|
|
463
|
-
declare
|
|
464
|
-
chatMessage(chatID: number): Promise<boolean | FetchError>;
|
|
465
|
-
}
|
|
719
|
+
export declare function unbanTelegramChatMember(token: string, body: UnbanChatMember): Promise<boolean | FetchError>;
|
|
466
720
|
|
|
467
|
-
export declare
|
|
468
|
-
CALLBACK_QUERY = "CALLBACK_QUERY",
|
|
469
|
-
CHANNEL_POST = "CHANNEL_POST",
|
|
470
|
-
CHAT_JOIN_REQUEST = "CHAT_JOIN_REQUEST",
|
|
471
|
-
CHAT_MEMBER = "CHAT_MEMBER",
|
|
472
|
-
CHOSEN_INLINE_RESULT = "CHOSEN_INLINE_RESULT",
|
|
473
|
-
DOCUMENT = "DOCUMENT",
|
|
474
|
-
EDITED_CHANNEL_POST = "EDITED_CHANNEL_POST",
|
|
475
|
-
EDITED_MESSAGE = "EDITED_MESSAGE",
|
|
476
|
-
INLINE_QUERY = "INLINE_QUERY",
|
|
477
|
-
MESSAGE = "MESSAGE",
|
|
478
|
-
MY_CHAT_MEMBER = "MY_CHAT_MEMBER",
|
|
479
|
-
POLL = "POLL",
|
|
480
|
-
POLL_ANSWER = "POLL_ANSWER",
|
|
481
|
-
PRE_CHECKOUT_QUERY = "PRE_CHECKOUT_QUERY",
|
|
482
|
-
REPLY_TO_MESSAGE = "REPLY_TO_MESSAGE",
|
|
483
|
-
SHIPPING_QUERY = "SHIPPING_QUERY",
|
|
484
|
-
START = "START"
|
|
485
|
-
}
|
|
721
|
+
export declare function unbanTelegramChatSenderChat(token: string, body: UnbanChatSenderChat): Promise<boolean | FetchError>;
|
|
486
722
|
|
|
487
|
-
declare
|
|
488
|
-
stickerFile(userID: number, format: string, sticker: InputFile): Promise<File_2 | FetchError>;
|
|
489
|
-
}
|
|
723
|
+
export declare function unhideTelegramGeneralForumTopic(token: string, body: HideGeneralForumTopic): Promise<boolean | FetchError>;
|
|
490
724
|
|
|
491
|
-
declare
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
725
|
+
export declare function unpinAllTelegramChatMessages(token: string, body: UnpinAllChatMessages): Promise<boolean | FetchError>;
|
|
726
|
+
|
|
727
|
+
export declare function unpinAllTelegramForumTopicMessages(token: string, body: UnpinAllForumTopicMessages): Promise<boolean | FetchError>;
|
|
728
|
+
|
|
729
|
+
export declare function unpinAllTelegramGeneralForumTopicMessages(token: string, body: UnpinAllGeneralForumTopicMessages): Promise<boolean | FetchError>;
|
|
730
|
+
|
|
731
|
+
export declare function unpinTelegramChatMessage(token: string, body: UnpinChatMessage): Promise<boolean | FetchError>;
|
|
732
|
+
|
|
733
|
+
export declare type UpdateType = 'business_connection' | 'business_message' | 'callback_query' | 'channel_post' | 'chat_boost' | 'chat_join_request' | 'chat_member' | 'chosen_inline_result' | 'deleted_business_messages' | 'edited_business_message' | 'edited_channel_post' | 'edited_message' | 'inline_query' | 'message' | 'message_reaction' | 'message_reaction_count' | 'my_chat_member' | 'poll' | 'poll_answer' | 'pre_checkout_query' | 'removed_chat_boost' | 'reply_to_message' | 'shipping_query' | 'start';
|
|
734
|
+
|
|
735
|
+
export declare function uploadTelegramStickerFile(token: string, body: UploadStickerFile): Promise<File_2 | FetchError>;
|
|
496
736
|
|
|
497
737
|
export { }
|