@volter/twin-telegram 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +53 -0
- package/dist/generated/pack-facts.json +53 -0
- package/dist/journeys/coverage.json +138 -0
- package/dist/journeys/customer-life.json +1229 -0
- package/dist/journeys/customer-life.outline.md +99 -0
- package/dist/journeys/customer-life.outline.verdict.json +76 -0
- package/dist/journeys/customer-life.verdict.json +134 -0
- package/dist/journeys/decisions.json +95 -0
- package/dist/journeys/demand.json +152 -0
- package/dist/journeys/score.json +163 -0
- package/dist/journeys/unreachable.json +29 -0
- package/dist/journeys/vendor-examples.json +1554 -0
- package/dist/journeys/vendor-examples.verdict.json +14 -0
- package/dist/spec/SOURCE.md +51 -0
- package/dist/spec/bot-api.html.gz +0 -0
- package/dist/spec/doc-examples.json +344 -0
- package/dist/spec/grouping.json +1 -0
- package/dist/spec/openapi.json.gz +0 -0
- package/dist/spec/page-to-openapi.ts +258 -0
- package/dist/spec/patches.json +289 -0
- package/dist/spec/sources.json +416 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +21 -0
- package/dist/src/engine/media.d.ts +17 -0
- package/dist/src/engine/media.js +75 -0
- package/dist/src/engine/text.d.ts +45 -0
- package/dist/src/engine/text.js +512 -0
- package/dist/src/fetch.d.ts +2 -0
- package/dist/src/fetch.js +17 -0
- package/dist/src/generated/surface.gen.json +1 -0
- package/dist/src/generated/ui.gen.json +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +9 -0
- package/dist/src/manifest.d.ts +2 -0
- package/dist/src/manifest.js +104 -0
- package/dist/src/semantics/around.d.ts +2 -0
- package/dist/src/semantics/around.js +32 -0
- package/dist/src/semantics/available-methods.d.ts +12 -0
- package/dist/src/semantics/available-methods.js +266 -0
- package/dist/src/semantics/doors.d.ts +18 -0
- package/dist/src/semantics/doors.js +292 -0
- package/dist/src/semantics/getting-updates.d.ts +3 -0
- package/dist/src/semantics/getting-updates.js +68 -0
- package/dist/src/semantics/index.d.ts +2 -0
- package/dist/src/semantics/index.js +19 -0
- package/dist/src/semantics/shared.d.ts +112 -0
- package/dist/src/semantics/shared.js +424 -0
- package/dist/src/semantics/states.d.ts +18 -0
- package/dist/src/semantics/states.js +37 -0
- package/dist/src/semantics/updating-messages.d.ts +2 -0
- package/dist/src/semantics/updating-messages.js +48 -0
- package/dist/src/server.d.ts +7 -0
- package/dist/src/server.js +24 -0
- package/generated/pack-facts.json +53 -0
- package/journeys/coverage.json +138 -0
- package/journeys/customer-life.json +1229 -0
- package/journeys/customer-life.outline.md +99 -0
- package/journeys/customer-life.outline.verdict.json +76 -0
- package/journeys/customer-life.verdict.json +134 -0
- package/journeys/decisions.json +95 -0
- package/journeys/demand.json +152 -0
- package/journeys/score.json +163 -0
- package/journeys/unreachable.json +29 -0
- package/journeys/vendor-examples.json +1554 -0
- package/journeys/vendor-examples.verdict.json +14 -0
- package/package.json +37 -0
- package/spec/SOURCE.md +51 -0
- package/spec/bot-api.html.gz +0 -0
- package/spec/doc-examples.json +344 -0
- package/spec/grouping.json +1 -0
- package/spec/openapi.json.gz +0 -0
- package/spec/page-to-openapi.ts +258 -0
- package/spec/patches.json +289 -0
- package/spec/sources.json +416 -0
- package/src/cli.ts +22 -0
- package/src/engine/media.ts +67 -0
- package/src/engine/text.ts +409 -0
- package/src/fetch.ts +18 -0
- package/src/generated/surface.gen.json +1 -0
- package/src/generated/ui.gen.json +1 -0
- package/src/index.ts +11 -0
- package/src/manifest.ts +114 -0
- package/src/semantics/around.ts +33 -0
- package/src/semantics/available-methods.ts +253 -0
- package/src/semantics/doors.ts +277 -0
- package/src/semantics/getting-updates.ts +64 -0
- package/src/semantics/index.ts +23 -0
- package/src/semantics/shared.ts +428 -0
- package/src/semantics/states.ts +38 -0
- package/src/semantics/updating-messages.ts +41 -0
- package/src/server.ts +17 -0
|
@@ -0,0 +1,1554 @@
|
|
|
1
|
+
{
|
|
2
|
+
"vendor": "telegram",
|
|
3
|
+
"author": "Contributor 173",
|
|
4
|
+
"host": "api.telegram.org",
|
|
5
|
+
"about": "The Bot API page's examples and stated rules for the methods the telegram pack serves, made by Rui, a developer trying the page against his first bot (@rui_notes_bot): the Making requests example (GET, and a method name in another case), the HTML, MarkdownV2 and Markdown style blocks and their rules, a mention by id, an unsupported parse_mode, the text, update, webhook, chat action, deletion, album and photo rules (a file that is no image among them), each replayed as the answer or the refusal it causes. Setup steps make each example's precondition true (an account, the bot, his messages, a group with Marta, a channel) or read its effect back (the queue after a negative offset, after drop_pending_updates, after allowed_updates).",
|
|
6
|
+
"notReplayed": {
|
|
7
|
+
"sendPhoto#doc sendPhoto: an HTTP URL": "Telegram downloads the URL; a World is sealed, so the twin reaches no URL outside it and answers as Telegram does for a URL it cannot get (Bad Request: failed to get HTTP URL content); no World of this surface replays the success the page describes",
|
|
8
|
+
"sendPhoto#doc sendPhoto: 10 MB": "a journey file carries its upload as base64: a file over the limit (10, 20 or 50 MB) would make the examples journey tens of megabytes; the rule is the twin's check of the upload's size, read in available-methods.ts and getFile",
|
|
9
|
+
"sendVideo#doc sendVideo: 50 MB": "a journey file carries its upload as base64: a file over the limit (10, 20 or 50 MB) would make the examples journey tens of megabytes; the rule is the twin's check of the upload's size, read in available-methods.ts and getFile",
|
|
10
|
+
"sendDocument#doc sendDocument: 50 MB": "a journey file carries its upload as base64: a file over the limit (10, 20 or 50 MB) would make the examples journey tens of megabytes; the rule is the twin's check of the upload's size, read in available-methods.ts and getFile",
|
|
11
|
+
"getFile#doc getFile: 20 MB": "a journey file carries its upload as base64: a file over the limit (10, 20 or 50 MB) would make the examples journey tens of megabytes; the rule is the twin's check of the upload's size, read in available-methods.ts and getFile"
|
|
12
|
+
},
|
|
13
|
+
"steps": [
|
|
14
|
+
{
|
|
15
|
+
"name": "Setup: Monday 5 January, 09:00",
|
|
16
|
+
"wait": "105h"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Setup: Rui has a Telegram account",
|
|
20
|
+
"method": "POST",
|
|
21
|
+
"path": "/_twin/people",
|
|
22
|
+
"body": {
|
|
23
|
+
"first_name": "Rui",
|
|
24
|
+
"last_name": "Matos",
|
|
25
|
+
"username": "rui_matos"
|
|
26
|
+
},
|
|
27
|
+
"status": 200,
|
|
28
|
+
"capture": {
|
|
29
|
+
"rui": "id"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Setup: Marta, his colleague, has one too",
|
|
34
|
+
"method": "POST",
|
|
35
|
+
"path": "/_twin/people",
|
|
36
|
+
"body": {
|
|
37
|
+
"first_name": "Marta",
|
|
38
|
+
"username": "marta_s"
|
|
39
|
+
},
|
|
40
|
+
"status": 200,
|
|
41
|
+
"capture": {
|
|
42
|
+
"marta": "id"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "Setup: Rui makes a bot with BotFather",
|
|
47
|
+
"method": "POST",
|
|
48
|
+
"path": "/_twin/bots",
|
|
49
|
+
"body": {
|
|
50
|
+
"owner": "{rui}",
|
|
51
|
+
"name": "Rui Notes",
|
|
52
|
+
"username": "rui_notes_bot"
|
|
53
|
+
},
|
|
54
|
+
"status": 200,
|
|
55
|
+
"capture": {
|
|
56
|
+
"token": "token",
|
|
57
|
+
"bot": "id"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "getMe#doc Making requests: getMe",
|
|
62
|
+
"example": "getMe#doc Making requests: getMe",
|
|
63
|
+
"method": "GET",
|
|
64
|
+
"path": "/bot{token}/getMe",
|
|
65
|
+
"status": 200,
|
|
66
|
+
"expect": [
|
|
67
|
+
{
|
|
68
|
+
"path": "result.id",
|
|
69
|
+
"equals": "{bot}"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "result.username",
|
|
73
|
+
"equals": "rui_notes_bot"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": "result.first_name",
|
|
77
|
+
"equals": "Rui Notes"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "getMe#doc Making requests: methods are case-insensitive",
|
|
83
|
+
"example": "getMe#doc Making requests: methods are case-insensitive",
|
|
84
|
+
"method": "POST",
|
|
85
|
+
"path": "/bot{token}/GETME",
|
|
86
|
+
"body": {},
|
|
87
|
+
"status": 200,
|
|
88
|
+
"expect": [
|
|
89
|
+
{
|
|
90
|
+
"path": "result.id",
|
|
91
|
+
"equals": "{bot}"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"path": "result.username",
|
|
95
|
+
"equals": "rui_notes_bot"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"path": "result.first_name",
|
|
99
|
+
"equals": "Rui Notes"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "Setup: Rui starts the bot and writes to it twice",
|
|
105
|
+
"method": "POST",
|
|
106
|
+
"path": "/_twin/messages",
|
|
107
|
+
"body": {
|
|
108
|
+
"from": "{rui}",
|
|
109
|
+
"chat": "@rui_notes_bot",
|
|
110
|
+
"text": "/start"
|
|
111
|
+
},
|
|
112
|
+
"status": 200
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "Setup: ...a first note",
|
|
116
|
+
"method": "POST",
|
|
117
|
+
"path": "/_twin/messages",
|
|
118
|
+
"body": {
|
|
119
|
+
"from": "{rui}",
|
|
120
|
+
"chat": "@rui_notes_bot",
|
|
121
|
+
"text": "note: buy coffee filters"
|
|
122
|
+
},
|
|
123
|
+
"status": 200
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "Setup: ...and a second",
|
|
127
|
+
"method": "POST",
|
|
128
|
+
"path": "/_twin/messages",
|
|
129
|
+
"body": {
|
|
130
|
+
"from": "{rui}",
|
|
131
|
+
"chat": "@rui_notes_bot",
|
|
132
|
+
"text": "note: call the printer shop"
|
|
133
|
+
},
|
|
134
|
+
"status": 200,
|
|
135
|
+
"capture": {
|
|
136
|
+
"second_note": "message_id"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "getUpdates#doc getUpdates: limit",
|
|
141
|
+
"example": "getUpdates#doc getUpdates: limit",
|
|
142
|
+
"method": "POST",
|
|
143
|
+
"path": "/bot{token}/getUpdates",
|
|
144
|
+
"body": {
|
|
145
|
+
"limit": 1
|
|
146
|
+
},
|
|
147
|
+
"status": 200,
|
|
148
|
+
"capture": {
|
|
149
|
+
"rui_chat": "result.0.message.chat.id"
|
|
150
|
+
},
|
|
151
|
+
"expect": [
|
|
152
|
+
{
|
|
153
|
+
"path": "result.0.message.text",
|
|
154
|
+
"equals": "/start"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"path": "result.0.message.from.id",
|
|
158
|
+
"equals": "{rui}"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"path": "result.1",
|
|
162
|
+
"exists": false
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"path": "result.0.message.from.username",
|
|
166
|
+
"equals": "rui_matos"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"path": "result.0.message.chat.username",
|
|
170
|
+
"equals": "rui_matos"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"path": "result.0.message.from.first_name",
|
|
174
|
+
"equals": "Rui"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"path": "result.0.message.from.last_name",
|
|
178
|
+
"equals": "Matos"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"path": "result.0.message.chat.first_name",
|
|
182
|
+
"equals": "Rui"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"path": "result.0.message.chat.last_name",
|
|
186
|
+
"equals": "Matos"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "getUpdates#doc getUpdates: a negative offset",
|
|
192
|
+
"example": "getUpdates#doc getUpdates: a negative offset",
|
|
193
|
+
"method": "POST",
|
|
194
|
+
"path": "/bot{token}/getUpdates",
|
|
195
|
+
"body": {
|
|
196
|
+
"offset": -1
|
|
197
|
+
},
|
|
198
|
+
"status": 200,
|
|
199
|
+
"expect": [
|
|
200
|
+
{
|
|
201
|
+
"path": "result.0.message.text",
|
|
202
|
+
"equals": "note: call the printer shop"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"path": "result.1",
|
|
206
|
+
"exists": false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"path": "result.0.message.from.username",
|
|
210
|
+
"equals": "rui_matos"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"path": "result.0.message.chat.username",
|
|
214
|
+
"equals": "rui_matos"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"path": "result.0.message.from.first_name",
|
|
218
|
+
"equals": "Rui"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"path": "result.0.message.from.last_name",
|
|
222
|
+
"equals": "Matos"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"path": "result.0.message.chat.first_name",
|
|
226
|
+
"equals": "Rui"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"path": "result.0.message.chat.last_name",
|
|
230
|
+
"equals": "Matos"
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "Setup: read again, only the last update is left",
|
|
236
|
+
"method": "POST",
|
|
237
|
+
"path": "/bot{token}/getUpdates",
|
|
238
|
+
"body": {},
|
|
239
|
+
"status": 200,
|
|
240
|
+
"expect": [
|
|
241
|
+
{
|
|
242
|
+
"path": "result.0.message.text",
|
|
243
|
+
"equals": "note: call the printer shop"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"path": "result.1",
|
|
247
|
+
"exists": false
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "deleteWebhook#doc deleteWebhook: drop pending updates",
|
|
253
|
+
"example": "deleteWebhook#doc deleteWebhook: drop pending updates",
|
|
254
|
+
"method": "POST",
|
|
255
|
+
"path": "/bot{token}/deleteWebhook",
|
|
256
|
+
"body": {
|
|
257
|
+
"drop_pending_updates": true
|
|
258
|
+
},
|
|
259
|
+
"status": 200,
|
|
260
|
+
"expect": [
|
|
261
|
+
{
|
|
262
|
+
"path": "result",
|
|
263
|
+
"equals": true
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "Setup: read again, nothing is pending",
|
|
269
|
+
"method": "POST",
|
|
270
|
+
"path": "/bot{token}/getUpdates",
|
|
271
|
+
"body": {},
|
|
272
|
+
"status": 200,
|
|
273
|
+
"expect": [
|
|
274
|
+
{
|
|
275
|
+
"path": "result.0",
|
|
276
|
+
"exists": false
|
|
277
|
+
}
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"name": "sendMessage#doc HTML style",
|
|
282
|
+
"example": "sendMessage#doc HTML style",
|
|
283
|
+
"method": "POST",
|
|
284
|
+
"path": "/bot{token}/sendMessage",
|
|
285
|
+
"body": {
|
|
286
|
+
"chat_id": "{rui_chat}",
|
|
287
|
+
"text": "<b>bold</b>, <strong>bold</strong>\n<i>italic</i>, <em>italic</em>\n<u>underline</u>, <ins>underline</ins>\n<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>\n<span class=\"tg-spoiler\">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler>\n<b>bold <i>italic bold <s>italic bold strikethrough <span class=\"tg-spoiler\">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b>\n<a href=\"http://www.example.com/\">inline URL</a>\n<a href=\"tg://user?id=123456789\">inline mention of a user</a>\n<tg-emoji emoji-id=\"5368324170671202286\">👍</tg-emoji>\n<tg-time unix=\"1647531900\" format=\"wDT\">22:45 tomorrow</tg-time>\n<tg-time unix=\"1647531900\" format=\"t\">22:45 tomorrow</tg-time>\n<tg-time unix=\"1647531900\" format=\"r\">22:45 tomorrow</tg-time>\n<tg-time unix=\"1647531900\">22:45 tomorrow</tg-time>\n<code>inline fixed-width code</code>\n<pre>pre-formatted fixed-width code block</pre>\n<pre><code class=\"language-python\">pre-formatted fixed-width code block written in the Python programming language</code></pre>\n<blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>\n<blockquote expandable>Expandable block quotation started\nExpandable block quotation continued\nExpandable block quotation continued\nHidden by default part of the block quotation started\nExpandable block quotation continued\nThe last line of the block quotation</blockquote>",
|
|
288
|
+
"parse_mode": "HTML"
|
|
289
|
+
},
|
|
290
|
+
"status": 200,
|
|
291
|
+
"capture": {
|
|
292
|
+
"html_message": "result.message_id"
|
|
293
|
+
},
|
|
294
|
+
"expect": [
|
|
295
|
+
{
|
|
296
|
+
"path": "result.text",
|
|
297
|
+
"contains": "bold, bold\nitalic, italic"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"path": "result.entities.0.type",
|
|
301
|
+
"equals": "bold"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"path": "result.text",
|
|
305
|
+
"notContains": "<"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"path": "result.entities",
|
|
309
|
+
"contains": "\"type\":\"text_link\",\"offset\""
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"path": "result.entities",
|
|
313
|
+
"contains": "\"type\":\"date_time\""
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"path": "result.entities",
|
|
317
|
+
"contains": "\"language\":\"python\""
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"path": "result.entities",
|
|
321
|
+
"contains": "\"type\":\"expandable_blockquote\""
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"path": "result.entities",
|
|
325
|
+
"notContains": "custom_emoji"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"path": "result.from.first_name",
|
|
329
|
+
"equals": "Rui Notes"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"path": "result.from.username",
|
|
333
|
+
"equals": "rui_notes_bot"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"path": "result.chat.username",
|
|
337
|
+
"equals": "rui_matos"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"path": "result.chat.first_name",
|
|
341
|
+
"equals": "Rui"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"path": "result.chat.last_name",
|
|
345
|
+
"equals": "Matos"
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "sendMessage#doc HTML style: only the tags mentioned",
|
|
351
|
+
"example": "sendMessage#doc HTML style: only the tags mentioned",
|
|
352
|
+
"method": "POST",
|
|
353
|
+
"path": "/bot{token}/sendMessage",
|
|
354
|
+
"body": {
|
|
355
|
+
"chat_id": "{rui_chat}",
|
|
356
|
+
"text": "<p>Standup notes</p>",
|
|
357
|
+
"parse_mode": "HTML"
|
|
358
|
+
},
|
|
359
|
+
"status": 400,
|
|
360
|
+
"expect": [
|
|
361
|
+
{
|
|
362
|
+
"path": "description",
|
|
363
|
+
"equals": "Bad Request: can't parse entities: Unsupported start tag \"p\" at byte offset 0"
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "sendMessage#doc HTML style: symbols outside a tag must be entities",
|
|
369
|
+
"example": "sendMessage#doc HTML style: symbols outside a tag must be entities",
|
|
370
|
+
"method": "POST",
|
|
371
|
+
"path": "/bot{token}/sendMessage",
|
|
372
|
+
"body": {
|
|
373
|
+
"chat_id": "{rui_chat}",
|
|
374
|
+
"text": "Ship if 2 < 3",
|
|
375
|
+
"parse_mode": "HTML"
|
|
376
|
+
},
|
|
377
|
+
"status": 400,
|
|
378
|
+
"expect": [
|
|
379
|
+
{
|
|
380
|
+
"path": "description",
|
|
381
|
+
"contains": "can't parse entities"
|
|
382
|
+
}
|
|
383
|
+
]
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"name": "sendMessage#doc HTML style: entities",
|
|
387
|
+
"example": "sendMessage#doc HTML style: entities",
|
|
388
|
+
"method": "POST",
|
|
389
|
+
"path": "/bot{token}/sendMessage",
|
|
390
|
+
"body": {
|
|
391
|
+
"chat_id": "{rui_chat}",
|
|
392
|
+
"text": "Tide & Co 🚀 ❤ <3 ♥",
|
|
393
|
+
"parse_mode": "HTML"
|
|
394
|
+
},
|
|
395
|
+
"status": 200,
|
|
396
|
+
"expect": [
|
|
397
|
+
{
|
|
398
|
+
"path": "result.text",
|
|
399
|
+
"equals": "Tide & Co 🚀 ❤ <3 ♥"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"path": "result.from.first_name",
|
|
403
|
+
"equals": "Rui Notes"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"path": "result.from.username",
|
|
407
|
+
"equals": "rui_notes_bot"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"path": "result.chat.username",
|
|
411
|
+
"equals": "rui_matos"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"path": "result.chat.first_name",
|
|
415
|
+
"equals": "Rui"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"path": "result.chat.last_name",
|
|
419
|
+
"equals": "Matos"
|
|
420
|
+
}
|
|
421
|
+
]
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"name": "sendMessage#doc MarkdownV2 style",
|
|
425
|
+
"example": "sendMessage#doc MarkdownV2 style",
|
|
426
|
+
"method": "POST",
|
|
427
|
+
"path": "/bot{token}/sendMessage",
|
|
428
|
+
"body": {
|
|
429
|
+
"chat_id": "{rui_chat}",
|
|
430
|
+
"text": "*bold \\*text*\n_italic \\*text_\n__underline__\n~strikethrough~\n||spoiler||\n*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*\n[inline URL](http://www.example.com/)\n[inline mention of a user](tg://user?id=123456789)\n\n\n\n\n\n`inline fixed-width code`\n```\npre-formatted fixed-width code block\n```\n```python\npre-formatted fixed-width code block written in the Python programming language\n```\n>Block quotation started\n>Block quotation continued\n>Block quotation continued\n>Block quotation continued\n>The last line of the block quotation\n**>The expandable block quotation started right after the previous block quotation\n>It is separated from the previous block quotation by an empty bold entity\n>Expandable block quotation continued\n>Hidden by default part of the expandable block quotation started\n>Expandable block quotation continued\n>The last line of the expandable block quotation with the expandability mark||",
|
|
431
|
+
"parse_mode": "MarkdownV2"
|
|
432
|
+
},
|
|
433
|
+
"status": 200,
|
|
434
|
+
"expect": [
|
|
435
|
+
{
|
|
436
|
+
"path": "result.text",
|
|
437
|
+
"contains": "bold *text\nitalic *text\nunderline\nstrikethrough\nspoiler\nbold italic bold italic bold strikethrough italic bold strikethrough spoiler underline italic bold bold\ninline URL\ninline mention of a user\n"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"path": "result.text",
|
|
441
|
+
"notContains": "\\"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"path": "result.text",
|
|
445
|
+
"notContains": "||"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
"path": "result.entities.0.type",
|
|
449
|
+
"equals": "bold"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"path": "result.entities.0.length",
|
|
453
|
+
"equals": 10
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"path": "result.entities",
|
|
457
|
+
"contains": "\"type\":\"underline\""
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
"path": "result.entities",
|
|
461
|
+
"contains": "\"type\":\"spoiler\""
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"path": "result.entities",
|
|
465
|
+
"contains": "\"type\":\"text_link\",\"offset\""
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"path": "result.entities",
|
|
469
|
+
"contains": "\"date_time_format\":\"wDT\""
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"path": "result.entities",
|
|
473
|
+
"contains": "\"language\":\"python\""
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
"path": "result.entities",
|
|
477
|
+
"contains": "\"type\":\"blockquote\""
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
"path": "result.entities",
|
|
481
|
+
"contains": "\"type\":\"expandable_blockquote\""
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"path": "result.entities",
|
|
485
|
+
"notContains": "custom_emoji"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"path": "result.entities",
|
|
489
|
+
"notContains": "text_mention"
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
"path": "result.from.first_name",
|
|
493
|
+
"equals": "Rui Notes"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"path": "result.from.username",
|
|
497
|
+
"equals": "rui_notes_bot"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"path": "result.chat.username",
|
|
501
|
+
"equals": "rui_matos"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"path": "result.chat.first_name",
|
|
505
|
+
"equals": "Rui"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"path": "result.chat.last_name",
|
|
509
|
+
"equals": "Matos"
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "sendMessage#doc MarkdownV2 style: reserved characters",
|
|
515
|
+
"example": "sendMessage#doc MarkdownV2 style: reserved characters",
|
|
516
|
+
"method": "POST",
|
|
517
|
+
"path": "/bot{token}/sendMessage",
|
|
518
|
+
"body": {
|
|
519
|
+
"chat_id": "{rui_chat}",
|
|
520
|
+
"text": "Standup moved to 10.30",
|
|
521
|
+
"parse_mode": "MarkdownV2"
|
|
522
|
+
},
|
|
523
|
+
"status": 400,
|
|
524
|
+
"expect": [
|
|
525
|
+
{
|
|
526
|
+
"path": "description",
|
|
527
|
+
"equals": "Bad Request: can't parse entities: Character '.' is reserved and must be escaped with the preceding '\\'"
|
|
528
|
+
}
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "sendMessage#doc MarkdownV2 style: italic and underline",
|
|
533
|
+
"example": "sendMessage#doc MarkdownV2 style: italic and underline",
|
|
534
|
+
"method": "POST",
|
|
535
|
+
"path": "/bot{token}/sendMessage",
|
|
536
|
+
"body": {
|
|
537
|
+
"chat_id": "{rui_chat}",
|
|
538
|
+
"text": "___italic underline_**__",
|
|
539
|
+
"parse_mode": "MarkdownV2"
|
|
540
|
+
},
|
|
541
|
+
"status": 200,
|
|
542
|
+
"expect": [
|
|
543
|
+
{
|
|
544
|
+
"path": "result.text",
|
|
545
|
+
"equals": "italic underline"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"path": "result.entities",
|
|
549
|
+
"contains": "\"type\":\"italic\",\"offset\":0,\"length\":16"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"path": "result.entities",
|
|
553
|
+
"contains": "\"type\":\"underline\",\"offset\":0,\"length\":16"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"path": "result.entities",
|
|
557
|
+
"notContains": "bold"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"path": "result.from.first_name",
|
|
561
|
+
"equals": "Rui Notes"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"path": "result.from.username",
|
|
565
|
+
"equals": "rui_notes_bot"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"path": "result.chat.username",
|
|
569
|
+
"equals": "rui_matos"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"path": "result.chat.first_name",
|
|
573
|
+
"equals": "Rui"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"path": "result.chat.last_name",
|
|
577
|
+
"equals": "Matos"
|
|
578
|
+
}
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "sendMessage#doc MarkdownV2 style: the expandability mark",
|
|
583
|
+
"example": "sendMessage#doc MarkdownV2 style: the expandability mark",
|
|
584
|
+
"method": "POST",
|
|
585
|
+
"path": "/bot{token}/sendMessage",
|
|
586
|
+
"body": {
|
|
587
|
+
"chat_id": "{rui_chat}",
|
|
588
|
+
"text": ">Notes from Monday\n>Buy coffee filters\n>Call the printer shop||\nThat is all for now",
|
|
589
|
+
"parse_mode": "MarkdownV2"
|
|
590
|
+
},
|
|
591
|
+
"status": 200,
|
|
592
|
+
"expect": [
|
|
593
|
+
{
|
|
594
|
+
"path": "result.text",
|
|
595
|
+
"equals": "Notes from Monday\nBuy coffee filters\nCall the printer shop\nThat is all for now"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"path": "result.entities.0.type",
|
|
599
|
+
"equals": "expandable_blockquote"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"path": "result.entities.0.offset",
|
|
603
|
+
"equals": 0
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"path": "result.entities.1",
|
|
607
|
+
"exists": false
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"path": "result.from.first_name",
|
|
611
|
+
"equals": "Rui Notes"
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"path": "result.from.username",
|
|
615
|
+
"equals": "rui_notes_bot"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"path": "result.chat.username",
|
|
619
|
+
"equals": "rui_matos"
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"path": "result.chat.first_name",
|
|
623
|
+
"equals": "Rui"
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"path": "result.chat.last_name",
|
|
627
|
+
"equals": "Matos"
|
|
628
|
+
}
|
|
629
|
+
]
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"name": "sendMessage#doc Markdown style",
|
|
633
|
+
"example": "sendMessage#doc Markdown style",
|
|
634
|
+
"method": "POST",
|
|
635
|
+
"path": "/bot{token}/sendMessage",
|
|
636
|
+
"body": {
|
|
637
|
+
"chat_id": "{rui_chat}",
|
|
638
|
+
"text": "*bold text*\n_italic text_\n[inline URL](http://www.example.com/)\n[inline mention of a user](tg://user?id=123456789)\n`inline fixed-width code`\n```\npre-formatted fixed-width code block\n```\n```python\npre-formatted fixed-width code block written in the Python programming language\n```",
|
|
639
|
+
"parse_mode": "Markdown"
|
|
640
|
+
},
|
|
641
|
+
"status": 200,
|
|
642
|
+
"expect": [
|
|
643
|
+
{
|
|
644
|
+
"path": "result.text",
|
|
645
|
+
"contains": "bold text\nitalic text\ninline URL\ninline mention of a user\ninline fixed-width code\npre-formatted fixed-width code block"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"path": "result.entities.0.type",
|
|
649
|
+
"equals": "bold"
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
"path": "result.entities.0.length",
|
|
653
|
+
"equals": 9
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"path": "result.entities",
|
|
657
|
+
"contains": "\"type\":\"italic\""
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"path": "result.entities",
|
|
661
|
+
"contains": "\"type\":\"text_link\",\"offset\""
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"path": "result.entities",
|
|
665
|
+
"contains": "\"type\":\"code\""
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"path": "result.entities",
|
|
669
|
+
"contains": "\"language\":\"python\""
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"path": "result.entities",
|
|
673
|
+
"notContains": "text_mention"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"path": "result.from.first_name",
|
|
677
|
+
"equals": "Rui Notes"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"path": "result.from.username",
|
|
681
|
+
"equals": "rui_notes_bot"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"path": "result.chat.username",
|
|
685
|
+
"equals": "rui_matos"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"path": "result.chat.first_name",
|
|
689
|
+
"equals": "Rui"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"path": "result.chat.last_name",
|
|
693
|
+
"equals": "Matos"
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"name": "sendMessage#doc Markdown style: escaping",
|
|
699
|
+
"example": "sendMessage#doc Markdown style: escaping",
|
|
700
|
+
"method": "POST",
|
|
701
|
+
"path": "/bot{token}/sendMessage",
|
|
702
|
+
"body": {
|
|
703
|
+
"chat_id": "{rui_chat}",
|
|
704
|
+
"text": "_snake_\\__case_ and *2*\\**2=4*",
|
|
705
|
+
"parse_mode": "Markdown"
|
|
706
|
+
},
|
|
707
|
+
"status": 200,
|
|
708
|
+
"expect": [
|
|
709
|
+
{
|
|
710
|
+
"path": "result.text",
|
|
711
|
+
"equals": "snake_case and 2*2=4"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"path": "result.entities",
|
|
715
|
+
"contains": "\"type\":\"italic\""
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"path": "result.entities",
|
|
719
|
+
"contains": "\"type\":\"bold\""
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"path": "result.from.first_name",
|
|
723
|
+
"equals": "Rui Notes"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"path": "result.from.username",
|
|
727
|
+
"equals": "rui_notes_bot"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"path": "result.chat.username",
|
|
731
|
+
"equals": "rui_matos"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"path": "result.chat.first_name",
|
|
735
|
+
"equals": "Rui"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"path": "result.chat.last_name",
|
|
739
|
+
"equals": "Matos"
|
|
740
|
+
}
|
|
741
|
+
]
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"name": "sendMessage#doc sendMessage: text over 4096 characters",
|
|
745
|
+
"example": "sendMessage#doc sendMessage: text over 4096 characters",
|
|
746
|
+
"method": "POST",
|
|
747
|
+
"path": "/bot{token}/sendMessage",
|
|
748
|
+
"body": {
|
|
749
|
+
"chat_id": "{rui_chat}",
|
|
750
|
+
"text": "Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the standup. Notes from the st"
|
|
751
|
+
},
|
|
752
|
+
"status": 400,
|
|
753
|
+
"expect": [
|
|
754
|
+
{
|
|
755
|
+
"path": "description",
|
|
756
|
+
"equals": "Bad Request: message is too long"
|
|
757
|
+
}
|
|
758
|
+
]
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"name": "sendMessage#doc sendMessage: no text",
|
|
762
|
+
"example": "sendMessage#doc sendMessage: no text",
|
|
763
|
+
"method": "POST",
|
|
764
|
+
"path": "/bot{token}/sendMessage",
|
|
765
|
+
"body": {
|
|
766
|
+
"chat_id": "{rui_chat}",
|
|
767
|
+
"text": ""
|
|
768
|
+
},
|
|
769
|
+
"status": 400,
|
|
770
|
+
"expect": [
|
|
771
|
+
{
|
|
772
|
+
"path": "description",
|
|
773
|
+
"equals": "Bad Request: message text is empty"
|
|
774
|
+
}
|
|
775
|
+
]
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"name": "sendMessage#doc ReplyParameters: sent without the message replied to",
|
|
779
|
+
"example": "sendMessage#doc ReplyParameters: sent without the message replied to",
|
|
780
|
+
"method": "POST",
|
|
781
|
+
"path": "/bot{token}/sendMessage",
|
|
782
|
+
"body": {
|
|
783
|
+
"chat_id": "{rui_chat}",
|
|
784
|
+
"text": "Re: the printer shop",
|
|
785
|
+
"reply_parameters": {
|
|
786
|
+
"message_id": 999,
|
|
787
|
+
"allow_sending_without_reply": true
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
"status": 200,
|
|
791
|
+
"expect": [
|
|
792
|
+
{
|
|
793
|
+
"path": "result.text",
|
|
794
|
+
"equals": "Re: the printer shop"
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"path": "result.reply_to_message",
|
|
798
|
+
"exists": false
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"path": "result.from.first_name",
|
|
802
|
+
"equals": "Rui Notes"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
"path": "result.from.username",
|
|
806
|
+
"equals": "rui_notes_bot"
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
"path": "result.chat.username",
|
|
810
|
+
"equals": "rui_matos"
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
"path": "result.chat.first_name",
|
|
814
|
+
"equals": "Rui"
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
"path": "result.chat.last_name",
|
|
818
|
+
"equals": "Matos"
|
|
819
|
+
}
|
|
820
|
+
]
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"name": "sendChatAction#doc sendChatAction: an action",
|
|
824
|
+
"example": "sendChatAction#doc sendChatAction: an action",
|
|
825
|
+
"method": "POST",
|
|
826
|
+
"path": "/bot{token}/sendChatAction",
|
|
827
|
+
"body": {
|
|
828
|
+
"chat_id": "{rui_chat}",
|
|
829
|
+
"action": "thinking"
|
|
830
|
+
},
|
|
831
|
+
"status": 400,
|
|
832
|
+
"expect": [
|
|
833
|
+
{
|
|
834
|
+
"path": "description",
|
|
835
|
+
"equals": "Bad Request: wrong parameter action in request"
|
|
836
|
+
}
|
|
837
|
+
]
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"name": "deleteMessage#doc deleteMessage: an incoming message in a private chat",
|
|
841
|
+
"example": "deleteMessage#doc deleteMessage: an incoming message in a private chat",
|
|
842
|
+
"method": "POST",
|
|
843
|
+
"path": "/bot{token}/deleteMessage",
|
|
844
|
+
"body": {
|
|
845
|
+
"chat_id": "{rui_chat}",
|
|
846
|
+
"message_id": "{second_note}"
|
|
847
|
+
},
|
|
848
|
+
"status": 200,
|
|
849
|
+
"expect": [
|
|
850
|
+
{
|
|
851
|
+
"path": "result",
|
|
852
|
+
"equals": true
|
|
853
|
+
}
|
|
854
|
+
]
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"name": "Setup: Rui makes a group with Marta and the bot as its administrator",
|
|
858
|
+
"method": "POST",
|
|
859
|
+
"path": "/_twin/chats",
|
|
860
|
+
"body": {
|
|
861
|
+
"creator": "{rui}",
|
|
862
|
+
"type": "group",
|
|
863
|
+
"title": "Rui and Marta",
|
|
864
|
+
"members": [
|
|
865
|
+
{
|
|
866
|
+
"user": "{marta}"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"user": "{bot}",
|
|
870
|
+
"status": "administrator",
|
|
871
|
+
"rights": {
|
|
872
|
+
"can_delete_messages": true
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
]
|
|
876
|
+
},
|
|
877
|
+
"status": 200,
|
|
878
|
+
"capture": {
|
|
879
|
+
"group": "id"
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"name": "Setup: Marta posts in the group",
|
|
884
|
+
"method": "POST",
|
|
885
|
+
"path": "/_twin/messages",
|
|
886
|
+
"body": {
|
|
887
|
+
"from": "{marta}",
|
|
888
|
+
"chat": "{group}",
|
|
889
|
+
"text": "testing, please ignore"
|
|
890
|
+
},
|
|
891
|
+
"status": 200,
|
|
892
|
+
"capture": {
|
|
893
|
+
"marta_post": "message_id"
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"name": "getUpdates#doc getUpdates: allowed_updates and the updates made before",
|
|
898
|
+
"example": "getUpdates#doc getUpdates: allowed_updates and the updates made before",
|
|
899
|
+
"method": "POST",
|
|
900
|
+
"path": "/bot{token}/getUpdates",
|
|
901
|
+
"body": {
|
|
902
|
+
"allowed_updates": [
|
|
903
|
+
"channel_post"
|
|
904
|
+
]
|
|
905
|
+
},
|
|
906
|
+
"status": 200,
|
|
907
|
+
"capture": {
|
|
908
|
+
"next_update": "next:result.2.update_id"
|
|
909
|
+
},
|
|
910
|
+
"expect": [
|
|
911
|
+
{
|
|
912
|
+
"path": "result.0.my_chat_member.new_chat_member.status",
|
|
913
|
+
"equals": "administrator"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"path": "result.1.message.group_chat_created",
|
|
917
|
+
"equals": true
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"path": "result.2.message.text",
|
|
921
|
+
"equals": "testing, please ignore"
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
"path": "result.3",
|
|
925
|
+
"exists": false
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"path": "result.0.my_chat_member.chat.title",
|
|
929
|
+
"equals": "Rui and Marta"
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
"path": "result.0.my_chat_member.from.username",
|
|
933
|
+
"equals": "rui_matos"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"path": "result.0.my_chat_member.old_chat_member.user.first_name",
|
|
937
|
+
"equals": "Rui Notes"
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"path": "result.0.my_chat_member.old_chat_member.user.username",
|
|
941
|
+
"equals": "rui_notes_bot"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"path": "result.0.my_chat_member.new_chat_member.user.first_name",
|
|
945
|
+
"equals": "Rui Notes"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
"path": "result.0.my_chat_member.new_chat_member.user.username",
|
|
949
|
+
"equals": "rui_notes_bot"
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
"path": "result.1.message.from.username",
|
|
953
|
+
"equals": "rui_matos"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"path": "result.1.message.chat.title",
|
|
957
|
+
"equals": "Rui and Marta"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
"path": "result.2.message.from.username",
|
|
961
|
+
"equals": "marta_s"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"path": "result.2.message.chat.title",
|
|
965
|
+
"equals": "Rui and Marta"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
"path": "result.0.my_chat_member.from.first_name",
|
|
969
|
+
"equals": "Rui"
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
"path": "result.0.my_chat_member.from.last_name",
|
|
973
|
+
"equals": "Matos"
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
"path": "result.0.my_chat_member.new_chat_member.can_delete_messages",
|
|
977
|
+
"equals": true
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"path": "result.1.message.from.first_name",
|
|
981
|
+
"equals": "Rui"
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
"path": "result.1.message.from.last_name",
|
|
985
|
+
"equals": "Matos"
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
"path": "result.2.message.from.first_name",
|
|
989
|
+
"equals": "Marta"
|
|
990
|
+
}
|
|
991
|
+
]
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
"name": "Setup: Marta posts again, after the setting",
|
|
995
|
+
"method": "POST",
|
|
996
|
+
"path": "/_twin/messages",
|
|
997
|
+
"body": {
|
|
998
|
+
"from": "{marta}",
|
|
999
|
+
"chat": "{group}",
|
|
1000
|
+
"text": "second test"
|
|
1001
|
+
},
|
|
1002
|
+
"status": 200
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"name": "Setup: read again: the group message made after the setting is not sent",
|
|
1006
|
+
"method": "POST",
|
|
1007
|
+
"path": "/bot{token}/getUpdates",
|
|
1008
|
+
"body": {
|
|
1009
|
+
"offset": "{next_update}"
|
|
1010
|
+
},
|
|
1011
|
+
"status": 200,
|
|
1012
|
+
"expect": [
|
|
1013
|
+
{
|
|
1014
|
+
"path": "result.0",
|
|
1015
|
+
"exists": false
|
|
1016
|
+
}
|
|
1017
|
+
]
|
|
1018
|
+
},
|
|
1019
|
+
{
|
|
1020
|
+
"name": "deleteMessage#doc deleteMessage: an administrator of a group",
|
|
1021
|
+
"example": "deleteMessage#doc deleteMessage: an administrator of a group",
|
|
1022
|
+
"method": "POST",
|
|
1023
|
+
"path": "/bot{token}/deleteMessage",
|
|
1024
|
+
"body": {
|
|
1025
|
+
"chat_id": "{group}",
|
|
1026
|
+
"message_id": "{marta_post}"
|
|
1027
|
+
},
|
|
1028
|
+
"status": 200,
|
|
1029
|
+
"expect": [
|
|
1030
|
+
{
|
|
1031
|
+
"path": "result",
|
|
1032
|
+
"equals": true
|
|
1033
|
+
}
|
|
1034
|
+
]
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
"name": "Setup: the bot posts in the group",
|
|
1038
|
+
"method": "POST",
|
|
1039
|
+
"path": "/bot{token}/sendMessage",
|
|
1040
|
+
"body": {
|
|
1041
|
+
"chat_id": "{group}",
|
|
1042
|
+
"text": "Notes are on."
|
|
1043
|
+
},
|
|
1044
|
+
"status": 200,
|
|
1045
|
+
"capture": {
|
|
1046
|
+
"own_post": "result.message_id"
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"name": "deleteMessage#doc deleteMessage: outgoing in a group",
|
|
1051
|
+
"example": "deleteMessage#doc deleteMessage: outgoing in a group",
|
|
1052
|
+
"method": "POST",
|
|
1053
|
+
"path": "/bot{token}/deleteMessage",
|
|
1054
|
+
"body": {
|
|
1055
|
+
"chat_id": "{group}",
|
|
1056
|
+
"message_id": "{own_post}"
|
|
1057
|
+
},
|
|
1058
|
+
"status": 200,
|
|
1059
|
+
"expect": [
|
|
1060
|
+
{
|
|
1061
|
+
"path": "result",
|
|
1062
|
+
"equals": true
|
|
1063
|
+
}
|
|
1064
|
+
]
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
"name": "sendMessage#doc Formatting options: a mention by id",
|
|
1068
|
+
"example": "sendMessage#doc Formatting options: a mention by id",
|
|
1069
|
+
"method": "POST",
|
|
1070
|
+
"path": "/bot{token}/sendMessage",
|
|
1071
|
+
"body": {
|
|
1072
|
+
"chat_id": "{group}",
|
|
1073
|
+
"text": "<a href=\"tg://user?id={marta}\">Marta</a>, the notes from Monday are up.",
|
|
1074
|
+
"parse_mode": "HTML"
|
|
1075
|
+
},
|
|
1076
|
+
"status": 200,
|
|
1077
|
+
"expect": [
|
|
1078
|
+
{
|
|
1079
|
+
"path": "result.text",
|
|
1080
|
+
"equals": "Marta, the notes from Monday are up."
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"path": "result.entities.0.type",
|
|
1084
|
+
"equals": "text_mention"
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
"path": "result.entities.0.offset",
|
|
1088
|
+
"equals": 0
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
"path": "result.entities.0.length",
|
|
1092
|
+
"equals": 5
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"path": "result.entities.0.user.id",
|
|
1096
|
+
"equals": "{marta}"
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
"path": "result.entities.0.user.first_name",
|
|
1100
|
+
"equals": "Marta"
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"path": "result.entities.0.user.username",
|
|
1104
|
+
"equals": "marta_s"
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
"path": "result.from.first_name",
|
|
1108
|
+
"equals": "Rui Notes"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"path": "result.from.username",
|
|
1112
|
+
"equals": "rui_notes_bot"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"path": "result.chat.title",
|
|
1116
|
+
"equals": "Rui and Marta"
|
|
1117
|
+
}
|
|
1118
|
+
]
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
"name": "Setup: Rui makes a public channel, @rui_notes_news",
|
|
1122
|
+
"method": "POST",
|
|
1123
|
+
"path": "/_twin/chats",
|
|
1124
|
+
"body": {
|
|
1125
|
+
"creator": "{rui}",
|
|
1126
|
+
"type": "channel",
|
|
1127
|
+
"title": "Rui Notes",
|
|
1128
|
+
"username": "rui_notes_news"
|
|
1129
|
+
},
|
|
1130
|
+
"status": 200,
|
|
1131
|
+
"capture": {
|
|
1132
|
+
"channel": "id"
|
|
1133
|
+
}
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
"name": "Setup: ...the bot an administrator",
|
|
1137
|
+
"method": "POST",
|
|
1138
|
+
"path": "/_twin/chats/{channel}/members",
|
|
1139
|
+
"body": {
|
|
1140
|
+
"by": "{rui}",
|
|
1141
|
+
"user": "{bot}",
|
|
1142
|
+
"status": "administrator",
|
|
1143
|
+
"rights": {
|
|
1144
|
+
"can_post_messages": true,
|
|
1145
|
+
"can_delete_messages": true
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
"status": 200
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
"name": "deleteMessage#doc deleteMessage: a channel's creation",
|
|
1152
|
+
"example": "deleteMessage#doc deleteMessage: a channel's creation",
|
|
1153
|
+
"method": "POST",
|
|
1154
|
+
"path": "/bot{token}/deleteMessage",
|
|
1155
|
+
"body": {
|
|
1156
|
+
"chat_id": "{channel}",
|
|
1157
|
+
"message_id": 1
|
|
1158
|
+
},
|
|
1159
|
+
"status": 400,
|
|
1160
|
+
"expect": [
|
|
1161
|
+
{
|
|
1162
|
+
"path": "description",
|
|
1163
|
+
"equals": "Bad Request: message can't be deleted"
|
|
1164
|
+
}
|
|
1165
|
+
]
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"name": "sendMessage#doc sendMessage: a channel's username",
|
|
1169
|
+
"example": "sendMessage#doc sendMessage: a channel's username",
|
|
1170
|
+
"method": "POST",
|
|
1171
|
+
"path": "/bot{token}/sendMessage",
|
|
1172
|
+
"body": {
|
|
1173
|
+
"chat_id": "@rui_notes_news",
|
|
1174
|
+
"text": "The notes channel is open."
|
|
1175
|
+
},
|
|
1176
|
+
"status": 200,
|
|
1177
|
+
"expect": [
|
|
1178
|
+
{
|
|
1179
|
+
"path": "result.chat.id",
|
|
1180
|
+
"equals": "{channel}"
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
"path": "result.chat.username",
|
|
1184
|
+
"equals": "rui_notes_news"
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
"path": "result.text",
|
|
1188
|
+
"equals": "The notes channel is open."
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"path": "result.sender_chat.title",
|
|
1192
|
+
"equals": "Rui Notes"
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
"path": "result.chat.title",
|
|
1196
|
+
"equals": "Rui Notes"
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
"path": "result.sender_chat.username",
|
|
1200
|
+
"equals": "rui_notes_news"
|
|
1201
|
+
}
|
|
1202
|
+
]
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"name": "Setup: the bot posts a screenshot of the notes in the channel",
|
|
1206
|
+
"method": "POST",
|
|
1207
|
+
"path": "/bot{token}/sendPhoto",
|
|
1208
|
+
"form": {
|
|
1209
|
+
"parts": [
|
|
1210
|
+
{
|
|
1211
|
+
"name": "chat_id",
|
|
1212
|
+
"value": "{channel}"
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
"name": "photo",
|
|
1216
|
+
"filename": "notes.png",
|
|
1217
|
+
"type": "image/png",
|
|
1218
|
+
"base64": "iVBORw0KGgoAAAANSUhEUgAAAUAAAADICAIAAAAWZq/8AAAEq0lEQVR42u3az0uUWxzA4TM/sImoMWgWQWCStBSilFoJ6kJc6EpQCkKMIf0bpEVLo40oSD8coU20kCIXQstq1VJdKLiIlKSUECzogK93MRDDzNxul+69WPd5VnJ455yv8n70HTUVYwzAryntSwACBgQMCBgEDAgYEDAgYBAwIGBAwCBgQMCAgAEBg4ABAQMCBgQMAgYEDAgYBAwIGBAwIGAQMCBgQMCAgEHAgIABAYOAAQEDAgYEDAIGBAwIGAQMCBgQMCBgEDAgYEDAgIBBwICAAQGDgAEBAwIGBAwCBgQMCBgQMAgYEDAgYBAwIGBAwICAQcCAgAEBAwIGAQMCBgQMAgYEDAgYEDAIGBAwIGAQMCBgQMCAgEHAgIABAQMCBgEDAgYEDAL+t0xMTBzOT75QKPy6w0MIIRVj/A86+fjx4+EM+C8HO7TDwz/wE7hQKNy6daurq+vixYvPnj0LIWxtbfX19XV2dvb19W1tbd2+fXtvb6+3t/fTp0/Xr1/v6enp7Ox88+ZNCGF6erqtra29vf3Fixfl3SpXtre3BwYGuru7e3t7P3z4UD7rxo0bU1NTtVvVrtSdrfbE8gUXLlz4/vBuFA6p+HOOHj16586d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
"capture": {
|
|
1224
|
+
"notes_photo": "result.photo.0.file_id",
|
|
1225
|
+
"notes_unique": "result.photo.0.file_unique_id"
|
|
1226
|
+
},
|
|
1227
|
+
"expect": [
|
|
1228
|
+
{
|
|
1229
|
+
"path": "result.photo.1",
|
|
1230
|
+
"exists": false
|
|
1231
|
+
}
|
|
1232
|
+
]
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
"name": "sendPhoto#doc sendPhoto: a file_id",
|
|
1236
|
+
"example": "sendPhoto#doc sendPhoto: a file_id",
|
|
1237
|
+
"method": "POST",
|
|
1238
|
+
"path": "/bot{token}/sendPhoto",
|
|
1239
|
+
"body": {
|
|
1240
|
+
"chat_id": "{rui_chat}",
|
|
1241
|
+
"photo": "{notes_photo}"
|
|
1242
|
+
},
|
|
1243
|
+
"status": 200,
|
|
1244
|
+
"undecided": {
|
|
1245
|
+
"result.photo.0.file_id": "a resent file may answer another valid file_id; the twin answers the one sent, which only coincides (Sending files: \"a file can have different valid file_ids even for the same bot\")"
|
|
1246
|
+
},
|
|
1247
|
+
"expect": [
|
|
1248
|
+
{
|
|
1249
|
+
"path": "result.photo.0.file_unique_id",
|
|
1250
|
+
"equals": "{notes_unique}"
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
"path": "result.photo.1",
|
|
1254
|
+
"exists": false
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
"path": "result.from.first_name",
|
|
1258
|
+
"equals": "Rui Notes"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
"path": "result.from.username",
|
|
1262
|
+
"equals": "rui_notes_bot"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"path": "result.chat.username",
|
|
1266
|
+
"equals": "rui_matos"
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
"path": "result.chat.first_name",
|
|
1270
|
+
"equals": "Rui"
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
"path": "result.chat.last_name",
|
|
1274
|
+
"equals": "Matos"
|
|
1275
|
+
}
|
|
1276
|
+
]
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
"name": "sendDocument#doc Sending files: a file keeps its type",
|
|
1280
|
+
"example": "sendDocument#doc Sending files: a file keeps its type",
|
|
1281
|
+
"method": "POST",
|
|
1282
|
+
"path": "/bot{token}/sendDocument",
|
|
1283
|
+
"body": {
|
|
1284
|
+
"chat_id": "{rui_chat}",
|
|
1285
|
+
"document": "{notes_photo}"
|
|
1286
|
+
},
|
|
1287
|
+
"status": 400,
|
|
1288
|
+
"expect": [
|
|
1289
|
+
{
|
|
1290
|
+
"path": "description",
|
|
1291
|
+
"equals": "Bad Request: can't use file of type Photo as Document"
|
|
1292
|
+
}
|
|
1293
|
+
]
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
"name": "Setup: Marta makes a bot of her own with BotFather",
|
|
1297
|
+
"method": "POST",
|
|
1298
|
+
"path": "/_twin/bots",
|
|
1299
|
+
"body": {
|
|
1300
|
+
"owner": "{marta}",
|
|
1301
|
+
"name": "Marta Helper",
|
|
1302
|
+
"username": "marta_helper_bot"
|
|
1303
|
+
},
|
|
1304
|
+
"status": 200,
|
|
1305
|
+
"capture": {
|
|
1306
|
+
"marta_token": "token"
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"name": "Setup: ...starts it",
|
|
1311
|
+
"method": "POST",
|
|
1312
|
+
"path": "/_twin/messages",
|
|
1313
|
+
"body": {
|
|
1314
|
+
"from": "{marta}",
|
|
1315
|
+
"chat": "@marta_helper_bot",
|
|
1316
|
+
"text": "/start"
|
|
1317
|
+
},
|
|
1318
|
+
"status": 200,
|
|
1319
|
+
"capture": {
|
|
1320
|
+
"marta_chat": "chat.id"
|
|
1321
|
+
}
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
"name": "sendPhoto#doc Sending files: a file_id is one bot's",
|
|
1325
|
+
"example": "sendPhoto#doc Sending files: a file_id is one bot's",
|
|
1326
|
+
"method": "POST",
|
|
1327
|
+
"path": "/bot{marta_token}/sendPhoto",
|
|
1328
|
+
"body": {
|
|
1329
|
+
"chat_id": "{marta_chat}",
|
|
1330
|
+
"photo": "{notes_photo}"
|
|
1331
|
+
},
|
|
1332
|
+
"status": 400,
|
|
1333
|
+
"expect": [
|
|
1334
|
+
{
|
|
1335
|
+
"path": "description",
|
|
1336
|
+
"equals": "Bad Request: wrong file identifier/HTTP URL specified"
|
|
1337
|
+
}
|
|
1338
|
+
]
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"name": "sendMessage#doc ChatMemberLeft: a bot not in a channel",
|
|
1342
|
+
"example": "sendMessage#doc ChatMemberLeft: a bot not in a channel",
|
|
1343
|
+
"method": "POST",
|
|
1344
|
+
"path": "/bot{marta_token}/sendMessage",
|
|
1345
|
+
"body": {
|
|
1346
|
+
"chat_id": "@rui_notes_news",
|
|
1347
|
+
"text": "Hello from Marta Helper"
|
|
1348
|
+
},
|
|
1349
|
+
"status": 403,
|
|
1350
|
+
"expect": [
|
|
1351
|
+
{
|
|
1352
|
+
"path": "description",
|
|
1353
|
+
"equals": "Forbidden: bot is not a member of the channel chat"
|
|
1354
|
+
}
|
|
1355
|
+
]
|
|
1356
|
+
},
|
|
1357
|
+
{
|
|
1358
|
+
"name": "Setup: Rui makes a private channel for drafts",
|
|
1359
|
+
"method": "POST",
|
|
1360
|
+
"path": "/_twin/chats",
|
|
1361
|
+
"body": {
|
|
1362
|
+
"creator": "{rui}",
|
|
1363
|
+
"type": "channel",
|
|
1364
|
+
"title": "Rui Drafts"
|
|
1365
|
+
},
|
|
1366
|
+
"status": 200,
|
|
1367
|
+
"capture": {
|
|
1368
|
+
"drafts": "id"
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"name": "Setup: ...the bot an administrator without the right to post",
|
|
1373
|
+
"method": "POST",
|
|
1374
|
+
"path": "/_twin/chats/{drafts}/members",
|
|
1375
|
+
"body": {
|
|
1376
|
+
"by": "{rui}",
|
|
1377
|
+
"user": "{bot}",
|
|
1378
|
+
"status": "administrator",
|
|
1379
|
+
"rights": {
|
|
1380
|
+
"can_post_messages": false
|
|
1381
|
+
}
|
|
1382
|
+
},
|
|
1383
|
+
"status": 200,
|
|
1384
|
+
"expect": [
|
|
1385
|
+
{
|
|
1386
|
+
"path": "can_post_messages",
|
|
1387
|
+
"equals": false
|
|
1388
|
+
}
|
|
1389
|
+
]
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
"name": "sendMessage#doc ChatMemberAdministrator: posting in a channel",
|
|
1393
|
+
"example": "sendMessage#doc ChatMemberAdministrator: posting in a channel",
|
|
1394
|
+
"method": "POST",
|
|
1395
|
+
"path": "/bot{token}/sendMessage",
|
|
1396
|
+
"body": {
|
|
1397
|
+
"chat_id": "{drafts}",
|
|
1398
|
+
"text": "Draft: the March update"
|
|
1399
|
+
},
|
|
1400
|
+
"status": 400,
|
|
1401
|
+
"expect": [
|
|
1402
|
+
{
|
|
1403
|
+
"path": "description",
|
|
1404
|
+
"equals": "Bad Request: need administrator rights in the channel chat"
|
|
1405
|
+
}
|
|
1406
|
+
]
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "Setup: Rui removes the bot from the drafts channel",
|
|
1410
|
+
"method": "POST",
|
|
1411
|
+
"path": "/_twin/chats/{drafts}/members",
|
|
1412
|
+
"body": {
|
|
1413
|
+
"by": "{rui}",
|
|
1414
|
+
"user": "{bot}",
|
|
1415
|
+
"status": "kicked"
|
|
1416
|
+
},
|
|
1417
|
+
"status": 200,
|
|
1418
|
+
"expect": [
|
|
1419
|
+
{
|
|
1420
|
+
"path": "status",
|
|
1421
|
+
"equals": "kicked"
|
|
1422
|
+
}
|
|
1423
|
+
]
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
"name": "getChat#doc ChatMemberBanned: a banned bot",
|
|
1427
|
+
"example": "getChat#doc ChatMemberBanned: a banned bot",
|
|
1428
|
+
"method": "POST",
|
|
1429
|
+
"path": "/bot{token}/getChat",
|
|
1430
|
+
"body": {
|
|
1431
|
+
"chat_id": "{drafts}"
|
|
1432
|
+
},
|
|
1433
|
+
"status": 403,
|
|
1434
|
+
"expect": [
|
|
1435
|
+
{
|
|
1436
|
+
"path": "description",
|
|
1437
|
+
"equals": "Forbidden: bot was kicked from the channel chat"
|
|
1438
|
+
}
|
|
1439
|
+
]
|
|
1440
|
+
},
|
|
1441
|
+
{
|
|
1442
|
+
"name": "sendMediaGroup#doc sendMediaGroup: documents with their own type only",
|
|
1443
|
+
"example": "sendMediaGroup#doc sendMediaGroup: documents with their own type only",
|
|
1444
|
+
"method": "POST",
|
|
1445
|
+
"path": "/bot{token}/sendMediaGroup",
|
|
1446
|
+
"form": {
|
|
1447
|
+
"parts": [
|
|
1448
|
+
{
|
|
1449
|
+
"name": "chat_id",
|
|
1450
|
+
"value": "{channel}"
|
|
1451
|
+
},
|
|
1452
|
+
{
|
|
1453
|
+
"name": "media",
|
|
1454
|
+
"value": "[{\"type\": \"photo\", \"media\": \"attach://shot\"}, {\"type\": \"document\", \"media\": \"attach://notes\"}]"
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"name": "shot",
|
|
1458
|
+
"filename": "notes.png",
|
|
1459
|
+
"type": "image/png",
|
|
1460
|
+
"base64": "iVBORw0KGgoAAAANSUhEUgAAAUAAAADICAIAAAAWZq/8AAAEq0lEQVR42u3az0uUWxzA4TM/sImoMWgWQWCStBSilFoJ6kJc6EpQCkKMIf0bpEVLo40oSD8coU20kCIXQstq1VJdKLiIlKSUECzogK93MRDDzNxul+69WPd5VnJ455yv8n70HTUVYwzAryntSwACBgQMCBgEDAgYEDAgYBAwIGBAwCBgQMCAgAEBg4ABAQMCBgQMAgYEDAgYBAwIGBAwIGAQMCBgQMCAgEHAgIABAYOAAQEDAgYEDAIGBAwIG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": [
|
|
1472
|
+
{
|
|
1473
|
+
"path": "description",
|
|
1474
|
+
"equals": "Bad Request: document can't be mixed with other media types"
|
|
1475
|
+
}
|
|
1476
|
+
]
|
|
1477
|
+
},
|
|
1478
|
+
{
|
|
1479
|
+
"name": "sendPhoto#doc sendPhoto: width and height ratio",
|
|
1480
|
+
"example": "sendPhoto#doc sendPhoto: width and height ratio",
|
|
1481
|
+
"method": "POST",
|
|
1482
|
+
"path": "/bot{token}/sendPhoto",
|
|
1483
|
+
"form": {
|
|
1484
|
+
"parts": [
|
|
1485
|
+
{
|
|
1486
|
+
"name": "chat_id",
|
|
1487
|
+
"value": "{channel}"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"name": "photo",
|
|
1491
|
+
"filename": "banner.png",
|
|
1492
|
+
"type": "image/png",
|
|
1493
|
+
"base64": "iVBORw0KGgoAAAANSUhEUgAACDQAAABkCAIAAAD8V2UOAAAKd0lEQVR42u3daXSU1R3A4f9MEsih1H2rUBYxKEQDLiBEbeOCLAVBVKQuqDTFrdVaWw6opXVD21Jc0dYFtRi3elCoS0DEBatApKUeDYttBbUe69aALCEJST9MnU5nktFzXI62z/NpeJd773sHvsyPSRJ1dXUBAAAAAADweUnaAgAAAAAAIMQJAAAAAAAgxAkAAAAAAIAQJwAAAAAAgBAnAAAAAAAAQpwAAAAAAABCnAAAAAAAAEKcAAAAAAAACHECAAAAAAAIcQIAAAAAACDECQAAAAAAIMQJAAAAAACAECcAAAAAAIAQJwAAAAAAgBAnAAAAAAAAQpwAAAAAAABCnAAAAAAAAAhxAgAAAAAACHECAAAAAAAIcQIAAAAAACDECQAAAAAAIMQJAAAAAACAECcAAAAAAIAQJwAAAAAAAEKcAAAAAAAAQpwAAAAAAABCnAAAAAAAAAhxAgAAAAAACHECAAAAAAAgxAkAAAAAACDECQAAAAAAIMQJAAAAAACAECcAAAAAAIAQJwAAAAAAAEKcAAAAAAAAQpwAAAAAAAAIcQIAAAAAAAhxAgAAAAAACHEC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DWx2hrTGTicT13ztu5JSbe3fdtW+Pzt1323HGnGfOGfmNbx20z0/vfGziCUd+/BWm7s09NW5Q//Q+tC8qPGL/nkdPubmlueW80RVHHbB35sVf7VCceTZr0otOHPzjmx+qeqKmQ/t2084YlXU2/72ZMteTel/ST51+kbqy/95dx0+rmjp+RJ4nyvPOfvwlAQAAAADwZZSoq6uzC5+iN99bd8FvHrznwtNsBQAAAAAAxOf5zYn/T48vWzn9gYXTzvA7EgAAAAAAIHxzAgAAAAAAiP/lX4gNAAAAAAAQ4gQAAAAAABDiBAAAAAAAEOIEAAAAAABAiBMAAAAAAECIEwAAAAAAACFOAAAAAAAAIU4AAAAAAACEOAEAAAAAAIQ4AQAAAAAAhDgBAAAAAAAQ4gQAAAAAABDiBAAAAAAAQIgTAAAAAABAiBMAAAAAAECIEwAAAAAAACFOAAAAAAAAIU4AAAAAAACEOAEAAAAAAIQ4AQAAAAAAEOIEAAAAAAAQ4gQAAAAAABDiBAAAAAAAQIgTAAAAAABAiBMAAAAAAAAhTgAAAAAAACFOAAAAAAAAIU4AAAAAAACEOAEAAAAAAIQ4AQAAAAAAEOIEAAAAAAAQ4gQAAAAAAECIEwAAAAAAQIgTAAAAAABAiBMAAAAAAAAhTgAAAAAAACFOAAAAAAAAhDgBAAAAAACEOAEAAAAAAIQ4AQAAAAAAEOIEAAAAAAAQ4gQAAAAAAECIEwAAAAAAQIgTAAAAAAAAIU4AAAAAAAAhTgAAAAAAACFOAAAAAAAAfEb+Bahk77O4AIG2AAAAAElFTkSuQmCC"
|
|
1494
|
+
}
|
|
1495
|
+
]
|
|
1496
|
+
},
|
|
1497
|
+
"status": 400,
|
|
1498
|
+
"expect": [
|
|
1499
|
+
{
|
|
1500
|
+
"path": "description",
|
|
1501
|
+
"equals": "Bad Request: PHOTO_INVALID_DIMENSIONS"
|
|
1502
|
+
}
|
|
1503
|
+
]
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"name": "sendPhoto#doc sendPhoto: a file Telegram cannot process as an image",
|
|
1507
|
+
"example": "sendPhoto#doc sendPhoto: a file Telegram cannot process as an image",
|
|
1508
|
+
"method": "POST",
|
|
1509
|
+
"path": "/bot{token}/sendPhoto",
|
|
1510
|
+
"form": {
|
|
1511
|
+
"parts": [
|
|
1512
|
+
{
|
|
1513
|
+
"name": "chat_id",
|
|
1514
|
+
"value": "{channel}"
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"name": "photo",
|
|
1518
|
+
"filename": "notes.pdf",
|
|
1519
|
+
"type": "application/pdf",
|
|
1520
|
+
"base64": "JVBERi0xLjQKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDE+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9NZWRpYUJveFswIDAgNjEyIDc5Ml0vQ29udGVudHMgNCAwIFIvUmVzb3VyY2VzPDwvRm9udDw8L0YxIDUgMCBSPj4+Pj4+ZW5kb2JqCjQgMCBvYmo8PC9MZW5ndGggOTU+PnN0cmVhbQpCVCAvRjEgMTggVGYgNzIgNzIwIFRkIChUaWRlOiBzaGlwcGluZyB3ZWVrbHkgcmVsZWFzZXMgd2l0aCBhIHR3by1wZXJzb24gdGVhbSkgVGogRVQKZW5kc3RyZWFtIGVuZG9iago1IDAgb2JqPDwvVHlwZS9Gb250L1N1YnR5cGUvVHlwZTEvQmFzZUZvbnQvSGVsdmV0aWNhPj5lbmRvYmoKdHJhaWxlcjw8L1Jvb3QgMSAwIFI+PgolJUVPRgo="
|
|
1521
|
+
}
|
|
1522
|
+
]
|
|
1523
|
+
},
|
|
1524
|
+
"status": 400,
|
|
1525
|
+
"expect": [
|
|
1526
|
+
{
|
|
1527
|
+
"path": "description",
|
|
1528
|
+
"equals": "Bad Request: IMAGE_PROCESS_FAILED"
|
|
1529
|
+
}
|
|
1530
|
+
]
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
"name": "Setup: Wednesday 7 January, 10:00, 49 hours after the HTML message",
|
|
1534
|
+
"wait": "49h"
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"name": "deleteMessage#doc deleteMessage: 48 hours",
|
|
1538
|
+
"example": "deleteMessage#doc deleteMessage: 48 hours",
|
|
1539
|
+
"method": "POST",
|
|
1540
|
+
"path": "/bot{token}/deleteMessage",
|
|
1541
|
+
"body": {
|
|
1542
|
+
"chat_id": "{rui_chat}",
|
|
1543
|
+
"message_id": "{html_message}"
|
|
1544
|
+
},
|
|
1545
|
+
"status": 400,
|
|
1546
|
+
"expect": [
|
|
1547
|
+
{
|
|
1548
|
+
"path": "description",
|
|
1549
|
+
"equals": "Bad Request: message can't be deleted"
|
|
1550
|
+
}
|
|
1551
|
+
]
|
|
1552
|
+
}
|
|
1553
|
+
]
|
|
1554
|
+
}
|