iobroker.telegram 5.0.3 → 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.
Files changed (58) hide show
  1. package/README.md +5 -6
  2. package/admin/blockly.js +904 -703
  3. package/admin/custom/assets/Components-RFUcDWVw.js +1 -0
  4. package/admin/custom/assets/TelegramComponent-BlbzWnGf.js +1 -0
  5. package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomTelegramSet__mf_owner__1-CYGgKKbw.js +1 -0
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. package/admin/custom/assets/hostInit-BNe6sh6V.js +1 -0
  12. package/admin/custom/assets/{index-eZ62BoSR.js → index-LrXX-mmr.js} +1 -1
  13. package/admin/custom/assets/{lib-CD-GzlBV.js → lib-RwYXypgP.js} +2 -2
  14. package/admin/custom/assets/{mf-entry-bootstrap-0-b6093517.js → mf-entry-bootstrap-0-6511586c.js} +7 -2
  15. package/admin/custom/assets/virtualExposes-D9ldD81W.js +1 -0
  16. package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomTelegramSet__customComponents_js-DrQPTDkD.js +1 -0
  17. package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomTelegramSet__customComponents_js-CVExw4BU.js +2 -0
  18. package/admin/custom/customComponents.js +12 -1
  19. package/admin/rules/@mf-types.zip +0 -0
  20. package/admin/rules/assets/{ActionTelegram-B6MV6Suh.js → ActionTelegram-DeJ5nvxQ.js} +1 -1
  21. package/admin/rules/assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-5RXQO0YV.js +1 -0
  22. 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
  23. 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
  24. package/admin/rules/assets/{bootstrap-BYHIIyNX.js → bootstrap-Dmf2iLIl.js} +1 -1
  25. package/admin/rules/assets/dist-DPGjdSM2.js +4 -0
  26. package/admin/rules/assets/hostInit-DwUKqg5g.js +1 -0
  27. package/admin/rules/assets/{index-DNvLhqId.js → index-C1RI8GmH.js} +2 -2
  28. package/admin/rules/assets/{mf-entry-bootstrap-0-0359e3b1.js → mf-entry-bootstrap-0-ea9c1b7d.js} +7 -2
  29. package/admin/rules/assets/{virtualExposes-B_nAAKh7.js → virtualExposes-CNNdiEV7.js} +1 -1
  30. package/admin/rules/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-CkqQUQPA.js +1 -0
  31. package/admin/rules/assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-DmBGDihA.js +2 -0
  32. package/admin/rules/customRuleBlocks.js +12 -1
  33. package/admin/rules/index.html +2 -2
  34. package/admin/rules/mf-manifest.json +1 -1
  35. package/admin/rules/mf-stats.json +1 -1
  36. package/build/main.js +16 -0
  37. package/build/main.js.map +1 -1
  38. package/io-package.json +14 -14
  39. package/package.json +10 -7
  40. package/admin/custom/assets/Components-vut2bGwn.js +0 -1
  41. package/admin/custom/assets/TelegramComponent-BZ7I6gtX.js +0 -1
  42. package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomTelegramSet__mf_owner__1-BHAodlGV.js +0 -1
  43. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-D46R1xc7.js +0 -1
  44. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-xx76IGj-.js +0 -1
  45. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DGcXQRP3.js +0 -1243
  46. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-DasKHBra.js +0 -1494
  47. package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-nqfHAKpY.js +0 -9
  48. package/admin/custom/assets/hostInit-BrGEhTTB.js +0 -1
  49. package/admin/custom/assets/virtualExposes-D6H2QEmC.js +0 -1
  50. package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomTelegramSet__customComponents_js-Bbi8grgE.js +0 -1
  51. package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomTelegramSet__customComponents_js-pyvbme2z.js +0 -2
  52. package/admin/rules/assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-W47Y9rap.js +0 -1
  53. package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-BSNt_CsB.js +0 -1213
  54. package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-OC4_6TEZ.js +0 -9
  55. package/admin/rules/assets/dist-CZ0k02zl.js +0 -4
  56. package/admin/rules/assets/hostInit-Dn7jykxO.js +0 -1
  57. package/admin/rules/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-CgqTDeL0.js +0 -1
  58. package/admin/rules/assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-D-jiWpOo.js +0 -2
package/admin/blockly.js CHANGED
@@ -1,703 +1,904 @@
1
- 'use strict';
2
-
3
- if (typeof goog !== 'undefined') {
4
- goog.provide('Blockly.JavaScript.Sendto');
5
- goog.require('Blockly.JavaScript');
6
- }
7
-
8
- // --- SendTo telegram --------------------------------------------------
9
- Blockly.Words['telegram'] = {'en': 'telegram', 'pt': 'telegram', 'pl': 'telegram', 'nl': 'telegram', 'it': 'telegram', 'es': 'telegram', 'fr': 'telegram', 'de': 'telegram', 'ru': 'telegram'};
10
- Blockly.Words['telegram_message'] = {'en': 'message', 'pt': 'mensagem', 'pl': 'wiadomość', 'nl': 'bericht', 'it': 'Messaggio', 'es': 'mensaje', 'fr': 'message', 'de': 'Meldung', 'ru': 'сообщение'};
11
- Blockly.Words['telegram_username'] = {'en': 'Recipient (Username, optional)', 'pt': 'Destinatário (nome de usuário, opcional)', 'de': 'Empfänger (Benutzername, optional)', 'ru': 'Получатель (имя пользователя, необязательно)', 'nl': 'Ontvanger (gebruikersnaam, optioneel)', 'fr': 'Destinataire (nom d\'utilisateur, facultatif)', 'it': 'Destinatario (Nome utente, facoltativo)', 'es': 'Destinatario (nombre de usuario, opcional)', 'pl': 'Odbiorca (nazwa użytkownika, opcjonalnie)', 'zh-cn': '收件人(用户名,可选)' };
12
- Blockly.Words['telegram_chatid'] = {'en': 'Recipient (Chat-ID, optional)', 'de': 'Empfänger (Chat-ID, optional)', 'ru': 'Получатель (Chat-ID, необязательно)', 'pt': 'Destinatário (Chat-ID, opcional)', 'nl': 'Ontvanger (Chat-ID, optioneel)', 'fr': 'Destinataire (Chat-ID, facultatif)', 'it': 'Destinatario (ID chat, facoltativo)', 'es': 'Destinatario (Chat-ID, opcional)', 'pl': 'Odbiorca (identyfikator czatu, opcjonalnie)', 'zh-cn': '收件人(聊天 ID,可选)' };
13
- Blockly.Words['telegram_anyInstance'] = {'en': 'all instances', 'pt': 'todas as instâncias', 'pl': 'wszystkie przypadki', 'nl': 'alle instanties', 'it': 'tutte le istanze', 'es': 'todas las instancias', 'fr': 'toutes les instances', 'de': 'Alle Instanzen', 'ru': 'На все драйвера'};
14
- Blockly.Words['telegram_tooltip'] = {'en': 'Send message to telegram', 'pt': 'Enviar mensagem para telegrama', 'pl': 'Wyślij wiadomość do telegramu', 'nl': 'Stuur bericht naar telegram', 'it': 'Invia messaggio al telegramma', 'es': 'Enviar mensaje al telegrama', 'fr': 'Envoyer un message au télégramme', 'de': 'Sende eine Meldung über Telegram', 'ru': 'Послать сообщение через Telegram'};
15
- Blockly.Words['telegram_log'] = {'en': 'log level', 'pt': 'nível de log', 'pl': 'poziom dziennika', 'nl': 'Log niveau', 'it': 'livello log', 'es': 'nivel de registro', 'fr': 'niveau de journalisation', 'de': 'Loglevel', 'ru': 'Протокол'};
16
- Blockly.Words['telegram_log_none'] = {'en': 'none', 'pt': 'Nenhum', 'pl': 'Żaden', 'nl': 'geen', 'it': 'nessuna', 'es': 'ninguna', 'fr': 'aucun', 'de': 'keins', 'ru': 'нет'};
17
- Blockly.Words['telegram_log_info'] = {'en': 'info', 'pt': 'info', 'pl': 'informacje', 'nl': 'Info', 'it': 'Informazioni', 'es': 'información', 'fr': 'Info', 'de': 'info', 'ru': 'инфо'};
18
- Blockly.Words['telegram_log_debug'] = {'en': 'debug', 'pt': 'depurar', 'pl': 'odpluskwić', 'nl': 'Debug', 'it': 'Debug', 'es': 'depurar', 'fr': 'déboguer', 'de': 'debug', 'ru': 'debug'};
19
- Blockly.Words['telegram_log_warn'] = {'en': 'warning', 'pt': 'Atenção', 'pl': 'ostrzeżenie', 'nl': 'waarschuwing', 'it': 'avvertimento', 'es': 'advertencia', 'fr': 'Attention', 'de': 'warning', 'ru': 'warning'};
20
- Blockly.Words['telegram_log_error'] = {'en': 'error', 'pt': 'erro', 'pl': 'błąd', 'nl': 'fout', 'it': 'errore', 'es': 'error', 'fr': 'Erreur', 'de': 'error', 'ru': 'ошибка'};
21
- Blockly.Words['telegram_help'] = {'en': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'pt': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'pl': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'nl': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'it': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'es': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'fr': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'de': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md', 'ru': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md'};
22
- Blockly.Words['telegram_silent'] = {'en': 'without notification', 'de': 'ohne Benachrichtigung', 'ru': 'без уведомления', 'pt': 'sem notificação', 'nl': 'zonder kennisgeving', 'fr': 'sans notification', 'it': 'senza notifica', 'es': 'sin notificación', 'pl': 'bez powiadomienia'};
23
- Blockly.Words['telegram_escaping'] = {'en': 'Escape chars', 'de': 'Escapezeichen verwenden', 'ru': 'Escape', 'pt': 'escape chars', 'nl': 'escape chars', 'fr': 'escape chars', 'it': 'escape chars', 'es': 'escape chars', 'pl': 'escape chars', 'zh-cn': 'escape chars'};
24
- Blockly.Words['telegram_disable_web_preview'] = {'en': 'disable web preview', 'de': 'Webvorschau deaktivieren', 'ru': 'отключить предварительный просмотр в Интернете', 'pt': 'desativar a visualização da web', 'nl': 'webvoorbeeld uitschakelen', 'fr': 'désactiver l\'aperçu Web','it': 'disabilitare l\'anteprima web', 'es': 'deshabilitar la vista previa web', 'pl': 'wyłącz podgląd internetowy', 'zh-cn': '禁用网页预览'};
25
- Blockly.Words['telegram_parsemode_default'] = {'en': 'default', 'de': 'Standard', 'ru': 'по умолчанию', 'pt': 'padrão', 'nl': 'standaard', 'fr': 'par défaut', 'it': 'predefinito', 'es': 'predeterminado', 'pl': 'domyślny', 'uk': 'за замовчуванням', 'zh-cn': '默认'};
26
-
27
- Blockly.Sendto.blocks['telegram'] =
28
- '<block type="telegram">' +
29
- ' <field name="INSTANCE"></field>' +
30
- ' <field name="LOG"></field>' +
31
- ' <field name="SILENT">FALSE</field>' +
32
- ' <field name="PARSEMODE">default</field>' +
33
- ' <field name="ESCAPING">FALSE</field>' +
34
- ' <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field>' +
35
- ' <value name="MESSAGE">' +
36
- ' <shadow type="text">' +
37
- ' <field name="TEXT">text</field>' +
38
- ' </shadow>' +
39
- ' </value>' +
40
- '</block>';
41
-
42
- Blockly.Blocks['telegram'] = {
43
- init: function () {
44
- const options = [[Blockly.Translate('telegram_anyInstance'), '']];
45
- if (typeof main !== 'undefined' && main.instances) {
46
- for (let i = 0; i < main.instances.length; i++) {
47
- const m = main.instances[i].match(/^system.adapter.telegram.(\d+)$/);
48
- if (m) {
49
- const k = parseInt(m[1], 10);
50
- options.push(['telegram.' + k, '.' + k]);
51
- }
52
- }
53
- if (options.length === 0) {
54
- for (let u = 0; u <= 4; u++) {
55
- options.push(['telegram.' + u, '.' + u]);
56
- }
57
- }
58
- } else {
59
- for (let n = 0; n <= 4; n++) {
60
- options.push(['telegram.' + n, '.' + n]);
61
- }
62
- }
63
-
64
- this.appendDummyInput('INSTANCE')
65
- .appendField(Blockly.Translate('telegram'))
66
- .appendField(new Blockly.FieldDropdown(options), 'INSTANCE');
67
-
68
- this.appendValueInput('MESSAGE')
69
- .appendField(Blockly.Translate('telegram_message'));
70
-
71
- const inputUser = this.appendValueInput('USERNAME')
72
- .setCheck('String')
73
- .appendField(Blockly.Translate('telegram_username'));
74
- if (inputUser.connection) {
75
- inputUser.connection._optional = true;
76
- }
77
-
78
- const inputChat = this.appendValueInput('CHATID')
79
- .setCheck('String')
80
- .appendField(Blockly.Translate('telegram_chatid'));
81
- if (inputChat.connection) {
82
- inputChat.connection._optional = true;
83
- }
84
-
85
- this.appendDummyInput('LOG')
86
- .appendField(Blockly.Translate('telegram_log'))
87
- .appendField(new Blockly.FieldDropdown([
88
- [Blockly.Translate('telegram_log_none'), ''],
89
- [Blockly.Translate('telegram_log_debug'), 'debug'],
90
- [Blockly.Translate('telegram_log_info'), 'log'],
91
- [Blockly.Translate('telegram_log_warn'), 'warn'],
92
- [Blockly.Translate('telegram_log_error'), 'error'],
93
- ]), 'LOG');
94
-
95
- this.appendDummyInput('SILENT')
96
- .appendField(Blockly.Translate('telegram_silent'))
97
- .appendField(new Blockly.FieldCheckbox('FALSE'), 'SILENT');
98
-
99
- this.appendDummyInput('PARSEMODE')
100
- .appendField('Parsemode')
101
- .appendField(new Blockly.FieldDropdown([[Blockly.Translate('telegram_parsemode_default'), 'default'], ['HTML', 'HTML'], ['MarkdownV2', 'MarkdownV2']]), 'PARSEMODE');
102
-
103
- this.appendDummyInput('ESCAPING')
104
- .appendField(Blockly.Translate('telegram_escaping'))
105
- .appendField(new Blockly.FieldCheckbox('FALSE'), 'ESCAPING');
106
-
107
- this.appendDummyInput('DISABLE_WEB_PAGE_PREVIEW')
108
- .appendField(Blockly.Translate('telegram_disable_web_preview'))
109
- .appendField(new Blockly.FieldCheckbox('FALSE'), 'DISABLE_WEB_PAGE_PREVIEW');
110
-
111
- this.setInputsInline(false);
112
- this.setPreviousStatement(true, null);
113
- this.setNextStatement(true, null);
114
-
115
- this.setColour(Blockly.Sendto.HUE);
116
- this.setTooltip(Blockly.Translate('telegram_tooltip'));
117
- this.setHelpUrl(Blockly.Translate('telegram_help'));
118
- },
119
- };
120
-
121
- Blockly.JavaScript['telegram'] = function (block) {
122
- const dropdown_instance = block.getFieldValue('INSTANCE');
123
- const logLevel = block.getFieldValue('LOG');
124
- let value_message = Blockly.JavaScript.valueToCode(block, 'MESSAGE', Blockly.JavaScript.ORDER_ATOMIC);
125
- const value_username = Blockly.JavaScript.valueToCode(block, 'USERNAME', Blockly.JavaScript.ORDER_ATOMIC);
126
- const value_chatid = Blockly.JavaScript.valueToCode(block, 'CHATID', Blockly.JavaScript.ORDER_ATOMIC);
127
- const silent = block.getFieldValue('SILENT');
128
- const escaping = block.getFieldValue('ESCAPING');
129
- const disable_web_page_preview = block.getFieldValue('DISABLE_WEB_PAGE_PREVIEW');
130
- const parsemode = block.getFieldValue('PARSEMODE');
131
-
132
- let logText = '';
133
- if (logLevel) {
134
- const logUsername = value_username ? `[' + ${value_username} + ']` : '';
135
- logText = `console.${logLevel}('telegram${logUsername}: ' + ${value_message});\n`;
136
- }
137
-
138
- if (escaping === 'TRUE') {
139
- // escape following characters: "_*[]()~`>#+-=|{}.!"
140
- value_message += ".replace(/([-_*\\[\\]()~`>#+=|{}.!])/g, '\\\\$1')";
141
- }
142
-
143
- return `sendTo('telegram${dropdown_instance}', 'send', {\n` +
144
- ` text: ${value_message},\n` +
145
- (value_username ? ` user: ${value_username},\n` : '') +
146
- (value_chatid ? ` chatId: ${value_chatid},\n` : '') +
147
- (silent === 'TRUE' ? ' disable_notification: true,\n' : '') +
148
- (disable_web_page_preview === 'TRUE' ? ' disable_web_page_preview: true,\n' : '') +
149
- (parsemode !== 'default' ? ` parse_mode: '${parsemode}',\n` : '') +
150
- `});\n${logText}`;
151
- };
152
-
153
- // --- SendTo call telegram --------------------------------------------------
154
- Blockly.Words['telegram_call'] = {'en': 'call via Telegram', 'de': 'per Telegram anrufen', 'ru': 'звонок через Telegram', 'pt': 'chamada via Telegram', 'nl': 'bellen via Telegram', 'fr': 'appeler par Telegram', 'it': 'chiama via Telegram', 'es': 'llamar por Telegram', 'pl': 'połączenie za Telegram', 'zh-cn': '通过电报电话'};
155
- Blockly.Words['telegram_call_system'] = {'en': 'System language', 'de': 'Systemsprache', 'ru': 'Системный язык', 'pt': 'Idioma do sistema', 'nl': 'Systeem taal', 'fr': 'Langue du système', 'it': 'Linguaggio di sistema', 'es': 'Lenguaje del sistema', 'pl': 'Język systemowy', 'zh-cn': '系统语言'};
156
- Blockly.Words['telegram_call_tooltip'] = {'en': 'Call via Telegram and say some text', 'de': 'per Telegram anrufen und einen Text sagen','ru': 'Звоните через Telegram и скажите какой-нибудь текст', 'pt': 'Ligue por Telegram e diga algum texto', 'nl': 'Bel via Telegram en zeg wat tekst', 'fr': 'Appelez par Telegram et dites du texte', 'it': 'Chiama via Telegram e pronuncia un messaggio', 'es': 'Llama por Telegram y di algo de texto', 'pl': 'Zadzwoń za pośrednictwem Telegram i powiedz tekst', 'zh-cn': '通过电报呼叫并说一些文字'};
157
- Blockly.Words['telegram_call_help'] = {'en': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'pt': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'pl': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'nl': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'it': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'es': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'fr': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'de': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram', 'ru': 'https://github.com/ioBroker/ioBroker.telegram/blob/master/README.md#calls-via-telegram'};
158
- Blockly.Words['telegram_call_repeats'] = {'en': 'Repeats', 'de': 'Wiederholungen', 'ru': 'Повторить', 'pt': 'Repete', 'nl': 'Herhaalt', 'fr': 'Répète', 'it': 'Si ripete', 'es': 'Repite', 'pl': 'Powtarza się', 'zh-cn': '重复'};
159
-
160
- Blockly.Sendto.blocks['telegram_call'] =
161
- '<sep gap="5"></sep>' +
162
- '<block type="telegram_call">' +
163
- ' <field name="INSTANCE"></field>' +
164
- ' <field name="LANGUAGE"></field>' +
165
- ' <field name="REPEATS">1</field>' +
166
- ' <field name="LOG"></field>' +
167
- ' <value name="MESSAGE">' +
168
- ' <shadow type="text">' +
169
- ' <field name="TEXT">text</field>' +
170
- ' </shadow>' +
171
- ' </value>' +
172
- ' <value name="USERNAME">' +
173
- ' <shadow type="text">' +
174
- ' <field name="TEXT"></field>' +
175
- ' </shadow>' +
176
- ' </value>' +
177
- '</block>';
178
-
179
- Blockly.Blocks['telegram_call'] = {
180
- init: function () {
181
- const options = [[Blockly.Translate('telegram_anyInstance'), '']];
182
- if (typeof main !== 'undefined' && main.instances) {
183
- for (let i = 0; i < main.instances.length; i++) {
184
- const m = main.instances[i].match(/^system.adapter.telegram.(\d+)$/);
185
- if (m) {
186
- const k = parseInt(m[1], 10);
187
- options.push(['telegram.' + k, '.' + k]);
188
- }
189
- }
190
- if (options.length === 0) {
191
- for (let u = 0; u <= 4; u++) {
192
- options.push(['telegram.' + u, '.' + u]);
193
- }
194
- }
195
- } else {
196
- for (let n = 0; n <= 4; n++) {
197
- options.push(['telegram.' + n, '.' + n]);
198
- }
199
- }
200
-
201
- this.appendDummyInput('INSTANCE')
202
- .appendField(Blockly.Translate('telegram_call'))
203
- .appendField(new Blockly.FieldDropdown(options), 'INSTANCE');
204
-
205
- this.appendValueInput('MESSAGE')
206
- .appendField(Blockly.Translate('telegram_message'));
207
-
208
- const inputUsername = this.appendValueInput('USERNAME')
209
- .setCheck('String')
210
- .appendField(Blockly.Translate('telegram_username'));
211
- if (inputUsername.connection) {
212
- inputUsername.connection._optional = true;
213
- }
214
-
215
- const languages = [
216
- [Blockly.Translate('telegram_call_system'), ''],
217
- ['German (Germany) (Female)', 'de-DE-Standard-A'],
218
- ['German (Germany) (Male)', 'de-DE-Standard-B'],
219
- ['English (US) (Male)', 'en-US-Standard-B'],
220
- ['English (US) (Female)', 'en-US-Standard-C'],
221
- ['English (US) (Male 2)', 'en-US-Standard-D'],
222
- ['English (US) (Female 2)', 'en-US-Standard-E'],
223
- ['Russian (Russia) (Female)', 'ru-RU-Standard-A'],
224
- ['Russian (Russia) (Male)', 'ru-RU-Standard-B'],
225
- ['Russian (Russia) (Female 2)', 'ru-RU-Standard-C'],
226
- ['Russian (Russia) (Male 2)', 'ru-RU-Standard-D'],
227
- ['Arabic (Female)', 'ar-XA-Standard-A'],
228
- ['Arabic (Male)', 'ar-XA-Standard-B'],
229
- ['Arabic (Male 2)', 'ar-XA-Standard-C'],
230
- ['Czech (Czech Republic) (Female)', 'cs-CZ-Standard-A'],
231
- ['Danish (Denmark) (Female)', 'da-DK-Standard-A'],
232
- ['Dutch (Netherlands) (Female)', 'nl-NL-Standard-A'],
233
- ['Dutch (Netherlands) (Male)', 'nl-NL-Standard-B'],
234
- ['Dutch (Netherlands) (Male 2)', 'nl-NL-Standard-C'],
235
- ['Dutch (Netherlands) (Female 2)', 'nl-NL-Standard-D'],
236
- ['Dutch (Netherlands) (Female 3)', 'nl-NL-Standard-E'],
237
- ['English (Australia) (Female)', 'en-AU-Standard-A'],
238
- ['English (Australia) (Male)', 'en-AU-Standard-B'],
239
- ['English (Australia) (Female 2)', 'en-AU-Standard-C'],
240
- ['English (Australia) (Male 2)', 'en-AU-Standard-D'],
241
- ['English (India) (Female)', 'en-IN-Standard-A'],
242
- ['English (India) (Male)', 'en-IN-Standard-B'],
243
- ['English (India) (Male 2)', 'en-IN-Standard-C'],
244
- ['English (UK) (Female)', 'en-GB-Standard-A'],
245
- ['English (UK) (Male)', 'en-GB-Standard-B'],
246
- ['English (UK) (Female 2)', 'en-GB-Standard-C'],
247
- ['English (UK) (Male 2)', 'en-GB-Standard-D'],
248
- ['Filipino (Philippines) (Female)', 'fil-PH-Standard-A'],
249
- ['Finnish (Finland) (Female)', 'fi-FI-Standard-A'],
250
- ['French (Canada) (Female)', 'fr-CA-Standard-A'],
251
- ['French (Canada) (Male)', 'fr-CA-Standard-B'],
252
- ['French (Canada) (Female 2)', 'fr-CA-Standard-C'],
253
- ['French (Canada) (Male 2)', 'fr-CA-Standard-D'],
254
- ['French (France) (Female)', 'fr-FR-Standard-A'],
255
- ['French (France) (Male)', 'fr-FR-Standard-B'],
256
- ['French (France) (Female 2)', 'fr-FR-Standard-C'],
257
- ['French (France) (Male 2)', 'fr-FR-Standard-D'],
258
- ['Greek (Greece) (Female)', 'el-GR-Standard-A'],
259
- ['Hindi (India) (Female)', 'hi-IN-Standard-A'],
260
- ['Hindi (India) (Male)', 'hi-IN-Standard-B'],
261
- ['Hindi (India) (Male 2)', 'hi-IN-Standard-C'],
262
- ['Hungarian (Hungary) (Female)', 'hu-HU-Standard-A'],
263
- ['Indonesian (Indonesia) (Female)', 'id-ID-Standard-A'],
264
- ['Indonesian (Indonesia) (Male)', 'id-ID-Standard-B'],
265
- ['Indonesian (Indonesia) (Male 2)', 'id-ID-Standard-C'],
266
- ['Italian (Italy) (Female)', 'it-IT-Standard-A'],
267
- ['Italian (Italy) (Female 2)', 'it-IT-Standard-B'],
268
- ['Italian (Italy) (Male)', 'it-IT-Standard-C'],
269
- ['Italian (Italy) (Male 2)', 'it-IT-Standard-D'],
270
- ['Japanese (Japan) (Female)', 'ja-JP-Standard-A'],
271
- ['Japanese (Japan) (Female 2)', 'ja-JP-Standard-B'],
272
- ['Japanese (Japan) (Male)', 'ja-JP-Standard-C'],
273
- ['Japanese (Japan) (Male 2)', 'ja-JP-Standard-D'],
274
- ['Korean (South Korea) (Female)', 'ko-KR-Standard-A'],
275
- ['Korean (South Korea) (Female 2)', 'ko-KR-Standard-B'],
276
- ['Korean (South Korea) (Male)', 'ko-KR-Standard-C'],
277
- ['Korean (South Korea) (Male 2)', 'ko-KR-Standard-D'],
278
- ['Mandarin Chinese (Female)', 'cmn-CN-Standard-A'],
279
- ['Mandarin Chinese (Male)', 'cmn-CN-Standard-B'],
280
- ['Mandarin Chinese (Male 2)', 'cmn-CN-Standard-C'],
281
- ['Norwegian (Norway) (Female)', 'nb-NO-Standard-A'],
282
- ['Norwegian (Norway) (Male)', 'nb-NO-Standard-B'],
283
- ['Norwegian (Norway) (Female 2)', 'nb-NO-Standard-C'],
284
- ['Norwegian (Norway) (Male 2)', 'nb-NO-Standard-D'],
285
- ['Norwegian (Norway) (Female 3)', 'nb-no-Standard-E'],
286
- ['Polish (Poland) (Female)', 'pl-PL-Standard-A'],
287
- ['Polish (Poland) (Male)', 'pl-PL-Standard-B'],
288
- ['Polish (Poland) (Male 2)', 'pl-PL-Standard-C'],
289
- ['Polish (Poland) (Female 2)', 'pl-PL-Standard-D'],
290
- ['Polish (Poland) (Female 3)', 'pl-PL-Standard-E'],
291
- ['Portuguese (Brazil) (Female)', 'pt-BR-Standard-A'],
292
- ['Portuguese (Portugal) (Female)', 'pt-PT-Standard-A'],
293
- ['Portuguese (Portugal) (Male)', 'pt-PT-Standard-B'],
294
- ['Portuguese (Portugal) (Male 2)', 'pt-PT-Standard-C'],
295
- ['Portuguese (Portugal) (Female 2)', 'pt-PT-Standard-D'],
296
- ['Slovak (Slovakia) (Female)', 'sk-SK-Standard-A'],
297
- ['Spanish (Spain) (Female)', 'es-ES-Standard-A'],
298
- ['Swedish (Sweden) (Female)', 'sv-SE-Standard-A'],
299
- ['Turkish (Turkey) (Female)', 'tr-TR-Standard-A'],
300
- ['Turkish (Turkey) (Male)', 'tr-TR-Standard-B'],
301
- ['Turkish (Turkey) (Female 2)', 'tr-TR-Standard-C'],
302
- ['Turkish (Turkey) (Female 3)', 'tr-TR-Standard-D'],
303
- ['Turkish (Turkey) (Male)', 'tr-TR-Standard-E'],
304
- ['Ukrainian (Ukraine) (Female)', 'uk-UA-Standard-A'],
305
- ['Vietnamese (Vietnam) (Female)', 'vi-VN-Standard-A'],
306
- ['Vietnamese (Vietnam) (Male)', 'vi-VN-Standard-B'],
307
- ['Vietnamese (Vietnam) (Female 2)', 'vi-VN-Standard-C'],
308
- ['Vietnamese (Vietnam) (Male 2)', 'vi-VN-Standard-D']
309
- ];
310
-
311
- this.appendDummyInput('LANGUAGE')
312
- .appendField(Blockly.Translate('telegram'))
313
- .appendField(new Blockly.FieldDropdown(languages), 'LANGUAGE');
314
-
315
- this.appendDummyInput('REPEATS')
316
- .appendField(Blockly.Translate('telegram_call_repeats'))
317
- .appendField(new Blockly.FieldDropdown([
318
- ['1', '1'],
319
- ['2', '2'],
320
- ['3', '3'],
321
- ['4', '4'],
322
- ['5', '5'],
323
- ]), 'REPEATS');
324
-
325
- this.appendDummyInput('LOG')
326
- .appendField(Blockly.Translate('telegram_log'))
327
- .appendField(new Blockly.FieldDropdown([
328
- [Blockly.Translate('telegram_log_none'), ''],
329
- [Blockly.Translate('telegram_log_debug'), 'debug'],
330
- [Blockly.Translate('telegram_log_info'), 'log'],
331
- [Blockly.Translate('telegram_log_warn'), 'warn'],
332
- [Blockly.Translate('telegram_log_error'), 'error'],
333
- ]), 'LOG');
334
-
335
- this.setInputsInline(false);
336
- this.setPreviousStatement(true, null);
337
- this.setNextStatement(true, null);
338
-
339
- this.setColour(Blockly.Sendto.HUE);
340
- this.setTooltip(Blockly.Translate('telegram_call_tooltip'));
341
- this.setHelpUrl(Blockly.Translate('telegram_call_help'));
342
- },
343
- };
344
-
345
- Blockly.JavaScript['telegram_call'] = function (block) {
346
- const dropdown_instance = block.getFieldValue('INSTANCE');
347
- const dropdown_language = block.getFieldValue('LANGUAGE');
348
- const repeats = block.getFieldValue('REPEATS');
349
- const logLevel = block.getFieldValue('LOG');
350
- const value_message = Blockly.JavaScript.valueToCode(block, 'MESSAGE', Blockly.JavaScript.ORDER_ATOMIC);
351
- const value_username = Blockly.JavaScript.valueToCode(block, 'USERNAME', Blockly.JavaScript.ORDER_ATOMIC);
352
-
353
- let logText = '';
354
- if (logLevel) {
355
- const logUsername = value_username ? `[' + ${value_username} + ']` : '';
356
- logText = `console.${logLevel}('telegramCall${logUsername}: ' + ${value_message});\n`;
357
- }
358
-
359
- return `sendTo('telegram${dropdown_instance}', 'call', {\n` +
360
- ` text: ${value_message},\n` +
361
- (value_username ? ` user: ${value_username},\n` : '') +
362
- ` lang: '${dropdown_language}',\n` +
363
- ` repeats: ${parseInt(repeats, 10) || 1},\n` +
364
- `});\n${logText}`;
365
- };
366
-
367
- // --- SendTo ask telegram --------------------------------------------------
368
- Blockly.Words['telegram_ask'] = { 'en': 'ask via Telegram', 'de': 'fragen per Telegram', 'ru': 'спрос через Telegram', 'pt': 'perguntar via Telegram', 'nl': 'vragen via Telegram', 'fr': 'demander via Telegram', 'it': 'chiedere via Telegram', 'es': 'pregunte por Telegram', 'pl': 'pytaj przez Telegram', 'uk': 'подати заявку', 'zh-cn': '通过Telegram 查询' };
369
- Blockly.Words['telegram_ask_question'] = { 'en': 'Question', 'de': 'Frage', 'ru': 'Вопрос', 'pt': 'Pergunta', 'nl': 'Vraag', 'fr': 'Question', 'it': 'Domanda', 'es': 'Pregunta', 'pl': 'Pytanie', 'uk': 'Питання', 'zh-cn': '问题' };
370
- Blockly.Words['telegram_ask_answers'] = { 'en': 'Answers', 'de': 'Antworten', 'ru': 'Ответы', 'pt': 'Respostas', 'nl': 'Antwoorden', 'fr': 'Réponses', 'it': 'Risposte', 'es': 'Respuestas', 'pl': 'Odpowiedzi', 'uk': 'Відповідей', 'zh-cn': '答复' };
371
- Blockly.Words['telegram_ask_answer'] = { 'en': 'Answer', 'de': 'Antwort', 'ru': 'Ответ', 'pt': 'Resposta', 'nl': 'Antwoord', 'fr': 'Réponse', 'it': 'Risposta', 'es': 'Respuesta', 'pl': 'Odpowiedź', 'uk': 'Відправити', 'zh-cn': '答复' };
372
-
373
- Blockly.Sendto.blocks['telegram_ask'] =
374
- '<sep gap="5"></sep>' +
375
- '<block type="telegram_ask">' +
376
- ' <mutation>' +
377
- ' <answer id="ANSWER_0" name="yes"></answer>' +
378
- ' </mutation>' +
379
- ' <field name="INSTANCE"></field>' +
380
- ' <field name="LOG"></field>' +
381
- ' <field name="PARSEMODE">default</field>' +
382
- ' <value name="QUESTION">' +
383
- ' <shadow type="text">' +
384
- ' <field name="TEXT">text</field>' +
385
- ' </shadow>' +
386
- ' </value>' +
387
- ' <value name="ANSWER_0">' +
388
- ' <shadow type="text">' +
389
- ' <field name="TEXT">Yes, please</field>' +
390
- ' </shadow>' +
391
- ' </value>' +
392
- '</block>';
393
-
394
- Blockly.Blocks['telegram_ask_container'] = {
395
- /**
396
- * Mutator block for container.
397
- * @this Blockly.Block
398
- */
399
- init: function () {
400
- this.setColour(Blockly.Object.HUE);
401
-
402
- this.appendDummyInput()
403
- .appendField(Blockly.Translate('telegram_ask_answers'));
404
-
405
- this.appendStatementInput('STACK');
406
- this.setTooltip(Blockly.Translate('object_new_tooltip'));
407
-
408
- this.contextMenu = false;
409
- },
410
- };
411
-
412
- Blockly.Blocks['telegram_ask_mutator'] = {
413
- /**
414
- * Mutator block for add items.
415
- * @this Blockly.Block
416
- */
417
- init: function () {
418
- this.setColour(Blockly.Sendto.HUE);
419
-
420
- this.appendDummyInput('ANSWER')
421
- .appendField(Blockly.Translate('telegram_ask_answer'))
422
- .appendField(new Blockly.FieldTextInput('okay'), 'ANSWER');
423
-
424
- this.setPreviousStatement(true);
425
- this.setNextStatement(true);
426
-
427
- this.setTooltip(Blockly.Translate('telegram_ask_tooltip'));
428
-
429
- this.contextMenu = false;
430
- },
431
- };
432
-
433
- Blockly.Blocks['telegram_ask'] = {
434
- init: function () {
435
- this.answers_ = [];
436
- this.itemCount_ = 0;
437
- if (typeof Blockly.icons === 'object') {
438
- this.setMutator(new Blockly.icons.MutatorIcon(['telegram_ask_mutator'], this));
439
- } else {
440
- // Blockly 9.x
441
- this.setMutator(new Blockly.Mutator(['telegram_ask_mutator'], this));
442
- }
443
-
444
- const options = [[Blockly.Translate('telegram_anyInstance'), '']];
445
- if (typeof main !== 'undefined' && main.instances) {
446
- for (let i = 0; i < main.instances.length; i++) {
447
- const m = main.instances[i].match(/^system.adapter.telegram.(\d+)$/);
448
- if (m) {
449
- const k = parseInt(m[1], 10);
450
- options.push(['telegram.' + k, '.' + k]);
451
- }
452
- }
453
- if (options.length === 0) {
454
- for (let u = 0; u <= 4; u++) {
455
- options.push(['telegram.' + u, '.' + u]);
456
- }
457
- }
458
- } else {
459
- for (let n = 0; n <= 4; n++) {
460
- options.push(['telegram.' + n, '.' + n]);
461
- }
462
- }
463
-
464
- this.appendDummyInput('INSTANCE')
465
- .appendField(Blockly.Translate('telegram_ask'))
466
- .appendField(new Blockly.FieldDropdown(options), 'INSTANCE');
467
-
468
- this.appendValueInput('QUESTION')
469
- .appendField(Blockly.Translate('telegram_ask_question'));
470
-
471
- const inputUser = this.appendValueInput('USERNAME')
472
- .setCheck('String')
473
- .appendField(Blockly.Translate('telegram_username'));
474
- if (inputUser.connection) {
475
- inputUser.connection._optional = true;
476
- }
477
-
478
- const inputChat = this.appendValueInput('CHATID')
479
- .setCheck('String')
480
- .appendField(Blockly.Translate('telegram_chatid'));
481
- if (inputChat.connection) {
482
- inputChat.connection._optional = true;
483
- }
484
-
485
- this.appendDummyInput('LOG')
486
- .appendField(Blockly.Translate('telegram_log'))
487
- .appendField(new Blockly.FieldDropdown([
488
- [Blockly.Translate('telegram_log_none'), ''],
489
- [Blockly.Translate('telegram_log_debug'), 'debug'],
490
- [Blockly.Translate('telegram_log_info'), 'log'],
491
- [Blockly.Translate('telegram_log_warn'), 'warn'],
492
- [Blockly.Translate('telegram_log_error'), 'error'],
493
- ]), 'LOG');
494
-
495
- this.appendDummyInput('PARSEMODE')
496
- .appendField('Parsemode')
497
- .appendField(new Blockly.FieldDropdown([[Blockly.Translate('telegram_parsemode_default'), 'default'], ['HTML', 'HTML'], ['MarkdownV2', 'MarkdownV2']]), 'PARSEMODE');
498
-
499
- this.setInputsInline(false);
500
- this.setPreviousStatement(true, null);
501
- this.setNextStatement(true, null);
502
-
503
- this.setColour(Blockly.Sendto.HUE);
504
- this.setTooltip(Blockly.Translate('telegram_tooltip'));
505
- this.setHelpUrl(Blockly.Translate('telegram_help'));
506
- },
507
- /**
508
- * Create XML to represent number of text inputs.
509
- * @return {!Element} XML storage element.
510
- * @this Blockly.Block
511
- */
512
- mutationToDom: function () {
513
- const container = document.createElement('mutation');
514
-
515
- for (let i = 0; i < this.answers_.length; i++) {
516
- const parameter = document.createElement('answer');
517
- parameter.setAttribute('id', 'ANSWER_' + i);
518
- parameter.setAttribute('name', this.answers_[i]);
519
- container.appendChild(parameter);
520
- }
521
-
522
- return container;
523
- },
524
- /**
525
- * Parse XML to restore the text inputs.
526
- * @param {!Element} xmlElement XML storage element.
527
- * @this Blockly.Block
528
- */
529
- domToMutation: function (xmlElement) {
530
- this.answers_ = [];
531
-
532
- for (let i = 0, childNode; (childNode = xmlElement.childNodes[i]); i++) {
533
- if (childNode.nodeName.toLowerCase() === 'answer') {
534
- this.answers_.push(childNode.getAttribute('name'));
535
- }
536
- }
537
-
538
- this.itemCount_ = this.answers_.length;
539
- this.updateShape_();
540
- },
541
- /**
542
- * Populate the mutator's dialog with this block's components.
543
- * @param {!Blockly.Workspace} workspace Mutator's workspace.
544
- * @return {!Blockly.Block} Root block in mutator.
545
- * @this Blockly.Block
546
- */
547
- decompose: function (workspace) {
548
- const containerBlock = workspace.newBlock('telegram_ask_container');
549
- containerBlock.initSvg();
550
-
551
- let connection = containerBlock.getInput('STACK').connection;
552
- for (let i = 0; i < this.itemCount_; i++) {
553
- const itemBlock = workspace.newBlock('telegram_ask_mutator');
554
- itemBlock.setFieldValue(this.answers_[i], 'ANSWER');
555
- itemBlock.initSvg();
556
- connection.connect(itemBlock.previousConnection);
557
- connection = itemBlock.nextConnection;
558
- }
559
-
560
- return containerBlock;
561
- },
562
- /**
563
- * Reconfigure this block based on the mutator dialog's components.
564
- * @param {!Blockly.Block} containerBlock Root block in mutator.
565
- * @this Blockly.Block
566
- */
567
- compose: function (containerBlock) {
568
- this.answers_ = [];
569
-
570
- let itemBlock = containerBlock.getInputTargetBlock('STACK');
571
- // Count number of inputs.
572
- const connections = [];
573
- while (itemBlock) {
574
- const attrName = itemBlock.getFieldValue('ANSWER');
575
- this.answers_.push(attrName);
576
-
577
- connections.push(itemBlock.valueConnection_);
578
- itemBlock = itemBlock.nextConnection &&
579
- itemBlock.nextConnection.targetBlock();
580
- }
581
-
582
- // Disconnect any children that don't belong.
583
- for (let k = 0; k < this.itemCount_; k++) {
584
- const connection = this.getInput('ANSWER_' + k).connection.targetConnection;
585
- if (connection && !connections.includes(connection)) {
586
- connection.disconnect();
587
- }
588
- }
589
-
590
- this.itemCount_ = connections.length;
591
- if (this.itemCount_ < 0) {
592
- this.itemCount_ = 0;
593
- }
594
- this.updateShape_();
595
-
596
- // Reconnect any child blocks.
597
- for (let i = 0; i < this.itemCount_; i++) {
598
- Blockly.icons.MutatorIcon.reconnect(connections[i], this, 'ANSWER_' + i);
599
- }
600
- },
601
- /**
602
- * Store pointers to any connected child blocks.
603
- * @param {!Blockly.Block} containerBlock Root block in mutator.
604
- * @this Blockly.Block
605
- */
606
- saveConnections: function (containerBlock) {
607
- let itemBlock = containerBlock.getInputTargetBlock('STACK');
608
- let i = 0;
609
-
610
- while (itemBlock) {
611
- const input = this.getInput('ANSWER_' + i);
612
- itemBlock.valueConnection_ = input && input.connection.targetConnection;
613
- i++;
614
- itemBlock = itemBlock.nextConnection &&
615
- itemBlock.nextConnection.targetBlock();
616
- }
617
- },
618
- /**
619
- * Modify this block to have the correct number of inputs.
620
- * @private
621
- * @this Blockly.Block
622
- */
623
- updateShape_: function () {
624
- const workspace = this.workspace;
625
-
626
- // Add new inputs.
627
- for (let i = 0; i < this.itemCount_; i++) {
628
- let input = this.getInput('ANSWER_' + i);
629
-
630
- if (!input) {
631
- input = this.appendValueInput('ANSWER_' + i).setAlign(Blockly.ALIGN_RIGHT);
632
- input.appendField(this.answers_[i]);
633
- } else {
634
- input.fieldRow[0].setValue(this.answers_[i]);
635
- }
636
-
637
- let statement = this.getInput('STATEMENT_' + i);
638
- if (!statement) {
639
- statement = this.appendStatementInput('STATEMENT_' + i);
640
- }
641
-
642
- setTimeout(__input => {
643
- if (!__input.connection.isConnected()) {
644
- const _shadow = workspace.newBlock('text');
645
- _shadow.setShadow(true);
646
- _shadow.setFieldValue('text', 'TEXT');
647
- _shadow.initSvg();
648
- _shadow.render();
649
- _shadow.outputConnection.connect(__input.connection);
650
- }
651
- }, 100, input);
652
- }
653
-
654
- // Remove deleted inputs.
655
- for (let i = this.itemCount_; this.getInput('ANSWER_' + i); i++) {
656
- this.removeInput('ANSWER_' + i);
657
- this.removeInput('STATEMENT_' + i);
658
- }
659
- },
660
- };
661
-
662
- Blockly.JavaScript['telegram_ask'] = function(block) {
663
- const answers = [];
664
- for (let id = 0; id < block.itemCount_; id++) {
665
- const answer = Blockly.JavaScript.valueToCode(block, 'ANSWER_' + id, Blockly.JavaScript.ORDER_ATOMIC);
666
- const statement = Blockly.JavaScript.statementToCode(block, 'STATEMENT_' + id);
667
- if (answer && statement) {
668
- answers.push({ id, answer, statement });
669
- }
670
- }
671
-
672
- const dropdown_instance = block.getFieldValue('INSTANCE');
673
- const logLevel = block.getFieldValue('LOG');
674
- const parsemode = block.getFieldValue('PARSEMODE');
675
- const valueQuestion = Blockly.JavaScript.valueToCode(block, 'QUESTION', Blockly.JavaScript.ORDER_ATOMIC);
676
- const valueUsername = Blockly.JavaScript.valueToCode(block, 'USERNAME', Blockly.JavaScript.ORDER_ATOMIC);
677
- const valueChatId = Blockly.JavaScript.valueToCode(block, 'CHATID', Blockly.JavaScript.ORDER_ATOMIC);
678
-
679
- let logText = '';
680
- if (logLevel) {
681
- const logUsername = valueUsername ? `[' + ${valueUsername} + ']` : '';
682
- logText = `console.${logLevel}('telegramAsk${logUsername}: ' + ${valueQuestion});\n`;
683
- }
684
-
685
- let logAnswer = '';
686
- if (logLevel) {
687
- logAnswer = ` console.${logLevel}('telegramAsk answer: ' + (msg?.data ?? '[no answer]'));\n`;
688
- }
689
-
690
- return `sendTo('telegram${dropdown_instance}', 'ask', {\n` +
691
- ` text: ${valueQuestion},\n` +
692
- (valueUsername ? ` user: ${valueUsername},\n` : '') +
693
- (valueChatId ? ` chatId: ${valueChatId},\n` : '') +
694
- (parsemode !== 'default' ? ` parse_mode: '${parsemode}',\n` : '') +
695
- ` reply_markup: {\n` +
696
- ` inline_keyboard: [\n` +
697
- answers.map(a => ` [ { text: ${a.answer}, callback_data: '${a.id}' } ],`).join('\n') + '\n' +
698
- ` ],\n` +
699
- ` }\n` +
700
- `}, async (msg) => {\n${logAnswer}` +
701
- answers.map(a => ` if (msg?.data && msg.data == '${a.id}') {\n${Blockly.JavaScript.prefixLines(a.statement, Blockly.JavaScript.INDENT)} }`).join('\n') +
702
- `\n});\n${logText}`;
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
+ })();