@emulon/telegram 0.2.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/LICENSE +21 -0
- package/README.md +212 -0
- package/esm/auth/tokens.d.ts +18 -0
- package/esm/auth/tokens.js +42 -0
- package/esm/commands/mod.d.ts +15 -0
- package/esm/commands/mod.js +52 -0
- package/esm/compatibility.d.ts +2 -0
- package/esm/compatibility.js +236 -0
- package/esm/format/markdown_v2.d.ts +35 -0
- package/esm/format/markdown_v2.js +266 -0
- package/esm/mod.d.ts +9 -0
- package/esm/mod.js +28 -0
- package/esm/model/bots.d.ts +53 -0
- package/esm/model/bots.js +84 -0
- package/esm/model/channels.d.ts +25 -0
- package/esm/model/channels.js +45 -0
- package/esm/model/messages.d.ts +108 -0
- package/esm/model/messages.js +269 -0
- package/esm/model/reactions.d.ts +33 -0
- package/esm/model/reactions.js +129 -0
- package/esm/model/updates.d.ts +105 -0
- package/esm/model/updates.js +354 -0
- package/esm/package.json +3 -0
- package/esm/routes/api.d.ts +31 -0
- package/esm/routes/api.js +128 -0
- package/esm/routes/methods.d.ts +10 -0
- package/esm/routes/methods.js +195 -0
- package/package.json +277 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every Bot API method typed by `@grammyjs/types@3.28.0`, the types package of
|
|
3
|
+
* the pinned `grammy@1.44.0`. A test keeps this list equal to those types.
|
|
4
|
+
* Known methods the slice does not implement fail with an explicit 501 instead
|
|
5
|
+
* of the 404 that an unknown method receives.
|
|
6
|
+
*/
|
|
7
|
+
export const knownMethods = [
|
|
8
|
+
'getUpdates',
|
|
9
|
+
'setWebhook',
|
|
10
|
+
'deleteWebhook',
|
|
11
|
+
'getWebhookInfo',
|
|
12
|
+
'getMe',
|
|
13
|
+
'logOut',
|
|
14
|
+
'close',
|
|
15
|
+
'sendMessage',
|
|
16
|
+
'sendRichMessage',
|
|
17
|
+
'forwardMessage',
|
|
18
|
+
'forwardMessages',
|
|
19
|
+
'copyMessage',
|
|
20
|
+
'copyMessages',
|
|
21
|
+
'sendPhoto',
|
|
22
|
+
'sendLivePhoto',
|
|
23
|
+
'sendAudio',
|
|
24
|
+
'sendDocument',
|
|
25
|
+
'sendVideo',
|
|
26
|
+
'sendAnimation',
|
|
27
|
+
'sendVoice',
|
|
28
|
+
'sendVideoNote',
|
|
29
|
+
'sendPaidMedia',
|
|
30
|
+
'sendMediaGroup',
|
|
31
|
+
'sendLocation',
|
|
32
|
+
'editMessageLiveLocation',
|
|
33
|
+
'stopMessageLiveLocation',
|
|
34
|
+
'sendVenue',
|
|
35
|
+
'sendContact',
|
|
36
|
+
'sendPoll',
|
|
37
|
+
'sendChecklist',
|
|
38
|
+
'editMessageChecklist',
|
|
39
|
+
'sendDice',
|
|
40
|
+
'sendMessageDraft',
|
|
41
|
+
'sendRichMessageDraft',
|
|
42
|
+
'sendChatAction',
|
|
43
|
+
'setMessageReaction',
|
|
44
|
+
'getUserProfilePhotos',
|
|
45
|
+
'getUserProfileAudios',
|
|
46
|
+
'setUserEmojiStatus',
|
|
47
|
+
'getFile',
|
|
48
|
+
'banChatMember',
|
|
49
|
+
'kickChatMember',
|
|
50
|
+
'unbanChatMember',
|
|
51
|
+
'restrictChatMember',
|
|
52
|
+
'promoteChatMember',
|
|
53
|
+
'setChatAdministratorCustomTitle',
|
|
54
|
+
'setChatMemberTag',
|
|
55
|
+
'banChatSenderChat',
|
|
56
|
+
'unbanChatSenderChat',
|
|
57
|
+
'setChatPermissions',
|
|
58
|
+
'exportChatInviteLink',
|
|
59
|
+
'createChatInviteLink',
|
|
60
|
+
'editChatInviteLink',
|
|
61
|
+
'createChatSubscriptionInviteLink',
|
|
62
|
+
'editChatSubscriptionInviteLink',
|
|
63
|
+
'revokeChatInviteLink',
|
|
64
|
+
'approveChatJoinRequest',
|
|
65
|
+
'declineChatJoinRequest',
|
|
66
|
+
'answerChatJoinRequestQuery',
|
|
67
|
+
'sendChatJoinRequestWebApp',
|
|
68
|
+
'approveSuggestedPost',
|
|
69
|
+
'declineSuggestedPost',
|
|
70
|
+
'setChatPhoto',
|
|
71
|
+
'deleteChatPhoto',
|
|
72
|
+
'setChatTitle',
|
|
73
|
+
'setChatDescription',
|
|
74
|
+
'pinChatMessage',
|
|
75
|
+
'unpinChatMessage',
|
|
76
|
+
'unpinAllChatMessages',
|
|
77
|
+
'leaveChat',
|
|
78
|
+
'getChat',
|
|
79
|
+
'getChatAdministrators',
|
|
80
|
+
'getChatMemberCount',
|
|
81
|
+
'getChatMembersCount',
|
|
82
|
+
'getChatMember',
|
|
83
|
+
'getUserPersonalChatMessages',
|
|
84
|
+
'setChatStickerSet',
|
|
85
|
+
'deleteChatStickerSet',
|
|
86
|
+
'getForumTopicIconStickers',
|
|
87
|
+
'createForumTopic',
|
|
88
|
+
'editForumTopic',
|
|
89
|
+
'closeForumTopic',
|
|
90
|
+
'reopenForumTopic',
|
|
91
|
+
'deleteForumTopic',
|
|
92
|
+
'unpinAllForumTopicMessages',
|
|
93
|
+
'editGeneralForumTopic',
|
|
94
|
+
'closeGeneralForumTopic',
|
|
95
|
+
'reopenGeneralForumTopic',
|
|
96
|
+
'hideGeneralForumTopic',
|
|
97
|
+
'unhideGeneralForumTopic',
|
|
98
|
+
'unpinAllGeneralForumTopicMessages',
|
|
99
|
+
'answerCallbackQuery',
|
|
100
|
+
'answerGuestQuery',
|
|
101
|
+
'getUserChatBoosts',
|
|
102
|
+
'getUserGifts',
|
|
103
|
+
'getChatGifts',
|
|
104
|
+
'getBusinessConnection',
|
|
105
|
+
'getManagedBotToken',
|
|
106
|
+
'replaceManagedBotToken',
|
|
107
|
+
'getManagedBotAccessSettings',
|
|
108
|
+
'setManagedBotAccessSettings',
|
|
109
|
+
'setMyCommands',
|
|
110
|
+
'deleteMyCommands',
|
|
111
|
+
'getMyCommands',
|
|
112
|
+
'setMyName',
|
|
113
|
+
'getMyName',
|
|
114
|
+
'setMyDescription',
|
|
115
|
+
'getMyDescription',
|
|
116
|
+
'setMyShortDescription',
|
|
117
|
+
'getMyShortDescription',
|
|
118
|
+
'setMyProfilePhoto',
|
|
119
|
+
'removeMyProfilePhoto',
|
|
120
|
+
'setChatMenuButton',
|
|
121
|
+
'getChatMenuButton',
|
|
122
|
+
'setMyDefaultAdministratorRights',
|
|
123
|
+
'getMyDefaultAdministratorRights',
|
|
124
|
+
'getMyStarBalance',
|
|
125
|
+
'editMessageText',
|
|
126
|
+
'editMessageCaption',
|
|
127
|
+
'editMessageMedia',
|
|
128
|
+
'editMessageReplyMarkup',
|
|
129
|
+
'stopPoll',
|
|
130
|
+
'deleteMessage',
|
|
131
|
+
'deleteMessages',
|
|
132
|
+
'deleteMessageReaction',
|
|
133
|
+
'deleteAllMessageReactions',
|
|
134
|
+
'deleteBusinessMessages',
|
|
135
|
+
'setBusinessAccountName',
|
|
136
|
+
'setBusinessAccountUsername',
|
|
137
|
+
'setBusinessAccountBio',
|
|
138
|
+
'setBusinessAccountProfilePhoto',
|
|
139
|
+
'removeBusinessAccountProfilePhoto',
|
|
140
|
+
'setBusinessAccountGiftSettings',
|
|
141
|
+
'getBusinessAccountStarBalance',
|
|
142
|
+
'transferBusinessAccountStars',
|
|
143
|
+
'getBusinessAccountGifts',
|
|
144
|
+
'convertGiftToStars',
|
|
145
|
+
'upgradeGift',
|
|
146
|
+
'transferGift',
|
|
147
|
+
'postStory',
|
|
148
|
+
'repostStory',
|
|
149
|
+
'editStory',
|
|
150
|
+
'deleteStory',
|
|
151
|
+
'sendSticker',
|
|
152
|
+
'getStickerSet',
|
|
153
|
+
'getCustomEmojiStickers',
|
|
154
|
+
'uploadStickerFile',
|
|
155
|
+
'createNewStickerSet',
|
|
156
|
+
'addStickerToSet',
|
|
157
|
+
'setStickerPositionInSet',
|
|
158
|
+
'deleteStickerFromSet',
|
|
159
|
+
'replaceStickerInSet',
|
|
160
|
+
'setStickerEmojiList',
|
|
161
|
+
'setStickerKeywords',
|
|
162
|
+
'setStickerMaskPosition',
|
|
163
|
+
'setStickerSetTitle',
|
|
164
|
+
'deleteStickerSet',
|
|
165
|
+
'setStickerSetThumbnail',
|
|
166
|
+
'setCustomEmojiStickerSetThumbnail',
|
|
167
|
+
'getAvailableGifts',
|
|
168
|
+
'sendGift',
|
|
169
|
+
'giftPremiumSubscription',
|
|
170
|
+
'answerInlineQuery',
|
|
171
|
+
'answerWebAppQuery',
|
|
172
|
+
'savePreparedInlineMessage',
|
|
173
|
+
'savePreparedKeyboardButton',
|
|
174
|
+
'sendInvoice',
|
|
175
|
+
'createInvoiceLink',
|
|
176
|
+
'answerShippingQuery',
|
|
177
|
+
'answerPreCheckoutQuery',
|
|
178
|
+
'getStarTransactions',
|
|
179
|
+
'refundStarPayment',
|
|
180
|
+
'editUserStarSubscription',
|
|
181
|
+
'verifyUser',
|
|
182
|
+
'verifyChat',
|
|
183
|
+
'removeUserVerification',
|
|
184
|
+
'removeChatVerification',
|
|
185
|
+
'readBusinessMessage',
|
|
186
|
+
'setPassportDataErrors',
|
|
187
|
+
'sendGame',
|
|
188
|
+
'setGameScore',
|
|
189
|
+
'getGameHighScores',
|
|
190
|
+
];
|
|
191
|
+
const byLowerCase = new Map(knownMethods.map((name) => [name.toLowerCase(), name]));
|
|
192
|
+
/** Bot API method names are case-insensitive. */
|
|
193
|
+
export function knownMethod(name) {
|
|
194
|
+
return byLowerCase.get(name.toLowerCase());
|
|
195
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@emulon/telegram",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"homepage": "https://github.com/IKatsuba/emulon#readme",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/IKatsuba/emulon.git",
|
|
8
|
+
"directory": "packages/telegram"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bugs": "https://github.com/IKatsuba/emulon/issues",
|
|
12
|
+
"module": "./esm/mod.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./esm/mod.d.ts",
|
|
16
|
+
"import": "./esm/mod.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22.13.0"
|
|
21
|
+
},
|
|
22
|
+
"emulon": {
|
|
23
|
+
"apiVersion": 1,
|
|
24
|
+
"capabilities": [
|
|
25
|
+
"http",
|
|
26
|
+
"authorization",
|
|
27
|
+
"reset"
|
|
28
|
+
],
|
|
29
|
+
"compatibility": {
|
|
30
|
+
"schemaVersion": 1,
|
|
31
|
+
"plugin": "@emulon/telegram",
|
|
32
|
+
"provider": {
|
|
33
|
+
"name": "Telegram",
|
|
34
|
+
"api": "Telegram Bot API"
|
|
35
|
+
},
|
|
36
|
+
"operations": [
|
|
37
|
+
{
|
|
38
|
+
"id": "getMe",
|
|
39
|
+
"method": "POST",
|
|
40
|
+
"path": "/bot:token/getMe",
|
|
41
|
+
"surface": "api",
|
|
42
|
+
"version": "bot-api",
|
|
43
|
+
"auth": [
|
|
44
|
+
"local-bot-token-path"
|
|
45
|
+
],
|
|
46
|
+
"input": [],
|
|
47
|
+
"output": "ok, result: id, is_bot, first_name, username, can_join_groups, can_read_all_group_messages, supports_inline_queries, can_connect_to_business, has_main_web_app, has_topics_enabled, allows_users_to_create_topics, can_manage_bots, supports_join_request_queries",
|
|
48
|
+
"events": [],
|
|
49
|
+
"cases": [
|
|
50
|
+
"telegram.bots.1",
|
|
51
|
+
"telegram.bots.2",
|
|
52
|
+
"telegram.bots.3",
|
|
53
|
+
"telegram.consumer.1"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "sendMessage",
|
|
58
|
+
"method": "POST",
|
|
59
|
+
"path": "/bot:token/sendMessage",
|
|
60
|
+
"surface": "api",
|
|
61
|
+
"version": "bot-api",
|
|
62
|
+
"auth": [
|
|
63
|
+
"local-bot-token-path"
|
|
64
|
+
],
|
|
65
|
+
"input": [
|
|
66
|
+
"chat_id",
|
|
67
|
+
"text",
|
|
68
|
+
"parse_mode",
|
|
69
|
+
"disable_notification",
|
|
70
|
+
"link_preview_options"
|
|
71
|
+
],
|
|
72
|
+
"output": "ok, result: message_id, from, sender_chat, chat, date, text, entities",
|
|
73
|
+
"events": [],
|
|
74
|
+
"cases": [
|
|
75
|
+
"telegram.messages.1",
|
|
76
|
+
"telegram.messages.2",
|
|
77
|
+
"telegram.messages.3",
|
|
78
|
+
"telegram.consumer.1"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "getUpdates",
|
|
83
|
+
"method": "POST",
|
|
84
|
+
"path": "/bot:token/getUpdates",
|
|
85
|
+
"surface": "api",
|
|
86
|
+
"version": "bot-api",
|
|
87
|
+
"auth": [
|
|
88
|
+
"local-bot-token-path"
|
|
89
|
+
],
|
|
90
|
+
"input": [
|
|
91
|
+
"offset",
|
|
92
|
+
"limit",
|
|
93
|
+
"timeout",
|
|
94
|
+
"allowed_updates"
|
|
95
|
+
],
|
|
96
|
+
"output": "ok, result: update_id, message_reaction_count: chat, message_id, date, reactions",
|
|
97
|
+
"events": [],
|
|
98
|
+
"cases": [
|
|
99
|
+
"telegram.updates.1",
|
|
100
|
+
"telegram.updates.2",
|
|
101
|
+
"telegram.updates.3",
|
|
102
|
+
"telegram.consumer.1"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"versions": [
|
|
107
|
+
{
|
|
108
|
+
"id": "bot-api",
|
|
109
|
+
"accepted": [
|
|
110
|
+
"bot-api"
|
|
111
|
+
],
|
|
112
|
+
"headers": [],
|
|
113
|
+
"missing": "The Bot API has no version selector; the method set is the one typed by @grammyjs/types@3.28.0, the types package of grammy@1.44.0.",
|
|
114
|
+
"unknown": "No version header is read; an unknown method returns a 404 Bot API envelope and a typed but unimplemented method returns 501."
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"authentication": {
|
|
118
|
+
"flows": [
|
|
119
|
+
"local-bot-token-path"
|
|
120
|
+
],
|
|
121
|
+
"keyFormats": [
|
|
122
|
+
"<bot id>:<256-bit base64url secret> in the bot<token> path segment"
|
|
123
|
+
],
|
|
124
|
+
"ownership": "One token authorizes one bot of one local instance; only a SHA-256 verifier is stored, reset removes bots so earlier tokens fail even when a bot ID is reused, and a durable restart keeps issued tokens valid.",
|
|
125
|
+
"unsupported": [
|
|
126
|
+
"Real Telegram bots and BotFather",
|
|
127
|
+
"Token revocation or regeneration commands",
|
|
128
|
+
"Test environment /test paths and local Bot API server modes",
|
|
129
|
+
"MTProto and user accounts"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"events": [],
|
|
133
|
+
"webhooks": {
|
|
134
|
+
"signing": "Unsupported: this slice is polling-only; setWebhook, deleteWebhook and getWebhookInfo return 501 and no webhook can be installed",
|
|
135
|
+
"id": "Unsupported",
|
|
136
|
+
"body": "Unsupported",
|
|
137
|
+
"success": "Unsupported",
|
|
138
|
+
"timeoutMs": 0,
|
|
139
|
+
"retries": "Unsupported",
|
|
140
|
+
"redelivery": "Unsupported",
|
|
141
|
+
"recovery": "Unsupported",
|
|
142
|
+
"cases": []
|
|
143
|
+
},
|
|
144
|
+
"capabilities": [
|
|
145
|
+
"http",
|
|
146
|
+
"authorization",
|
|
147
|
+
"reset"
|
|
148
|
+
],
|
|
149
|
+
"limitations": [
|
|
150
|
+
{
|
|
151
|
+
"id": "telegram.limitation.1",
|
|
152
|
+
"description": "Only getMe, sendMessage and getUpdates are implemented; every other method typed by @grammyjs/types@3.28.0, including setWebhook, deleteWebhook and getWebhookInfo, returns a 501 Bot API envelope"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "telegram.limitation.2",
|
|
156
|
+
"description": "Only POST with an application/json object body; GET, query parameters, form and multipart bodies return 501, and any getMe parameter returns 501 instead of being ignored"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "telegram.limitation.3",
|
|
160
|
+
"description": "getMe reports a bot without optional capabilities: can_join_groups is true and every other capability flag is false"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "telegram.limitation.4",
|
|
164
|
+
"description": "Failures use fixed descriptions: 404 Not Found for a path that is not bot<token>/<method>, a malformed token or an unknown method; 401 Unauthorized for a well-formed token of no issued bot; 400 for a body that is not a JSON object"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "telegram.limitation.5",
|
|
168
|
+
"description": "Bot IDs are allocated locally from 7000000001 upward and bot secrets are 43 base64url characters rather than the 35 of issued Telegram tokens"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "telegram.limitation.6",
|
|
172
|
+
"description": "sendMessage targets configured channels only, by ID or @username; it accepts chat_id, text, parse_mode MarkdownV2 or none, disable_notification and link_preview_options with is_disabled false, without simulating notifications or link previews. Any other field, is_disabled true or another link preview option returns 501, as do the HTML and legacy Markdown parse modes"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "telegram.limitation.7",
|
|
176
|
+
"description": "MarkdownV2 covers escapes, bold, italic, underline, strikethrough, spoiler, inline code, fenced code with a language, links to http and https targets, block quotations and expandable block quotations, which is everything md-to-telegram@0.1.1 emits. Custom emoji, date-time entities, user mentions through tg:// links and other link schemes return 400 can't parse entities, as does code spanning quoted lines"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "telegram.limitation.8",
|
|
180
|
+
"description": "Failures carry fixed descriptions without the offending character or offset Telegram appends; entities are only those written in markup, with no automatic url, mention or hashtag detection, and rendered text keeps leading and trailing whitespace"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "telegram.limitation.9",
|
|
184
|
+
"description": "A link target without a scheme gets http://, and a target that is not a URL keeps its text without an entity; targets are normalized by the WHATWG URL parser, which can differ from Telegram in trailing slashes and percent-encoding"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "telegram.limitation.10",
|
|
188
|
+
"description": "getUpdates only ever returns message_reaction_count updates, produced by the reactions set command for configured channel messages; there are no users, per-user message_reaction updates, channel_post or other update types, and no provider method sets reactions"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "telegram.limitation.11",
|
|
192
|
+
"description": "getUpdates accepts only offset, limit, timeout and allowed_updates as JSON numbers and a list of update type names typed by @grammyjs/types@3.28.0; a limit outside 1 to 100, a non-integer or negative timeout and an unknown update type return 400 instead of being clamped or ignored, and any other parameter returns 501"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "telegram.limitation.12",
|
|
196
|
+
"description": "One getUpdates call per bot may run at a time; an overlapping call receives the 409 Conflict envelope instead of ending the earlier one. A poll cancelled by reset or shutdown receives a 503 envelope, never an empty batch"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "telegram.limitation.13",
|
|
200
|
+
"description": "reactions set accepts the reaction emoji typed by @grammyjs/types@3.28.0, numeric custom emoji IDs and paid reactions, and orders counts by total_count, then paid, emoji and custom emoji, then by emoji or ID; Telegram does not document its order"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"verification": {
|
|
204
|
+
"mode": "official-client",
|
|
205
|
+
"client": "grammy@1.44.0",
|
|
206
|
+
"suites": [
|
|
207
|
+
{
|
|
208
|
+
"path": "packages/telegram/tests/bot_cases.ts",
|
|
209
|
+
"cases": [
|
|
210
|
+
"telegram.bots.1",
|
|
211
|
+
"telegram.bots.2",
|
|
212
|
+
"telegram.bots.3"
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"path": "packages/telegram/tests/message_cases.ts",
|
|
217
|
+
"cases": [
|
|
218
|
+
"telegram.messages.1",
|
|
219
|
+
"telegram.messages.2",
|
|
220
|
+
"telegram.messages.3"
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"path": "packages/telegram/tests/update_cases.ts",
|
|
225
|
+
"cases": [
|
|
226
|
+
"telegram.updates.1",
|
|
227
|
+
"telegram.updates.2",
|
|
228
|
+
"telegram.updates.3"
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"path": "packages/telegram/tests/consumer_cases.ts",
|
|
233
|
+
"cases": [
|
|
234
|
+
"telegram.consumer.1"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"sources": [
|
|
239
|
+
"https://core.telegram.org/bots/api",
|
|
240
|
+
"https://core.telegram.org/bots/api#making-requests",
|
|
241
|
+
"https://core.telegram.org/bots/api#getme",
|
|
242
|
+
"https://core.telegram.org/bots/api#sendmessage",
|
|
243
|
+
"https://core.telegram.org/bots/api#markdownv2-style",
|
|
244
|
+
"https://core.telegram.org/bots/api#messageentity",
|
|
245
|
+
"https://core.telegram.org/bots/api#getting-updates",
|
|
246
|
+
"https://core.telegram.org/bots/api#getupdates",
|
|
247
|
+
"https://core.telegram.org/bots/api#messagereactioncountupdated",
|
|
248
|
+
"https://core.telegram.org/bots/api#reactioncount",
|
|
249
|
+
"https://grammy.dev/ref/core/apiclientoptions"
|
|
250
|
+
],
|
|
251
|
+
"retrieved": "2026-09-25",
|
|
252
|
+
"liveProviderCompared": false
|
|
253
|
+
},
|
|
254
|
+
"details": {
|
|
255
|
+
"route": "grammY builds <apiRoot>/bot<token>/<method>; the endpoint URL is apiRoot with no trailing slash. The token is validated before the method is resolved, and method names are case-insensitive.",
|
|
256
|
+
"envelopes": "Success is HTTP 200 with {ok: true, result}; failure uses the matching HTTP status with {ok: false, error_code, description}, and no description contains the token, the path or caller input.",
|
|
257
|
+
"channels": "fixtures.channels declares channels with a -100 prefixed negative ID, a title and a username unique without regard to case; bot usernames share that namespace.",
|
|
258
|
+
"messages": "Every successful sendMessage allocates the next message_id of its chat in the transaction that stores the message, so IDs are gapless and monotone across bots, concurrent calls and durable restart; a failed send writes nothing. Malformed MarkdownV2 fails before the 4096 UTF-16 unit limit on rendered text. messages list returns the stored source and rendered text of up to the latest 100 messages of a channel, oldest first.",
|
|
259
|
+
"updates": "Each bot has a durable queue with its own update IDs from 1 and a remembered allowed_updates. reactions set replaces the absolute counts of a message and, when they change, queues one message_reaction_count update for every bot subscribed at that moment, in the same transaction; an unchanged snapshot queues nothing and a reaction set before a bot subscribes never reaches it. A nonnegative offset confirms smaller IDs, a negative one keeps only the last updates, returning a batch confirms nothing, and updates inspect reads a queue without confirming it.",
|
|
260
|
+
"longPolling": "A positive timeout waits that many seconds of real time, not the instance clock, and returns as soon as an update commits. A client disconnect ends the wait, and reset or shutdown ends it before waiting for requests to drain.",
|
|
261
|
+
"transportLimit": "The host body limit answers oversized bodies with a plain 413 before the route runs, outside the Bot API envelope."
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"dependencies": {
|
|
266
|
+
"zod": "4.6.5"
|
|
267
|
+
},
|
|
268
|
+
"peerDependencies": {
|
|
269
|
+
"emulon": "0.2.0",
|
|
270
|
+
"hono": "4.13.8"
|
|
271
|
+
},
|
|
272
|
+
"_generatedBy": "dnt@0.43.2",
|
|
273
|
+
"types": "./esm/mod.d.ts",
|
|
274
|
+
"files": [
|
|
275
|
+
"esm"
|
|
276
|
+
]
|
|
277
|
+
}
|