iobroker.telegram 5.0.2 → 5.0.5
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/README.md +8 -9
- package/admin/blockly.js +904 -703
- package/admin/custom/assets/Components-RFUcDWVw.js +1 -0
- package/admin/custom/assets/{TelegramComponent-B2NWSbGI.js → TelegramComponent-BlbzWnGf.js} +1 -1
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomTelegramSet__mf_owner__1-CYGgKKbw.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-DISCS45R.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-vHx8blec.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DjTnAwP3.js +1217 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-BN6j8j6d.js +1494 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B1a-3_fw.js +9 -0
- package/admin/custom/assets/hostInit-BNe6sh6V.js +1 -0
- package/admin/custom/assets/{index-mc307YJJ.js → index-LrXX-mmr.js} +1 -1
- package/admin/custom/assets/{lib-DrMMUYBG.js → lib-RwYXypgP.js} +2 -2
- package/admin/custom/assets/{mf-entry-bootstrap-0-7aced7b2.js → mf-entry-bootstrap-0-6511586c.js} +7 -2
- package/admin/custom/assets/virtualExposes-D9ldD81W.js +1 -0
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomTelegramSet__customComponents_js-DrQPTDkD.js +1 -0
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomTelegramSet__customComponents_js-CVExw4BU.js +2 -0
- package/admin/custom/customComponents.js +12 -1
- package/admin/rules/@mf-types.zip +0 -0
- package/admin/rules/assets/{ActionTelegram-DT4ZdmnH.js → ActionTelegram-DeJ5nvxQ.js} +1 -1
- package/admin/rules/assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-5RXQO0YV.js +1 -0
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-N4zW9PCa.js +1187 -0
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DP0XECBz.js +9 -0
- package/admin/rules/assets/{bootstrap-DkRK1rmm.js → bootstrap-Dmf2iLIl.js} +1 -1
- package/admin/rules/assets/dist-DPGjdSM2.js +4 -0
- package/admin/rules/assets/hostInit-DwUKqg5g.js +1 -0
- package/admin/rules/assets/{index-CSUxJu3H.js → index-C1RI8GmH.js} +2 -2
- package/admin/rules/assets/{mf-entry-bootstrap-0-e99f43b5.js → mf-entry-bootstrap-0-ea9c1b7d.js} +7 -2
- package/admin/rules/assets/{virtualExposes-oJO8jZih.js → virtualExposes-CNNdiEV7.js} +1 -1
- package/admin/rules/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-CkqQUQPA.js +1 -0
- package/admin/rules/assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-DmBGDihA.js +2 -0
- package/admin/rules/customRuleBlocks.js +12 -1
- package/admin/rules/index.html +2 -2
- package/admin/rules/mf-manifest.json +1 -1
- package/admin/rules/mf-stats.json +1 -1
- package/build/main.js +26 -5
- package/build/main.js.map +1 -1
- package/io-package.json +27 -14
- package/package.json +10 -7
- package/admin/custom/assets/Components-BPb4U2ux.js +0 -1
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomTelegramSet__mf_owner__1-C5FjfPSF.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-ffNJqDHH.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-DljvyjSM.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-BPr09WB7.js +0 -1243
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-7tOzTXDd.js +0 -1494
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-DTpb_EpK.js +0 -9
- package/admin/custom/assets/hostInit-CA0CeAYu.js +0 -1
- package/admin/custom/assets/virtualExposes-B2RF6pfj.js +0 -1
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomTelegramSet__customComponents_js-Bvox5IIB.js +0 -1
- package/admin/custom/assets/virtual_mf-exposes-ssr___mfe_internal__ConfigCustomTelegramSet__customComponents_js-EnDnmCdS.js +0 -2
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomTelegramSet__customComponents_js-CVmxheYM.js +0 -2
- package/admin/rules/assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BlWjokQ7.js +0 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-BMRgH2Bz.js +0 -1213
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CL8n1_X7.js +0 -9
- package/admin/rules/assets/dist-PnYvbzKY.js +0 -4
- package/admin/rules/assets/hostInit-CZrk7GFX.js +0 -1
- package/admin/rules/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-CbJMsNQ0.js +0 -1
- package/admin/rules/assets/virtual_mf-exposes-ssr___mfe_internal__ActionTelegram__customRuleBlocks_js-CbR3ExBo.js +0 -2
- package/admin/rules/assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-BEjoGfOy.js +0 -2
- package/admin/rules/customRuleBlocks.ssr.js +0 -1
package/admin/blockly.js
CHANGED
|
@@ -1,703 +1,904 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.appendDummyInput(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.appendDummyInput(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
this.setInputsInline(false);
|
|
112
|
-
this.setPreviousStatement(true, null);
|
|
113
|
-
this.setNextStatement(true, null);
|
|
114
|
-
|
|
115
|
-
this.
|
|
116
|
-
this.
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
`
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
this.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
.
|
|
327
|
-
.appendField(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
`
|
|
361
|
-
(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
this.
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
1
|
+
// GENERATED FILE - do not edit.
|
|
2
|
+
// Source: src-blockly/blockly.ts - rebuild with `npm run build:blockly`.
|
|
3
|
+
"use strict";
|
|
4
|
+
(() => {
|
|
5
|
+
// src-blockly/helpers.ts
|
|
6
|
+
var Blockly = window.Blockly;
|
|
7
|
+
function instanceOptions() {
|
|
8
|
+
const options = [[Blockly.Translate("telegram_anyInstance"), ""]];
|
|
9
|
+
const instances = window.main?.instances;
|
|
10
|
+
if (instances) {
|
|
11
|
+
for (let i = 0; i < instances.length; i++) {
|
|
12
|
+
const m = instances[i].match(/^system\.adapter\.telegram\.(\d+)$/);
|
|
13
|
+
if (m) {
|
|
14
|
+
const n = parseInt(m[1], 10);
|
|
15
|
+
options.push([`telegram.${n}`, `.${n}`]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (options.length === 1) {
|
|
20
|
+
for (let n = 0; n <= 4; n++) {
|
|
21
|
+
options.push([`telegram.${n}`, `.${n}`]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return options;
|
|
25
|
+
}
|
|
26
|
+
function logLevelOptions() {
|
|
27
|
+
return [
|
|
28
|
+
[Blockly.Translate("telegram_log_none"), ""],
|
|
29
|
+
[Blockly.Translate("telegram_log_debug"), "debug"],
|
|
30
|
+
[Blockly.Translate("telegram_log_info"), "log"],
|
|
31
|
+
[Blockly.Translate("telegram_log_warn"), "warn"],
|
|
32
|
+
[Blockly.Translate("telegram_log_error"), "error"]
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
function parseModeOptions() {
|
|
36
|
+
return [
|
|
37
|
+
[Blockly.Translate("telegram_parsemode_default"), "default"],
|
|
38
|
+
["HTML", "HTML"],
|
|
39
|
+
["MarkdownV2", "MarkdownV2"]
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
function logLine(logLevel, prefix, username, text) {
|
|
43
|
+
if (!logLevel) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
const withUser = username ? `[' + ${username} + ']` : "";
|
|
47
|
+
return `console.${logLevel}('${prefix}${withUser}: '${text ? ` + ${text}` : ""});
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
function reconnectChild(connectionChild, block, inputName) {
|
|
51
|
+
if (!connectionChild?.getSourceBlock().workspace) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const connectionParent = block.getInput(inputName)?.connection;
|
|
55
|
+
if (!connectionParent) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
const currentParent = connectionChild.targetBlock();
|
|
59
|
+
if ((!currentParent || currentParent === block) && connectionParent.targetConnection !== connectionChild) {
|
|
60
|
+
if (connectionParent.isConnected()) {
|
|
61
|
+
connectionParent.disconnect();
|
|
62
|
+
}
|
|
63
|
+
connectionParent.connect(connectionChild);
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
function registerGenerator(type, generator) {
|
|
69
|
+
if (Blockly.JavaScript.forBlock) {
|
|
70
|
+
Blockly.JavaScript.forBlock[type] = generator;
|
|
71
|
+
} else {
|
|
72
|
+
Blockly.JavaScript[type] = generator;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src-blockly/blocks/telegram.ts
|
|
77
|
+
var Blockly2 = window.Blockly;
|
|
78
|
+
var ESCAPE_SUFFIX = ".replace(/([-_*\\[\\]()~`>#+=|{}.!])/g, '\\\\$1')";
|
|
79
|
+
function installTelegram() {
|
|
80
|
+
Blockly2.Sendto.blocks.telegram = `<block type="telegram">
|
|
81
|
+
<field name="INSTANCE"></field>
|
|
82
|
+
<field name="LOG"></field>
|
|
83
|
+
<field name="SILENT">FALSE</field>
|
|
84
|
+
<field name="PARSEMODE">default</field>
|
|
85
|
+
<field name="ESCAPING">FALSE</field>
|
|
86
|
+
<field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>
|
|
87
|
+
<value name="MESSAGE">
|
|
88
|
+
<shadow type="text">
|
|
89
|
+
<field name="TEXT">text</field>
|
|
90
|
+
</shadow>
|
|
91
|
+
</value>
|
|
92
|
+
</block>`;
|
|
93
|
+
Blockly2.Blocks.telegram = {
|
|
94
|
+
init: function() {
|
|
95
|
+
this.appendDummyInput("INSTANCE").appendField(Blockly2.Translate("telegram")).appendField(new Blockly2.FieldDropdown(instanceOptions()), "INSTANCE");
|
|
96
|
+
this.appendValueInput("MESSAGE").appendField(Blockly2.Translate("telegram_message"));
|
|
97
|
+
for (const [name, word] of [
|
|
98
|
+
["USERNAME", "telegram_username"],
|
|
99
|
+
["CHATID", "telegram_chatid"]
|
|
100
|
+
]) {
|
|
101
|
+
const input = this.appendValueInput(name).setCheck("String").appendField(Blockly2.Translate(word));
|
|
102
|
+
if (input.connection) {
|
|
103
|
+
input.connection._optional = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
this.appendDummyInput("LOG").appendField(Blockly2.Translate("telegram_log")).appendField(new Blockly2.FieldDropdown(logLevelOptions()), "LOG");
|
|
107
|
+
this.appendDummyInput("SILENT").appendField(Blockly2.Translate("telegram_silent")).appendField(new Blockly2.FieldCheckbox("FALSE"), "SILENT");
|
|
108
|
+
this.appendDummyInput("PARSEMODE").appendField("Parsemode").appendField(new Blockly2.FieldDropdown(parseModeOptions()), "PARSEMODE");
|
|
109
|
+
this.appendDummyInput("ESCAPING").appendField(Blockly2.Translate("telegram_escaping")).appendField(new Blockly2.FieldCheckbox("FALSE"), "ESCAPING");
|
|
110
|
+
this.appendDummyInput("DISABLE_WEB_PAGE_PREVIEW").appendField(Blockly2.Translate("telegram_disable_web_preview")).appendField(new Blockly2.FieldCheckbox("FALSE"), "DISABLE_WEB_PAGE_PREVIEW");
|
|
111
|
+
this.setInputsInline(false);
|
|
112
|
+
this.setPreviousStatement(true, null);
|
|
113
|
+
this.setNextStatement(true, null);
|
|
114
|
+
this.setColour(Blockly2.Sendto.HUE);
|
|
115
|
+
this.setTooltip(Blockly2.Translate("telegram_tooltip"));
|
|
116
|
+
this.setHelpUrl(Blockly2.Translate("telegram_help"));
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
registerGenerator("telegram", (block) => {
|
|
120
|
+
const instance = block.getFieldValue("INSTANCE");
|
|
121
|
+
const logLevel = block.getFieldValue("LOG");
|
|
122
|
+
const username = Blockly2.JavaScript.valueToCode(block, "USERNAME", Blockly2.JavaScript.ORDER_ATOMIC);
|
|
123
|
+
const chatId = Blockly2.JavaScript.valueToCode(block, "CHATID", Blockly2.JavaScript.ORDER_ATOMIC);
|
|
124
|
+
const silent = block.getFieldValue("SILENT");
|
|
125
|
+
const escaping = block.getFieldValue("ESCAPING");
|
|
126
|
+
const disableWebPagePreview = block.getFieldValue("DISABLE_WEB_PAGE_PREVIEW");
|
|
127
|
+
const parseMode = block.getFieldValue("PARSEMODE");
|
|
128
|
+
let text = Blockly2.JavaScript.valueToCode(block, "MESSAGE", Blockly2.JavaScript.ORDER_ATOMIC);
|
|
129
|
+
const logText = logLine(logLevel, "telegram", username, text);
|
|
130
|
+
if (text && escaping === "TRUE") {
|
|
131
|
+
text += ESCAPE_SUFFIX;
|
|
132
|
+
}
|
|
133
|
+
const lines = [`sendTo('telegram${instance}', 'send', {
|
|
134
|
+
`];
|
|
135
|
+
if (text) {
|
|
136
|
+
lines.push(` text: ${text},
|
|
137
|
+
`);
|
|
138
|
+
}
|
|
139
|
+
if (username) {
|
|
140
|
+
lines.push(` user: ${username},
|
|
141
|
+
`);
|
|
142
|
+
}
|
|
143
|
+
if (chatId) {
|
|
144
|
+
lines.push(` chatId: ${chatId},
|
|
145
|
+
`);
|
|
146
|
+
}
|
|
147
|
+
if (silent === "TRUE") {
|
|
148
|
+
lines.push(" disable_notification: true,\n");
|
|
149
|
+
}
|
|
150
|
+
if (disableWebPagePreview === "TRUE") {
|
|
151
|
+
lines.push(" disable_web_page_preview: true,\n");
|
|
152
|
+
}
|
|
153
|
+
if (parseMode !== "default") {
|
|
154
|
+
lines.push(` parse_mode: '${parseMode}',
|
|
155
|
+
`);
|
|
156
|
+
}
|
|
157
|
+
lines.push(`});
|
|
158
|
+
${logText}`);
|
|
159
|
+
return lines.join("");
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// src-blockly/blocks/telegramAsk.ts
|
|
164
|
+
var Blockly3 = window.Blockly;
|
|
165
|
+
var ALIGN_RIGHT = Blockly3.inputs?.Align.RIGHT ?? 1;
|
|
166
|
+
function installTelegramAsk() {
|
|
167
|
+
Blockly3.Sendto.blocks.telegram_ask = `<sep gap="5"></sep>
|
|
168
|
+
<block type="telegram_ask">
|
|
169
|
+
<mutation>
|
|
170
|
+
<answer id="ANSWER_0" name="yes"></answer>
|
|
171
|
+
</mutation>
|
|
172
|
+
<field name="INSTANCE"></field>
|
|
173
|
+
<field name="LOG"></field>
|
|
174
|
+
<field name="PARSEMODE">default</field>
|
|
175
|
+
<value name="QUESTION">
|
|
176
|
+
<shadow type="text">
|
|
177
|
+
<field name="TEXT">text</field>
|
|
178
|
+
</shadow>
|
|
179
|
+
</value>
|
|
180
|
+
<value name="ANSWER_0">
|
|
181
|
+
<shadow type="text">
|
|
182
|
+
<field name="TEXT">Yes, please</field>
|
|
183
|
+
</shadow>
|
|
184
|
+
</value>
|
|
185
|
+
</block>`;
|
|
186
|
+
Blockly3.Blocks.telegram_ask_container = {
|
|
187
|
+
init: function() {
|
|
188
|
+
this.setColour(Blockly3.Object.HUE);
|
|
189
|
+
this.appendDummyInput().appendField(Blockly3.Translate("telegram_ask_answers"));
|
|
190
|
+
this.appendStatementInput("STACK");
|
|
191
|
+
this.setTooltip(Blockly3.Translate("object_new_tooltip"));
|
|
192
|
+
this.contextMenu = false;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
Blockly3.Blocks.telegram_ask_mutator = {
|
|
196
|
+
init: function() {
|
|
197
|
+
this.setColour(Blockly3.Sendto.HUE);
|
|
198
|
+
this.appendDummyInput("ANSWER").appendField(Blockly3.Translate("telegram_ask_answer")).appendField(new Blockly3.FieldTextInput("okay"), "ANSWER");
|
|
199
|
+
this.setPreviousStatement(true);
|
|
200
|
+
this.setNextStatement(true);
|
|
201
|
+
this.setTooltip(Blockly3.Translate("telegram_ask_tooltip"));
|
|
202
|
+
this.contextMenu = false;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
Blockly3.Blocks.telegram_ask = {
|
|
206
|
+
init: function() {
|
|
207
|
+
this.answers_ = [];
|
|
208
|
+
this.itemCount_ = 0;
|
|
209
|
+
const self = this;
|
|
210
|
+
if (Blockly3.icons) {
|
|
211
|
+
this.setMutator(new Blockly3.icons.MutatorIcon(["telegram_ask_mutator"], self));
|
|
212
|
+
} else if (Blockly3.Mutator) {
|
|
213
|
+
this.setMutator(new Blockly3.Mutator(["telegram_ask_mutator"], self));
|
|
214
|
+
}
|
|
215
|
+
this.appendDummyInput("INSTANCE").appendField(Blockly3.Translate("telegram_ask")).appendField(new Blockly3.FieldDropdown(instanceOptions()), "INSTANCE");
|
|
216
|
+
this.appendValueInput("QUESTION").appendField(Blockly3.Translate("telegram_ask_question"));
|
|
217
|
+
for (const [name, word] of [
|
|
218
|
+
["USERNAME", "telegram_username"],
|
|
219
|
+
["CHATID", "telegram_chatid"]
|
|
220
|
+
]) {
|
|
221
|
+
const input = this.appendValueInput(name).setCheck("String").appendField(Blockly3.Translate(word));
|
|
222
|
+
if (input.connection) {
|
|
223
|
+
input.connection._optional = true;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
this.appendDummyInput("LOG").appendField(Blockly3.Translate("telegram_log")).appendField(new Blockly3.FieldDropdown(logLevelOptions()), "LOG");
|
|
227
|
+
this.appendDummyInput("PARSEMODE").appendField("Parsemode").appendField(new Blockly3.FieldDropdown(parseModeOptions()), "PARSEMODE");
|
|
228
|
+
this.setInputsInline(false);
|
|
229
|
+
this.setPreviousStatement(true, null);
|
|
230
|
+
this.setNextStatement(true, null);
|
|
231
|
+
this.setColour(Blockly3.Sendto.HUE);
|
|
232
|
+
this.setTooltip(Blockly3.Translate("telegram_tooltip"));
|
|
233
|
+
this.setHelpUrl(Blockly3.Translate("telegram_help"));
|
|
234
|
+
},
|
|
235
|
+
/** Stores the answers in the workspace XML */
|
|
236
|
+
mutationToDom: function() {
|
|
237
|
+
const container = document.createElement("mutation");
|
|
238
|
+
for (let i = 0; i < this.answers_.length; i++) {
|
|
239
|
+
const parameter = document.createElement("answer");
|
|
240
|
+
parameter.setAttribute("id", `ANSWER_${i}`);
|
|
241
|
+
parameter.setAttribute("name", this.answers_[i]);
|
|
242
|
+
container.appendChild(parameter);
|
|
243
|
+
}
|
|
244
|
+
return container;
|
|
245
|
+
},
|
|
246
|
+
/**
|
|
247
|
+
* Restores the answers from the workspace XML
|
|
248
|
+
*
|
|
249
|
+
* @param xmlElement
|
|
250
|
+
*/
|
|
251
|
+
domToMutation: function(xmlElement) {
|
|
252
|
+
this.answers_ = [];
|
|
253
|
+
for (let i = 0, childNode; childNode = xmlElement.childNodes[i]; i++) {
|
|
254
|
+
if (childNode.nodeName.toLowerCase() === "answer") {
|
|
255
|
+
this.answers_.push(childNode.getAttribute("name") || "");
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
this.itemCount_ = this.answers_.length;
|
|
259
|
+
this.updateShape_();
|
|
260
|
+
},
|
|
261
|
+
/**
|
|
262
|
+
* Builds the stack shown in the mutator dialog
|
|
263
|
+
*
|
|
264
|
+
* @param workspace
|
|
265
|
+
*/
|
|
266
|
+
decompose: function(workspace) {
|
|
267
|
+
const containerBlock = workspace.newBlock("telegram_ask_container");
|
|
268
|
+
containerBlock.initSvg();
|
|
269
|
+
let connection = containerBlock.getInput("STACK").connection;
|
|
270
|
+
for (let i = 0; i < this.itemCount_; i++) {
|
|
271
|
+
const itemBlock = workspace.newBlock("telegram_ask_mutator");
|
|
272
|
+
itemBlock.setFieldValue(this.answers_[i], "ANSWER");
|
|
273
|
+
itemBlock.initSvg();
|
|
274
|
+
connection.connect(itemBlock.previousConnection);
|
|
275
|
+
connection = itemBlock.nextConnection;
|
|
276
|
+
}
|
|
277
|
+
return containerBlock;
|
|
278
|
+
},
|
|
279
|
+
/**
|
|
280
|
+
* Applies what the mutator dialog was left in
|
|
281
|
+
*
|
|
282
|
+
* @param containerBlock
|
|
283
|
+
*/
|
|
284
|
+
compose: function(containerBlock) {
|
|
285
|
+
this.answers_ = [];
|
|
286
|
+
let itemBlock = containerBlock.getInputTargetBlock("STACK");
|
|
287
|
+
const connections = [];
|
|
288
|
+
while (itemBlock) {
|
|
289
|
+
this.answers_.push(itemBlock.getFieldValue("ANSWER"));
|
|
290
|
+
connections.push(itemBlock.valueConnection_);
|
|
291
|
+
itemBlock = itemBlock.nextConnection?.targetBlock() || null;
|
|
292
|
+
}
|
|
293
|
+
for (let k = 0; k < this.itemCount_; k++) {
|
|
294
|
+
const connection = this.getInput(`ANSWER_${k}`)?.connection?.targetConnection;
|
|
295
|
+
if (connection && !connections.includes(connection)) {
|
|
296
|
+
connection.disconnect();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
this.itemCount_ = connections.length;
|
|
300
|
+
this.updateShape_();
|
|
301
|
+
for (let i = 0; i < this.itemCount_; i++) {
|
|
302
|
+
reconnectChild(connections[i] ?? null, this, `ANSWER_${i}`);
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
/**
|
|
306
|
+
* Remembers what hangs on each answer input before the dialog rearranges things
|
|
307
|
+
*
|
|
308
|
+
* @param containerBlock
|
|
309
|
+
*/
|
|
310
|
+
saveConnections: function(containerBlock) {
|
|
311
|
+
let itemBlock = containerBlock.getInputTargetBlock("STACK");
|
|
312
|
+
let i = 0;
|
|
313
|
+
while (itemBlock) {
|
|
314
|
+
const input = this.getInput(`ANSWER_${i}`);
|
|
315
|
+
itemBlock.valueConnection_ = input?.connection?.targetConnection;
|
|
316
|
+
i++;
|
|
317
|
+
itemBlock = itemBlock.nextConnection?.targetBlock() || null;
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
/** Adds and removes the answer inputs so the block matches `itemCount_` */
|
|
321
|
+
updateShape_: function() {
|
|
322
|
+
const workspace = this.workspace;
|
|
323
|
+
for (let i = 0; i < this.itemCount_; i++) {
|
|
324
|
+
let input = this.getInput(`ANSWER_${i}`);
|
|
325
|
+
if (!input) {
|
|
326
|
+
input = this.appendValueInput(`ANSWER_${i}`).setAlign(ALIGN_RIGHT);
|
|
327
|
+
input.appendField(this.answers_[i]);
|
|
328
|
+
} else {
|
|
329
|
+
input.fieldRow[0].setValue(this.answers_[i]);
|
|
330
|
+
}
|
|
331
|
+
if (!this.getInput(`STATEMENT_${i}`)) {
|
|
332
|
+
this.appendStatementInput(`STATEMENT_${i}`);
|
|
333
|
+
}
|
|
334
|
+
setTimeout(
|
|
335
|
+
(__input) => {
|
|
336
|
+
if (!__input.connection?.isConnected()) {
|
|
337
|
+
const shadow = workspace.newBlock("text");
|
|
338
|
+
shadow.setShadow(true);
|
|
339
|
+
shadow.setFieldValue("text", "TEXT");
|
|
340
|
+
shadow.initSvg();
|
|
341
|
+
shadow.render();
|
|
342
|
+
shadow.outputConnection.connect(__input.connection);
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
100,
|
|
346
|
+
input
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
for (let i = this.itemCount_; this.getInput(`ANSWER_${i}`); i++) {
|
|
350
|
+
this.removeInput(`ANSWER_${i}`);
|
|
351
|
+
this.removeInput(`STATEMENT_${i}`);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
registerGenerator("telegram_ask", (block) => {
|
|
356
|
+
const askBlock = block;
|
|
357
|
+
const answers = [];
|
|
358
|
+
for (let id = 0; id < askBlock.itemCount_; id++) {
|
|
359
|
+
const answer = Blockly3.JavaScript.valueToCode(block, `ANSWER_${id}`, Blockly3.JavaScript.ORDER_ATOMIC);
|
|
360
|
+
const statement = Blockly3.JavaScript.statementToCode(block, `STATEMENT_${id}`);
|
|
361
|
+
if (answer && statement) {
|
|
362
|
+
answers.push({ id, answer, statement });
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const instance = block.getFieldValue("INSTANCE");
|
|
366
|
+
const logLevel = block.getFieldValue("LOG");
|
|
367
|
+
const parseMode = block.getFieldValue("PARSEMODE");
|
|
368
|
+
const question = Blockly3.JavaScript.valueToCode(block, "QUESTION", Blockly3.JavaScript.ORDER_ATOMIC);
|
|
369
|
+
const username = Blockly3.JavaScript.valueToCode(block, "USERNAME", Blockly3.JavaScript.ORDER_ATOMIC);
|
|
370
|
+
const chatId = Blockly3.JavaScript.valueToCode(block, "CHATID", Blockly3.JavaScript.ORDER_ATOMIC);
|
|
371
|
+
const logAnswer = logLevel ? ` console.${logLevel}('telegramAsk answer: ' + (msg?.data ?? '[no answer]'));
|
|
372
|
+
` : "";
|
|
373
|
+
const keyboard = answers.map((a) => ` [ { text: ${a.answer}, callback_data: '${a.id}' } ],`).join("\n");
|
|
374
|
+
const branches = answers.map(
|
|
375
|
+
(a) => ` if (msg?.data && msg.data == '${a.id}') {
|
|
376
|
+
${Blockly3.JavaScript.prefixLines(a.statement, Blockly3.JavaScript.INDENT)} }`
|
|
377
|
+
).join("\n");
|
|
378
|
+
const lines = [`sendTo('telegram${instance}', 'ask', {
|
|
379
|
+
`];
|
|
380
|
+
if (question) {
|
|
381
|
+
lines.push(` text: ${question},
|
|
382
|
+
`);
|
|
383
|
+
}
|
|
384
|
+
if (username) {
|
|
385
|
+
lines.push(` user: ${username},
|
|
386
|
+
`);
|
|
387
|
+
}
|
|
388
|
+
if (chatId) {
|
|
389
|
+
lines.push(` chatId: ${chatId},
|
|
390
|
+
`);
|
|
391
|
+
}
|
|
392
|
+
if (parseMode !== "default") {
|
|
393
|
+
lines.push(` parse_mode: '${parseMode}',
|
|
394
|
+
`);
|
|
395
|
+
}
|
|
396
|
+
lines.push(" reply_markup: {\n");
|
|
397
|
+
lines.push(" inline_keyboard: [\n");
|
|
398
|
+
lines.push(`${keyboard}
|
|
399
|
+
`);
|
|
400
|
+
lines.push(" ],\n");
|
|
401
|
+
lines.push(" }\n");
|
|
402
|
+
lines.push(`}, async (msg) => {
|
|
403
|
+
${logAnswer}`);
|
|
404
|
+
lines.push(branches);
|
|
405
|
+
lines.push(`
|
|
406
|
+
});
|
|
407
|
+
${logLine(logLevel, "telegramAsk", username, question)}`);
|
|
408
|
+
return lines.join("");
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src-blockly/voices.ts
|
|
413
|
+
var CALL_VOICES = [
|
|
414
|
+
["German (Germany) (Female)", "de-DE-Standard-A"],
|
|
415
|
+
["German (Germany) (Male)", "de-DE-Standard-B"],
|
|
416
|
+
["English (US) (Male)", "en-US-Standard-B"],
|
|
417
|
+
["English (US) (Female)", "en-US-Standard-C"],
|
|
418
|
+
["English (US) (Male 2)", "en-US-Standard-D"],
|
|
419
|
+
["English (US) (Female 2)", "en-US-Standard-E"],
|
|
420
|
+
["Russian (Russia) (Female)", "ru-RU-Standard-A"],
|
|
421
|
+
["Russian (Russia) (Male)", "ru-RU-Standard-B"],
|
|
422
|
+
["Russian (Russia) (Female 2)", "ru-RU-Standard-C"],
|
|
423
|
+
["Russian (Russia) (Male 2)", "ru-RU-Standard-D"],
|
|
424
|
+
["Arabic (Female)", "ar-XA-Standard-A"],
|
|
425
|
+
["Arabic (Male)", "ar-XA-Standard-B"],
|
|
426
|
+
["Arabic (Male 2)", "ar-XA-Standard-C"],
|
|
427
|
+
["Czech (Czech Republic) (Female)", "cs-CZ-Standard-A"],
|
|
428
|
+
["Danish (Denmark) (Female)", "da-DK-Standard-A"],
|
|
429
|
+
["Dutch (Netherlands) (Female)", "nl-NL-Standard-A"],
|
|
430
|
+
["Dutch (Netherlands) (Male)", "nl-NL-Standard-B"],
|
|
431
|
+
["Dutch (Netherlands) (Male 2)", "nl-NL-Standard-C"],
|
|
432
|
+
["Dutch (Netherlands) (Female 2)", "nl-NL-Standard-D"],
|
|
433
|
+
["Dutch (Netherlands) (Female 3)", "nl-NL-Standard-E"],
|
|
434
|
+
["English (Australia) (Female)", "en-AU-Standard-A"],
|
|
435
|
+
["English (Australia) (Male)", "en-AU-Standard-B"],
|
|
436
|
+
["English (Australia) (Female 2)", "en-AU-Standard-C"],
|
|
437
|
+
["English (Australia) (Male 2)", "en-AU-Standard-D"],
|
|
438
|
+
["English (India) (Female)", "en-IN-Standard-A"],
|
|
439
|
+
["English (India) (Male)", "en-IN-Standard-B"],
|
|
440
|
+
["English (India) (Male 2)", "en-IN-Standard-C"],
|
|
441
|
+
["English (UK) (Female)", "en-GB-Standard-A"],
|
|
442
|
+
["English (UK) (Male)", "en-GB-Standard-B"],
|
|
443
|
+
["English (UK) (Female 2)", "en-GB-Standard-C"],
|
|
444
|
+
["English (UK) (Male 2)", "en-GB-Standard-D"],
|
|
445
|
+
["Filipino (Philippines) (Female)", "fil-PH-Standard-A"],
|
|
446
|
+
["Finnish (Finland) (Female)", "fi-FI-Standard-A"],
|
|
447
|
+
["French (Canada) (Female)", "fr-CA-Standard-A"],
|
|
448
|
+
["French (Canada) (Male)", "fr-CA-Standard-B"],
|
|
449
|
+
["French (Canada) (Female 2)", "fr-CA-Standard-C"],
|
|
450
|
+
["French (Canada) (Male 2)", "fr-CA-Standard-D"],
|
|
451
|
+
["French (France) (Female)", "fr-FR-Standard-A"],
|
|
452
|
+
["French (France) (Male)", "fr-FR-Standard-B"],
|
|
453
|
+
["French (France) (Female 2)", "fr-FR-Standard-C"],
|
|
454
|
+
["French (France) (Male 2)", "fr-FR-Standard-D"],
|
|
455
|
+
["Greek (Greece) (Female)", "el-GR-Standard-A"],
|
|
456
|
+
["Hindi (India) (Female)", "hi-IN-Standard-A"],
|
|
457
|
+
["Hindi (India) (Male)", "hi-IN-Standard-B"],
|
|
458
|
+
["Hindi (India) (Male 2)", "hi-IN-Standard-C"],
|
|
459
|
+
["Hungarian (Hungary) (Female)", "hu-HU-Standard-A"],
|
|
460
|
+
["Indonesian (Indonesia) (Female)", "id-ID-Standard-A"],
|
|
461
|
+
["Indonesian (Indonesia) (Male)", "id-ID-Standard-B"],
|
|
462
|
+
["Indonesian (Indonesia) (Male 2)", "id-ID-Standard-C"],
|
|
463
|
+
["Italian (Italy) (Female)", "it-IT-Standard-A"],
|
|
464
|
+
["Italian (Italy) (Female 2)", "it-IT-Standard-B"],
|
|
465
|
+
["Italian (Italy) (Male)", "it-IT-Standard-C"],
|
|
466
|
+
["Italian (Italy) (Male 2)", "it-IT-Standard-D"],
|
|
467
|
+
["Japanese (Japan) (Female)", "ja-JP-Standard-A"],
|
|
468
|
+
["Japanese (Japan) (Female 2)", "ja-JP-Standard-B"],
|
|
469
|
+
["Japanese (Japan) (Male)", "ja-JP-Standard-C"],
|
|
470
|
+
["Japanese (Japan) (Male 2)", "ja-JP-Standard-D"],
|
|
471
|
+
["Korean (South Korea) (Female)", "ko-KR-Standard-A"],
|
|
472
|
+
["Korean (South Korea) (Female 2)", "ko-KR-Standard-B"],
|
|
473
|
+
["Korean (South Korea) (Male)", "ko-KR-Standard-C"],
|
|
474
|
+
["Korean (South Korea) (Male 2)", "ko-KR-Standard-D"],
|
|
475
|
+
["Mandarin Chinese (Female)", "cmn-CN-Standard-A"],
|
|
476
|
+
["Mandarin Chinese (Male)", "cmn-CN-Standard-B"],
|
|
477
|
+
["Mandarin Chinese (Male 2)", "cmn-CN-Standard-C"],
|
|
478
|
+
["Norwegian (Norway) (Female)", "nb-NO-Standard-A"],
|
|
479
|
+
["Norwegian (Norway) (Male)", "nb-NO-Standard-B"],
|
|
480
|
+
["Norwegian (Norway) (Female 2)", "nb-NO-Standard-C"],
|
|
481
|
+
["Norwegian (Norway) (Male 2)", "nb-NO-Standard-D"],
|
|
482
|
+
["Norwegian (Norway) (Female 3)", "nb-no-Standard-E"],
|
|
483
|
+
["Polish (Poland) (Female)", "pl-PL-Standard-A"],
|
|
484
|
+
["Polish (Poland) (Male)", "pl-PL-Standard-B"],
|
|
485
|
+
["Polish (Poland) (Male 2)", "pl-PL-Standard-C"],
|
|
486
|
+
["Polish (Poland) (Female 2)", "pl-PL-Standard-D"],
|
|
487
|
+
["Polish (Poland) (Female 3)", "pl-PL-Standard-E"],
|
|
488
|
+
["Portuguese (Brazil) (Female)", "pt-BR-Standard-A"],
|
|
489
|
+
["Portuguese (Portugal) (Female)", "pt-PT-Standard-A"],
|
|
490
|
+
["Portuguese (Portugal) (Male)", "pt-PT-Standard-B"],
|
|
491
|
+
["Portuguese (Portugal) (Male 2)", "pt-PT-Standard-C"],
|
|
492
|
+
["Portuguese (Portugal) (Female 2)", "pt-PT-Standard-D"],
|
|
493
|
+
["Slovak (Slovakia) (Female)", "sk-SK-Standard-A"],
|
|
494
|
+
["Spanish (Spain) (Female)", "es-ES-Standard-A"],
|
|
495
|
+
["Swedish (Sweden) (Female)", "sv-SE-Standard-A"],
|
|
496
|
+
["Turkish (Turkey) (Female)", "tr-TR-Standard-A"],
|
|
497
|
+
["Turkish (Turkey) (Male)", "tr-TR-Standard-B"],
|
|
498
|
+
["Turkish (Turkey) (Female 2)", "tr-TR-Standard-C"],
|
|
499
|
+
["Turkish (Turkey) (Female 3)", "tr-TR-Standard-D"],
|
|
500
|
+
["Turkish (Turkey) (Male)", "tr-TR-Standard-E"],
|
|
501
|
+
["Ukrainian (Ukraine) (Female)", "uk-UA-Standard-A"],
|
|
502
|
+
["Vietnamese (Vietnam) (Female)", "vi-VN-Standard-A"],
|
|
503
|
+
["Vietnamese (Vietnam) (Male)", "vi-VN-Standard-B"],
|
|
504
|
+
["Vietnamese (Vietnam) (Female 2)", "vi-VN-Standard-C"],
|
|
505
|
+
["Vietnamese (Vietnam) (Male 2)", "vi-VN-Standard-D"]
|
|
506
|
+
];
|
|
507
|
+
|
|
508
|
+
// src-blockly/blocks/telegramCall.ts
|
|
509
|
+
var Blockly4 = window.Blockly;
|
|
510
|
+
function installTelegramCall() {
|
|
511
|
+
Blockly4.Sendto.blocks.telegram_call = `<sep gap="5"></sep>
|
|
512
|
+
<block type="telegram_call">
|
|
513
|
+
<field name="INSTANCE"></field>
|
|
514
|
+
<field name="LANGUAGE"></field>
|
|
515
|
+
<field name="REPEATS">1</field>
|
|
516
|
+
<field name="LOG"></field>
|
|
517
|
+
<value name="MESSAGE">
|
|
518
|
+
<shadow type="text">
|
|
519
|
+
<field name="TEXT">text</field>
|
|
520
|
+
</shadow>
|
|
521
|
+
</value>
|
|
522
|
+
<value name="USERNAME">
|
|
523
|
+
<shadow type="text">
|
|
524
|
+
<field name="TEXT"></field>
|
|
525
|
+
</shadow>
|
|
526
|
+
</value>
|
|
527
|
+
</block>`;
|
|
528
|
+
Blockly4.Blocks.telegram_call = {
|
|
529
|
+
init: function() {
|
|
530
|
+
this.appendDummyInput("INSTANCE").appendField(Blockly4.Translate("telegram_call")).appendField(new Blockly4.FieldDropdown(instanceOptions()), "INSTANCE");
|
|
531
|
+
this.appendValueInput("MESSAGE").appendField(Blockly4.Translate("telegram_message"));
|
|
532
|
+
const input = this.appendValueInput("USERNAME").setCheck("String").appendField(Blockly4.Translate("telegram_username"));
|
|
533
|
+
if (input.connection) {
|
|
534
|
+
input.connection._optional = true;
|
|
535
|
+
}
|
|
536
|
+
this.appendDummyInput("LANGUAGE").appendField(Blockly4.Translate("telegram")).appendField(
|
|
537
|
+
new Blockly4.FieldDropdown([[Blockly4.Translate("telegram_call_system"), ""], ...CALL_VOICES]),
|
|
538
|
+
"LANGUAGE"
|
|
539
|
+
);
|
|
540
|
+
this.appendDummyInput("REPEATS").appendField(Blockly4.Translate("telegram_call_repeats")).appendField(
|
|
541
|
+
new Blockly4.FieldDropdown([
|
|
542
|
+
["1", "1"],
|
|
543
|
+
["2", "2"],
|
|
544
|
+
["3", "3"],
|
|
545
|
+
["4", "4"],
|
|
546
|
+
["5", "5"]
|
|
547
|
+
]),
|
|
548
|
+
"REPEATS"
|
|
549
|
+
);
|
|
550
|
+
this.appendDummyInput("LOG").appendField(Blockly4.Translate("telegram_log")).appendField(new Blockly4.FieldDropdown(logLevelOptions()), "LOG");
|
|
551
|
+
this.setInputsInline(false);
|
|
552
|
+
this.setPreviousStatement(true, null);
|
|
553
|
+
this.setNextStatement(true, null);
|
|
554
|
+
this.setColour(Blockly4.Sendto.HUE);
|
|
555
|
+
this.setTooltip(Blockly4.Translate("telegram_call_tooltip"));
|
|
556
|
+
this.setHelpUrl(Blockly4.Translate("telegram_call_help"));
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
registerGenerator("telegram_call", (block) => {
|
|
560
|
+
const instance = block.getFieldValue("INSTANCE");
|
|
561
|
+
const language = block.getFieldValue("LANGUAGE");
|
|
562
|
+
const repeats = block.getFieldValue("REPEATS");
|
|
563
|
+
const logLevel = block.getFieldValue("LOG");
|
|
564
|
+
const text = Blockly4.JavaScript.valueToCode(block, "MESSAGE", Blockly4.JavaScript.ORDER_ATOMIC);
|
|
565
|
+
const username = Blockly4.JavaScript.valueToCode(block, "USERNAME", Blockly4.JavaScript.ORDER_ATOMIC);
|
|
566
|
+
const lines = [`sendTo('telegram${instance}', 'call', {
|
|
567
|
+
`];
|
|
568
|
+
if (text) {
|
|
569
|
+
lines.push(` text: ${text},
|
|
570
|
+
`);
|
|
571
|
+
}
|
|
572
|
+
if (username) {
|
|
573
|
+
lines.push(` user: ${username},
|
|
574
|
+
`);
|
|
575
|
+
}
|
|
576
|
+
lines.push(` lang: '${language}',
|
|
577
|
+
`);
|
|
578
|
+
lines.push(` repeats: ${parseInt(repeats, 10) || 1},
|
|
579
|
+
`);
|
|
580
|
+
lines.push(`});
|
|
581
|
+
${logLine(logLevel, "telegramCall", username, text)}`);
|
|
582
|
+
return lines.join("");
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// src-blockly/i18n/de.json
|
|
587
|
+
var de_default = {
|
|
588
|
+
telegram: "telegram",
|
|
589
|
+
telegram_anyInstance: "Alle Instanzen",
|
|
590
|
+
telegram_ask: "fragen per Telegram",
|
|
591
|
+
telegram_ask_answer: "Antwort",
|
|
592
|
+
telegram_ask_answers: "Antworten",
|
|
593
|
+
telegram_ask_question: "Frage",
|
|
594
|
+
telegram_call: "per Telegram anrufen",
|
|
595
|
+
telegram_call_repeats: "Wiederholungen",
|
|
596
|
+
telegram_call_system: "Systemsprache",
|
|
597
|
+
telegram_call_tooltip: "per Telegram anrufen und einen Text sagen",
|
|
598
|
+
telegram_chatid: "Empfänger (Chat-ID, optional)",
|
|
599
|
+
telegram_disable_web_preview: "Webvorschau deaktivieren",
|
|
600
|
+
telegram_escaping: "Escapezeichen verwenden",
|
|
601
|
+
telegram_log: "Loglevel",
|
|
602
|
+
telegram_log_debug: "debug",
|
|
603
|
+
telegram_log_error: "error",
|
|
604
|
+
telegram_log_info: "info",
|
|
605
|
+
telegram_log_none: "keins",
|
|
606
|
+
telegram_log_warn: "warning",
|
|
607
|
+
telegram_message: "Meldung",
|
|
608
|
+
telegram_parsemode_default: "Standard",
|
|
609
|
+
telegram_silent: "ohne Benachrichtigung",
|
|
610
|
+
telegram_tooltip: "Sende eine Meldung über Telegram",
|
|
611
|
+
telegram_username: "Empfänger (Benutzername, optional)"
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
// src-blockly/i18n/en.json
|
|
615
|
+
var en_default = {
|
|
616
|
+
telegram: "telegram",
|
|
617
|
+
telegram_anyInstance: "all instances",
|
|
618
|
+
telegram_ask: "ask via Telegram",
|
|
619
|
+
telegram_ask_answer: "Answer",
|
|
620
|
+
telegram_ask_answers: "Answers",
|
|
621
|
+
telegram_ask_question: "Question",
|
|
622
|
+
telegram_call: "call via Telegram",
|
|
623
|
+
telegram_call_repeats: "Repeats",
|
|
624
|
+
telegram_call_system: "System language",
|
|
625
|
+
telegram_call_tooltip: "Call via Telegram and say some text",
|
|
626
|
+
telegram_chatid: "Recipient (Chat-ID, optional)",
|
|
627
|
+
telegram_disable_web_preview: "disable web preview",
|
|
628
|
+
telegram_escaping: "Escape chars",
|
|
629
|
+
telegram_log: "log level",
|
|
630
|
+
telegram_log_debug: "debug",
|
|
631
|
+
telegram_log_error: "error",
|
|
632
|
+
telegram_log_info: "info",
|
|
633
|
+
telegram_log_none: "none",
|
|
634
|
+
telegram_log_warn: "warning",
|
|
635
|
+
telegram_message: "message",
|
|
636
|
+
telegram_parsemode_default: "default",
|
|
637
|
+
telegram_silent: "without notification",
|
|
638
|
+
telegram_tooltip: "Send message to telegram",
|
|
639
|
+
telegram_username: "Recipient (Username, optional)"
|
|
640
|
+
};
|
|
641
|
+
|
|
642
|
+
// src-blockly/i18n/es.json
|
|
643
|
+
var es_default = {
|
|
644
|
+
telegram: "telegram",
|
|
645
|
+
telegram_anyInstance: "todas las instancias",
|
|
646
|
+
telegram_ask: "pregunte por Telegram",
|
|
647
|
+
telegram_ask_answer: "Respuesta",
|
|
648
|
+
telegram_ask_answers: "Respuestas",
|
|
649
|
+
telegram_ask_question: "Pregunta",
|
|
650
|
+
telegram_call: "llamar por Telegram",
|
|
651
|
+
telegram_call_repeats: "Repite",
|
|
652
|
+
telegram_call_system: "Lenguaje del sistema",
|
|
653
|
+
telegram_call_tooltip: "Llama por Telegram y di algo de texto",
|
|
654
|
+
telegram_chatid: "Destinatario (Chat-ID, opcional)",
|
|
655
|
+
telegram_disable_web_preview: "deshabilitar la vista previa web",
|
|
656
|
+
telegram_escaping: "escape chars",
|
|
657
|
+
telegram_log: "nivel de registro",
|
|
658
|
+
telegram_log_debug: "depurar",
|
|
659
|
+
telegram_log_error: "error",
|
|
660
|
+
telegram_log_info: "información",
|
|
661
|
+
telegram_log_none: "ninguna",
|
|
662
|
+
telegram_log_warn: "advertencia",
|
|
663
|
+
telegram_message: "mensaje",
|
|
664
|
+
telegram_parsemode_default: "predeterminado",
|
|
665
|
+
telegram_silent: "sin notificación",
|
|
666
|
+
telegram_tooltip: "Enviar mensaje al telegrama",
|
|
667
|
+
telegram_username: "Destinatario (nombre de usuario, opcional)"
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
// src-blockly/i18n/fr.json
|
|
671
|
+
var fr_default = {
|
|
672
|
+
telegram: "telegram",
|
|
673
|
+
telegram_anyInstance: "toutes les instances",
|
|
674
|
+
telegram_ask: "demander via Telegram",
|
|
675
|
+
telegram_ask_answer: "Réponse",
|
|
676
|
+
telegram_ask_answers: "Réponses",
|
|
677
|
+
telegram_ask_question: "Question",
|
|
678
|
+
telegram_call: "appeler par Telegram",
|
|
679
|
+
telegram_call_repeats: "Répète",
|
|
680
|
+
telegram_call_system: "Langue du système",
|
|
681
|
+
telegram_call_tooltip: "Appelez par Telegram et dites du texte",
|
|
682
|
+
telegram_chatid: "Destinataire (Chat-ID, facultatif)",
|
|
683
|
+
telegram_disable_web_preview: "désactiver l'aperçu Web",
|
|
684
|
+
telegram_escaping: "escape chars",
|
|
685
|
+
telegram_log: "niveau de journalisation",
|
|
686
|
+
telegram_log_debug: "déboguer",
|
|
687
|
+
telegram_log_error: "Erreur",
|
|
688
|
+
telegram_log_info: "Info",
|
|
689
|
+
telegram_log_none: "aucun",
|
|
690
|
+
telegram_log_warn: "Attention",
|
|
691
|
+
telegram_message: "message",
|
|
692
|
+
telegram_parsemode_default: "par défaut",
|
|
693
|
+
telegram_silent: "sans notification",
|
|
694
|
+
telegram_tooltip: "Envoyer un message au télégramme",
|
|
695
|
+
telegram_username: "Destinataire (nom d'utilisateur, facultatif)"
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
// src-blockly/i18n/it.json
|
|
699
|
+
var it_default = {
|
|
700
|
+
telegram: "telegram",
|
|
701
|
+
telegram_anyInstance: "tutte le istanze",
|
|
702
|
+
telegram_ask: "chiedere via Telegram",
|
|
703
|
+
telegram_ask_answer: "Risposta",
|
|
704
|
+
telegram_ask_answers: "Risposte",
|
|
705
|
+
telegram_ask_question: "Domanda",
|
|
706
|
+
telegram_call: "chiama via Telegram",
|
|
707
|
+
telegram_call_repeats: "Si ripete",
|
|
708
|
+
telegram_call_system: "Linguaggio di sistema",
|
|
709
|
+
telegram_call_tooltip: "Chiama via Telegram e pronuncia un messaggio",
|
|
710
|
+
telegram_chatid: "Destinatario (ID chat, facoltativo)",
|
|
711
|
+
telegram_disable_web_preview: "disabilitare l'anteprima web",
|
|
712
|
+
telegram_escaping: "escape chars",
|
|
713
|
+
telegram_log: "livello log",
|
|
714
|
+
telegram_log_debug: "Debug",
|
|
715
|
+
telegram_log_error: "errore",
|
|
716
|
+
telegram_log_info: "Informazioni",
|
|
717
|
+
telegram_log_none: "nessuna",
|
|
718
|
+
telegram_log_warn: "avvertimento",
|
|
719
|
+
telegram_message: "Messaggio",
|
|
720
|
+
telegram_parsemode_default: "predefinito",
|
|
721
|
+
telegram_silent: "senza notifica",
|
|
722
|
+
telegram_tooltip: "Invia messaggio al telegramma",
|
|
723
|
+
telegram_username: "Destinatario (Nome utente, facoltativo)"
|
|
724
|
+
};
|
|
725
|
+
|
|
726
|
+
// src-blockly/i18n/nl.json
|
|
727
|
+
var nl_default = {
|
|
728
|
+
telegram: "telegram",
|
|
729
|
+
telegram_anyInstance: "alle instanties",
|
|
730
|
+
telegram_ask: "vragen via Telegram",
|
|
731
|
+
telegram_ask_answer: "Antwoord",
|
|
732
|
+
telegram_ask_answers: "Antwoorden",
|
|
733
|
+
telegram_ask_question: "Vraag",
|
|
734
|
+
telegram_call: "bellen via Telegram",
|
|
735
|
+
telegram_call_repeats: "Herhaalt",
|
|
736
|
+
telegram_call_system: "Systeem taal",
|
|
737
|
+
telegram_call_tooltip: "Bel via Telegram en zeg wat tekst",
|
|
738
|
+
telegram_chatid: "Ontvanger (Chat-ID, optioneel)",
|
|
739
|
+
telegram_disable_web_preview: "webvoorbeeld uitschakelen",
|
|
740
|
+
telegram_escaping: "escape chars",
|
|
741
|
+
telegram_log: "Log niveau",
|
|
742
|
+
telegram_log_debug: "Debug",
|
|
743
|
+
telegram_log_error: "fout",
|
|
744
|
+
telegram_log_info: "Info",
|
|
745
|
+
telegram_log_none: "geen",
|
|
746
|
+
telegram_log_warn: "waarschuwing",
|
|
747
|
+
telegram_message: "bericht",
|
|
748
|
+
telegram_parsemode_default: "standaard",
|
|
749
|
+
telegram_silent: "zonder kennisgeving",
|
|
750
|
+
telegram_tooltip: "Stuur bericht naar telegram",
|
|
751
|
+
telegram_username: "Ontvanger (gebruikersnaam, optioneel)"
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
// src-blockly/i18n/pl.json
|
|
755
|
+
var pl_default = {
|
|
756
|
+
telegram: "telegram",
|
|
757
|
+
telegram_anyInstance: "wszystkie przypadki",
|
|
758
|
+
telegram_ask: "pytaj przez Telegram",
|
|
759
|
+
telegram_ask_answer: "Odpowiedź",
|
|
760
|
+
telegram_ask_answers: "Odpowiedzi",
|
|
761
|
+
telegram_ask_question: "Pytanie",
|
|
762
|
+
telegram_call: "połączenie za Telegram",
|
|
763
|
+
telegram_call_repeats: "Powtarza się",
|
|
764
|
+
telegram_call_system: "Język systemowy",
|
|
765
|
+
telegram_call_tooltip: "Zadzwoń za pośrednictwem Telegram i powiedz tekst",
|
|
766
|
+
telegram_chatid: "Odbiorca (identyfikator czatu, opcjonalnie)",
|
|
767
|
+
telegram_disable_web_preview: "wyłącz podgląd internetowy",
|
|
768
|
+
telegram_escaping: "escape chars",
|
|
769
|
+
telegram_log: "poziom dziennika",
|
|
770
|
+
telegram_log_debug: "odpluskwić",
|
|
771
|
+
telegram_log_error: "błąd",
|
|
772
|
+
telegram_log_info: "informacje",
|
|
773
|
+
telegram_log_none: "Żaden",
|
|
774
|
+
telegram_log_warn: "ostrzeżenie",
|
|
775
|
+
telegram_message: "wiadomość",
|
|
776
|
+
telegram_parsemode_default: "domyślny",
|
|
777
|
+
telegram_silent: "bez powiadomienia",
|
|
778
|
+
telegram_tooltip: "Wyślij wiadomość do telegramu",
|
|
779
|
+
telegram_username: "Odbiorca (nazwa użytkownika, opcjonalnie)"
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
// src-blockly/i18n/pt.json
|
|
783
|
+
var pt_default = {
|
|
784
|
+
telegram: "telegram",
|
|
785
|
+
telegram_anyInstance: "todas as instâncias",
|
|
786
|
+
telegram_ask: "perguntar via Telegram",
|
|
787
|
+
telegram_ask_answer: "Resposta",
|
|
788
|
+
telegram_ask_answers: "Respostas",
|
|
789
|
+
telegram_ask_question: "Pergunta",
|
|
790
|
+
telegram_call: "chamada via Telegram",
|
|
791
|
+
telegram_call_repeats: "Repete",
|
|
792
|
+
telegram_call_system: "Idioma do sistema",
|
|
793
|
+
telegram_call_tooltip: "Ligue por Telegram e diga algum texto",
|
|
794
|
+
telegram_chatid: "Destinatário (Chat-ID, opcional)",
|
|
795
|
+
telegram_disable_web_preview: "desativar a visualização da web",
|
|
796
|
+
telegram_escaping: "escape chars",
|
|
797
|
+
telegram_log: "nível de log",
|
|
798
|
+
telegram_log_debug: "depurar",
|
|
799
|
+
telegram_log_error: "erro",
|
|
800
|
+
telegram_log_info: "info",
|
|
801
|
+
telegram_log_none: "Nenhum",
|
|
802
|
+
telegram_log_warn: "Atenção",
|
|
803
|
+
telegram_message: "mensagem",
|
|
804
|
+
telegram_parsemode_default: "padrão",
|
|
805
|
+
telegram_silent: "sem notificação",
|
|
806
|
+
telegram_tooltip: "Enviar mensagem para telegrama",
|
|
807
|
+
telegram_username: "Destinatário (nome de usuário, opcional)"
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
// src-blockly/i18n/ru.json
|
|
811
|
+
var ru_default = {
|
|
812
|
+
telegram: "telegram",
|
|
813
|
+
telegram_anyInstance: "На все драйвера",
|
|
814
|
+
telegram_ask: "спрос через Telegram",
|
|
815
|
+
telegram_ask_answer: "Ответ",
|
|
816
|
+
telegram_ask_answers: "Ответы",
|
|
817
|
+
telegram_ask_question: "Вопрос",
|
|
818
|
+
telegram_call: "звонок через Telegram",
|
|
819
|
+
telegram_call_repeats: "Повторить",
|
|
820
|
+
telegram_call_system: "Системный язык",
|
|
821
|
+
telegram_call_tooltip: "Звоните через Telegram и скажите какой-нибудь текст",
|
|
822
|
+
telegram_chatid: "Получатель (Chat-ID, необязательно)",
|
|
823
|
+
telegram_disable_web_preview: "отключить предварительный просмотр в Интернете",
|
|
824
|
+
telegram_escaping: "Escape",
|
|
825
|
+
telegram_log: "Протокол",
|
|
826
|
+
telegram_log_debug: "debug",
|
|
827
|
+
telegram_log_error: "ошибка",
|
|
828
|
+
telegram_log_info: "инфо",
|
|
829
|
+
telegram_log_none: "нет",
|
|
830
|
+
telegram_log_warn: "warning",
|
|
831
|
+
telegram_message: "сообщение",
|
|
832
|
+
telegram_parsemode_default: "по умолчанию",
|
|
833
|
+
telegram_silent: "без уведомления",
|
|
834
|
+
telegram_tooltip: "Послать сообщение через Telegram",
|
|
835
|
+
telegram_username: "Получатель (имя пользователя, необязательно)"
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
// src-blockly/i18n/uk.json
|
|
839
|
+
var uk_default = {
|
|
840
|
+
telegram_ask: "подати заявку",
|
|
841
|
+
telegram_ask_answer: "Відправити",
|
|
842
|
+
telegram_ask_answers: "Відповідей",
|
|
843
|
+
telegram_ask_question: "Питання",
|
|
844
|
+
telegram_parsemode_default: "за замовчуванням"
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
// src-blockly/i18n/zh-cn.json
|
|
848
|
+
var zh_cn_default = {
|
|
849
|
+
telegram_ask: "通过Telegram 查询",
|
|
850
|
+
telegram_ask_answer: "答复",
|
|
851
|
+
telegram_ask_answers: "答复",
|
|
852
|
+
telegram_ask_question: "问题",
|
|
853
|
+
telegram_call: "通过电报电话",
|
|
854
|
+
telegram_call_repeats: "重复",
|
|
855
|
+
telegram_call_system: "系统语言",
|
|
856
|
+
telegram_call_tooltip: "通过电报呼叫并说一些文字",
|
|
857
|
+
telegram_chatid: "收件人(聊天 ID,可选)",
|
|
858
|
+
telegram_disable_web_preview: "禁用网页预览",
|
|
859
|
+
telegram_escaping: "escape chars",
|
|
860
|
+
telegram_parsemode_default: "默认",
|
|
861
|
+
telegram_username: "收件人(用户名,可选)"
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
// src-blockly/words.ts
|
|
865
|
+
var Blockly5 = window.Blockly;
|
|
866
|
+
var LANGUAGES = {
|
|
867
|
+
de: de_default,
|
|
868
|
+
en: en_default,
|
|
869
|
+
es: es_default,
|
|
870
|
+
fr: fr_default,
|
|
871
|
+
it: it_default,
|
|
872
|
+
nl: nl_default,
|
|
873
|
+
pl: pl_default,
|
|
874
|
+
pt: pt_default,
|
|
875
|
+
ru: ru_default,
|
|
876
|
+
uk: uk_default,
|
|
877
|
+
"zh-cn": zh_cn_default
|
|
878
|
+
};
|
|
879
|
+
var README = "https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md";
|
|
880
|
+
function installWords() {
|
|
881
|
+
Blockly5.Translate || (Blockly5.Translate = function(word, lang) {
|
|
882
|
+
lang || (lang = window.systemLang);
|
|
883
|
+
const entry = Blockly5.Words?.[word];
|
|
884
|
+
return entry ? entry[lang || "en"] || entry.en : word;
|
|
885
|
+
});
|
|
886
|
+
const words = {};
|
|
887
|
+
for (const [lang, texts] of Object.entries(LANGUAGES)) {
|
|
888
|
+
for (const [word, text] of Object.entries(texts)) {
|
|
889
|
+
if (text) {
|
|
890
|
+
(words[word] || (words[word] = {}))[lang] = text;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
Object.assign(Blockly5.Words, words);
|
|
895
|
+
Blockly5.Words.telegram_help = { en: README };
|
|
896
|
+
Blockly5.Words.telegram_call_help = { en: `${README}#calls-via-telegram` };
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// src-blockly/blockly.ts
|
|
900
|
+
installWords();
|
|
901
|
+
installTelegram();
|
|
902
|
+
installTelegramCall();
|
|
903
|
+
installTelegramAsk();
|
|
904
|
+
})();
|