iobroker.telegram 6.0.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/admin/blockly.js +53 -5
- package/admin/custom/assets/Components-joLukTKa.js +1 -0
- package/admin/custom/assets/TelegramComponent-C3-GtI7c.js +1 -0
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomTelegramSet__mf_owner__1-DJIdwwyD.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-BqNtIUwy.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-_NCgGj0v.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-xkznT_KX.js +1386 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__loadShare__shared-AcdRJ9g1.js +2 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__prebuild___mf_0_iobroker_mf_1_json_mf_2_config__prebuild__-CzaA27i4.js +122 -0
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-HABeMIRl.js → _virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-M61rjtmp.js} +1 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__228362784883620__prebuild__react_mf_2_dom_mf_1_client__prebuild__-OUz4TPLO.js +9 -0
- package/admin/custom/assets/dist-ClWhWsnT.js +1 -0
- package/admin/custom/assets/helpers-DYkm0lQU.js +1 -0
- package/admin/custom/assets/hostInit-CR7X3BVU.js +1 -0
- package/admin/custom/assets/iconLibraryData-B5fiyl1C.js +1 -0
- package/admin/custom/assets/index-DASuFkWw.js +1 -0
- package/admin/custom/assets/lib-Bo8s9r0H.js +3 -0
- package/admin/custom/assets/{mf-entry-bootstrap-0-df2bf7ab.js → mf-entry-bootstrap-0-153fe003.js} +3 -3
- package/admin/custom/assets/pendingShares-BLi3_Mzu.js +2 -0
- package/admin/custom/assets/prod-B1LT4e-j.js +502 -0
- package/admin/custom/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/admin/custom/assets/utils-BLvN1RVq.js +4 -0
- package/admin/custom/assets/vite-preload-helper-BbbETgeG.js +1 -0
- package/admin/custom/customComponents.js +2 -2
- package/admin/custom/i18n/de.json +6 -6
- package/admin/custom/i18n/en.json +6 -6
- package/admin/custom/i18n/es.json +6 -6
- package/admin/custom/i18n/fr.json +6 -6
- package/admin/custom/i18n/it.json +6 -6
- package/admin/custom/i18n/nl.json +6 -6
- package/admin/custom/i18n/pl.json +6 -6
- package/admin/custom/i18n/pt.json +6 -6
- package/admin/custom/i18n/ru.json +6 -6
- package/admin/custom/i18n/uk.json +6 -6
- package/admin/custom/i18n/zh-cn.json +6 -6
- package/admin/i18n/de.json +1 -0
- package/admin/i18n/en.json +1 -0
- package/admin/i18n/es.json +3 -2
- package/admin/i18n/fr.json +2 -1
- package/admin/i18n/it.json +2 -1
- package/admin/i18n/nl.json +1 -0
- package/admin/i18n/pl.json +1 -0
- package/admin/i18n/pt.json +2 -1
- package/admin/i18n/ru.json +1 -0
- package/admin/i18n/uk.json +11 -10
- package/admin/i18n/zh-cn.json +1 -0
- package/admin/rules/@mf-types.zip +0 -0
- package/admin/rules/assets/{ActionTelegram-LF8bnDSA.js → ActionTelegram-DYcZv36t.js} +1 -1
- package/admin/rules/assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BsHXqCvo.js +1 -0
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__loadShare__shared-BIBHA1kT.js +2 -0
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DpkR8IYJ.js +1358 -0
- package/admin/rules/assets/{_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__prop_mf_2_types__prebuild__-uB_fYF0E.js → _virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__prop_mf_2_types__prebuild__-B1D0xwSZ.js} +1 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react__prebuild__-CCVlBWKm.js +1 -0
- package/admin/rules/assets/{_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CtgG8yGZ.js → _virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-lLn5ruiO.js} +1 -1
- package/admin/rules/assets/{_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom__prebuild__-Dh8puMC1.js → _virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom__prebuild__-h_a0kZzS.js} +1 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom_mf_1_client__prebuild__-BRmB6rdf.js +9 -0
- package/admin/rules/assets/bootstrap-770dTuCT.js +1 -0
- package/admin/rules/assets/dist-CWBlVvfj.js +1 -0
- package/admin/rules/assets/helpers-BtFDi3IY.js +1 -0
- package/admin/rules/assets/hostInit-DHMkrH3X.js +1 -0
- package/admin/rules/assets/iconLibraryData-B5fiyl1C.js +1 -0
- package/admin/rules/assets/index-ClFbFt3x.js +2 -0
- package/admin/rules/assets/{mf-entry-bootstrap-0-5a126c10.js → mf-entry-bootstrap-0-6b56715e.js} +3 -3
- package/admin/rules/assets/pendingShares-qfYu7oWw.js +2 -0
- package/admin/rules/assets/prod-CbyVAouU.js +502 -0
- package/admin/rules/assets/react-BZk3575t.js +1 -0
- package/admin/rules/assets/react-dom-1nogLxXJ.js +1 -0
- package/admin/rules/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/admin/rules/assets/utils-BQKOadwq.js +4 -0
- package/admin/rules/assets/vite-preload-helper-BbbETgeG.js +1 -0
- package/admin/rules/customRuleBlocks.js +2 -2
- package/admin/rules/i18n/de.json +7 -7
- package/admin/rules/i18n/en.json +7 -7
- package/admin/rules/i18n/es.json +7 -7
- package/admin/rules/i18n/fr.json +7 -7
- package/admin/rules/i18n/it.json +7 -7
- package/admin/rules/i18n/nl.json +7 -7
- package/admin/rules/i18n/pl.json +7 -7
- package/admin/rules/i18n/pt.json +7 -7
- package/admin/rules/i18n/ru.json +7 -7
- package/admin/rules/i18n/uk.json +7 -7
- package/admin/rules/i18n/zh-cn.json +7 -7
- package/admin/rules/index.html +3 -2
- package/admin/rules/mf-manifest.json +1 -1
- package/admin/rules/mf-stats.json +1 -1
- package/build/main.d.ts +9 -1
- package/build/main.js +178 -50
- package/build/main.js.map +1 -1
- package/build/types.d.ts +5 -0
- package/i18n/de.json +1 -1
- package/i18n/en.json +2 -2
- package/io-package.json +14 -14
- package/package.json +6 -6
- package/admin/custom/assets/Components-D_wyfR3E.js +0 -1
- package/admin/custom/assets/TelegramComponent-mtwgdiDL.js +0 -1
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomTelegramSet__mf_owner__1-B79-UQNs.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-Cf0HuXvk.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-D4WsXgCI.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js--1ddskV_.js +0 -1217
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-B_Noke_B.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-hSzk9lxI.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__prebuild___mf_0_iobroker_mf_1_json_mf_2_config__prebuild__-CTtfI7qj.js +0 -122
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomTelegramSet__mf_owner__110562917496850__prebuild__react_mf_2_dom_mf_1_client__prebuild__-CDCo4Xq9.js +0 -9
- package/admin/custom/assets/dist-D4uJqRBO.js +0 -4
- package/admin/custom/assets/hostInit-CuMnfnDC.js +0 -1
- package/admin/custom/assets/index-DvK7dHLG.js +0 -1
- package/admin/custom/assets/lib-CrKlFI04.js +0 -3
- package/admin/custom/assets/pendingShares-Cxf76vil.js +0 -1
- package/admin/custom/assets/rolldown-runtime-C0FnF6B9.js +0 -1
- package/admin/custom/assets/virtualExposes-Ditkhfhv.js +0 -1
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomTelegramSet__customComponents_js-CVo5tXt9.js +0 -1
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomTelegramSet__customComponents_js-YXqBAHsP.js +0 -2
- package/admin/custom/assets/vite-preload-helper-CaC3yEL3.js +0 -1
- package/admin/rules/assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BvzkKHbn.js +0 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Dbd89DjA.js +0 -2
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__prop_mf_2_types__loadShare__.js-BytPB1-A.js +0 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react__loadShare__.js-BjT36qD9.js +0 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-Ce-vuE6u.js +0 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_2_dom__loadShare__.js-BhMYnOkj.js +0 -2
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-UxQBSbjm.js +0 -2
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DoGm_8Dn.js +0 -1187
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js +0 -1
- package/admin/rules/assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom_mf_1_client__prebuild__-C_ZCK_bw.js +0 -9
- package/admin/rules/assets/bootstrap-7ieO1qm_.js +0 -1
- package/admin/rules/assets/dist-DHz0uAC3.js +0 -4
- package/admin/rules/assets/hostInit-Hz1_LmSZ.js +0 -1
- package/admin/rules/assets/index-CrXv2SiL.js +0 -2
- package/admin/rules/assets/pendingShares-B6ElLznA.js +0 -1
- package/admin/rules/assets/react-dom-CM5my6za.js +0 -1
- package/admin/rules/assets/rolldown-runtime-B0Z9INg1.js +0 -1
- package/admin/rules/assets/virtualExposes-DrYqIznn.js +0 -1
- package/admin/rules/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-BD5Ca8t-.js +0 -1
- package/admin/rules/assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-DMAzv1EL.js +0 -2
- package/admin/rules/assets/vite-preload-helper-AwKPl3Sr.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"ActionTelegram","name":"ActionTelegram","metaData":{"name":"ActionTelegram","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"ActionTelegram"},"remoteEntry":{"name":"customRuleBlocks.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"customRuleBlocks.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"ActionTelegram","pluginVersion":"1.21.6","publicPath":"auto"},"shared":[{"id":"ActionTelegram:react","name":"react","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.2.3","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__prop_mf_2_types__prebuild__-uB_fYF0E.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom__prebuild__-Dh8puMC1.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CtgG8yGZ.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DoGm_8Dn.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:react-dom","name":"react-dom","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom__prebuild__-Dh8puMC1.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__prop_mf_2_types__prebuild__-uB_fYF0E.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:react/jsx-runtime","name":"react/jsx-runtime","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CtgG8yGZ.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:react-dom/client","name":"react-dom/client","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom_mf_1_client__prebuild__-C_ZCK_bw.js"],"sync":[]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[{"id":"ActionTelegram:ActionTelegram","name":"ActionTelegram","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DoGm_8Dn.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__prop_mf_2_types__loadShare__.js-BytPB1-A.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react__loadShare__.js-BjT36qD9.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_2_dom__loadShare__.js-BhMYnOkj.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-Ce-vuE6u.js"],"sync":["assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-BD5Ca8t-.js","assets/vite-preload-helper-AwKPl3Sr.js","assets/dist-DHz0uAC3.js","assets/rolldown-runtime-B0Z9INg1.js","assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BvzkKHbn.js","assets/virtualExposes-DrYqIznn.js","assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-DMAzv1EL.js","assets/ActionTelegram-LF8bnDSA.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Dbd89DjA.js","assets/defineProperty-BbfpZ9Tg.js"]},"css":{"async":[],"sync":[]}},"path":"./ActionTelegram"}],"buildOutput":[{"fileName":"assets/ActionTelegram-LF8bnDSA.js","type":"chunk","isEntry":true,"size":3289},{"fileName":"assets/hostInit-Hz1_LmSZ.js","type":"chunk","isEntry":false,"size":3071},{"fileName":"assets/index-CrXv2SiL.js","type":"chunk","isEntry":true,"size":998},{"fileName":"assets/pendingShares-B6ElLznA.js","type":"chunk","isEntry":false,"size":2252},{"fileName":"assets/virtualExposes-DrYqIznn.js","type":"chunk","isEntry":false,"size":126},{"fileName":"customRuleBlocks.js","type":"chunk","isEntry":false,"size":990},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BvzkKHbn.js","type":"chunk","isEntry":false,"size":4154},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Dbd89DjA.js","type":"chunk","isEntry":false,"size":8089},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__prop_mf_2_types__loadShare__.js-BytPB1-A.js","type":"chunk","isEntry":false,"size":3363},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react__loadShare__.js-BjT36qD9.js","type":"chunk","isEntry":false,"size":4632},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-Ce-vuE6u.js","type":"chunk","isEntry":false,"size":2741},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_2_dom__loadShare__.js-BhMYnOkj.js","type":"chunk","isEntry":false,"size":3389},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-UxQBSbjm.js","type":"chunk","isEntry":false,"size":2726},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DoGm_8Dn.js","type":"chunk","isEntry":false,"size":2059791},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__prop_mf_2_types__prebuild__-uB_fYF0E.js","type":"chunk","isEntry":false,"size":1418},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","type":"chunk","isEntry":false,"size":9628},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CtgG8yGZ.js","type":"chunk","isEntry":false,"size":526},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom__prebuild__-Dh8puMC1.js","type":"chunk","isEntry":false,"size":763},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom_mf_1_client__prebuild__-C_ZCK_bw.js","type":"chunk","isEntry":false,"size":207777},{"fileName":"assets/bootstrap-7ieO1qm_.js","type":"chunk","isEntry":false,"size":536},{"fileName":"assets/defineProperty-BbfpZ9Tg.js","type":"chunk","isEntry":false,"size":707},{"fileName":"assets/dist-DHz0uAC3.js","type":"chunk","isEntry":false,"size":66841},{"fileName":"assets/react-dom-CM5my6za.js","type":"chunk","isEntry":false,"size":4019},{"fileName":"assets/rolldown-runtime-B0Z9INg1.js","type":"chunk","isEntry":false,"size":901},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-BD5Ca8t-.js","type":"chunk","isEntry":false,"size":18879},{"fileName":"assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-DMAzv1EL.js","type":"chunk","isEntry":false,"size":1053},{"fileName":"assets/vite-preload-helper-AwKPl3Sr.js","type":"chunk","isEntry":false,"size":1348},{"fileName":"index.html","type":"asset","isEntry":false,"size":1356},{"fileName":"assets/mf-entry-bootstrap-0-5a126c10.js","type":"asset","isEntry":false,"size":2162}],"assetAnalysis":{"./src/ActionTelegram.tsx":{"js":{"sync":["assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ActionTelegram__customRuleBlocks_js-BD5Ca8t-.js","assets/vite-preload-helper-AwKPl3Sr.js","assets/dist-DHz0uAC3.js","assets/rolldown-runtime-B0Z9INg1.js","assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BvzkKHbn.js","assets/virtualExposes-DrYqIznn.js","assets/virtual_mf-exposes___mfe_internal__ActionTelegram__customRuleBlocks_js-DMAzv1EL.js","assets/ActionTelegram-LF8bnDSA.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Dbd89DjA.js","assets/defineProperty-BbfpZ9Tg.js"],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DoGm_8Dn.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__prop_mf_2_types__loadShare__.js-BytPB1-A.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react__loadShare__.js-BjT36qD9.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_2_dom__loadShare__.js-BhMYnOkj.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-Ce-vuE6u.js"]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__prop_mf_2_types__prebuild__-uB_fYF0E.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom__prebuild__-Dh8puMC1.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CtgG8yGZ.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DoGm_8Dn.js"]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__prop_mf_2_types__prebuild__-uB_fYF0E.js"]},"css":{"sync":[],"async":[]}},"react":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js"]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CtgG8yGZ.js"]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom__prebuild__-Dh8puMC1.js"]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react__prebuild__-D6jUEQ6q.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__133816889156788__prebuild__react_mf_2_dom_mf_1_client__prebuild__-C_ZCK_bw.js"]},"css":{"sync":[],"async":[]}}}}
|
|
1
|
+
{"id":"ActionTelegram","name":"ActionTelegram","metaData":{"name":"ActionTelegram","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"ActionTelegram"},"remoteEntry":{"name":"customRuleBlocks.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"ActionTelegram","pluginVersion":"1.23.4","publicPath":"auto"},"shared":[{"id":"ActionTelegram:react","name":"react","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react__prebuild__-CCVlBWKm.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.3.15","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/prod-CbyVAouU.js","assets/iconLibraryData-B5fiyl1C.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DpkR8IYJ.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__prop_mf_2_types__prebuild__-B1D0xwSZ.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react__prebuild__-CCVlBWKm.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom__prebuild__-h_a0kZzS.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-lLn5ruiO.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom_mf_1_client__prebuild__-BRmB6rdf.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:react-dom","name":"react-dom","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom__prebuild__-h_a0kZzS.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__prop_mf_2_types__prebuild__-B1D0xwSZ.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:react/jsx-runtime","name":"react/jsx-runtime","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-lLn5ruiO.js"],"sync":[]},"css":{"async":[],"sync":[]}}},{"id":"ActionTelegram:react-dom/client","name":"react-dom/client","version":"19.3.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom_mf_1_client__prebuild__-BRmB6rdf.js"],"sync":[]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[{"id":"ActionTelegram:ActionTelegram","name":"ActionTelegram","assets":{"js":{"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__loadShare__shared-BIBHA1kT.js","assets/react-BZk3575t.js","assets/react-dom-1nogLxXJ.js"],"sync":["assets/dist-CWBlVvfj.js","assets/helpers-BtFDi3IY.js","assets/vite-preload-helper-BbbETgeG.js","assets/utils-BQKOadwq.js","assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BsHXqCvo.js","assets/ActionTelegram-DYcZv36t.js","assets/rolldown-runtime-XKyaHtl9.js","assets/defineProperty-BbfpZ9Tg.js"]},"css":{"async":[],"sync":[]}},"path":"./ActionTelegram"}],"buildOutput":[{"fileName":"assets/ActionTelegram-DYcZv36t.js","type":"chunk","isEntry":true,"size":3250},{"fileName":"assets/hostInit-DHMkrH3X.js","type":"chunk","isEntry":false,"size":5923},{"fileName":"assets/index-ClFbFt3x.js","type":"chunk","isEntry":true,"size":798},{"fileName":"assets/pendingShares-qfYu7oWw.js","type":"chunk","isEntry":false,"size":2188},{"fileName":"customRuleBlocks.js","type":"chunk","isEntry":false,"size":23098},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BsHXqCvo.js","type":"chunk","isEntry":false,"size":5994},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__loadShare__shared-BIBHA1kT.js","type":"chunk","isEntry":false,"size":21323},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DpkR8IYJ.js","type":"chunk","isEntry":false,"size":1955336},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__prop_mf_2_types__prebuild__-B1D0xwSZ.js","type":"chunk","isEntry":false,"size":1418},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react__prebuild__-CCVlBWKm.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-lLn5ruiO.js","type":"chunk","isEntry":false,"size":526},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom__prebuild__-h_a0kZzS.js","type":"chunk","isEntry":false,"size":763},{"fileName":"assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom_mf_1_client__prebuild__-BRmB6rdf.js","type":"chunk","isEntry":false,"size":207546},{"fileName":"assets/bootstrap-770dTuCT.js","type":"chunk","isEntry":false,"size":209},{"fileName":"assets/defineProperty-BbfpZ9Tg.js","type":"chunk","isEntry":false,"size":707},{"fileName":"assets/dist-CWBlVvfj.js","type":"chunk","isEntry":false,"size":298},{"fileName":"assets/helpers-BtFDi3IY.js","type":"chunk","isEntry":false,"size":88},{"fileName":"assets/iconLibraryData-B5fiyl1C.js","type":"chunk","isEntry":false,"size":250966},{"fileName":"assets/prod-CbyVAouU.js","type":"chunk","isEntry":false,"size":432623},{"fileName":"assets/react-BZk3575t.js","type":"chunk","isEntry":false,"size":7876},{"fileName":"assets/react-dom-1nogLxXJ.js","type":"chunk","isEntry":false,"size":3897},{"fileName":"assets/rolldown-runtime-XKyaHtl9.js","type":"chunk","isEntry":false,"size":726},{"fileName":"assets/utils-BQKOadwq.js","type":"chunk","isEntry":false,"size":66555},{"fileName":"assets/vite-preload-helper-BbbETgeG.js","type":"chunk","isEntry":false,"size":1566},{"fileName":"index.html","type":"asset","isEntry":false,"size":1063},{"fileName":"assets/mf-entry-bootstrap-0-6b56715e.js","type":"asset","isEntry":false,"size":2162}],"assetAnalysis":{"./src/ActionTelegram.tsx":{"js":{"sync":["assets/dist-CWBlVvfj.js","assets/helpers-BtFDi3IY.js","assets/vite-preload-helper-BbbETgeG.js","assets/utils-BQKOadwq.js","assets/_virtual_mf-localSharedImportMap___mfe_internal__ActionTelegram__mf_owner__1-BsHXqCvo.js","assets/ActionTelegram-DYcZv36t.js","assets/rolldown-runtime-XKyaHtl9.js","assets/defineProperty-BbfpZ9Tg.js"],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__loadShare__shared-BIBHA1kT.js","assets/react-BZk3575t.js","assets/react-dom-1nogLxXJ.js"]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":[],"async":["assets/prod-CbyVAouU.js","assets/iconLibraryData-B5fiyl1C.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild___mf_0_iobroker_mf_1_gui_mf_2_components__prebuild__-DpkR8IYJ.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__prop_mf_2_types__prebuild__-B1D0xwSZ.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react__prebuild__-CCVlBWKm.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom__prebuild__-h_a0kZzS.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-lLn5ruiO.js","assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom_mf_1_client__prebuild__-BRmB6rdf.js"]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__prop_mf_2_types__prebuild__-B1D0xwSZ.js"]},"css":{"sync":[],"async":[]}},"react":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react__prebuild__-CCVlBWKm.js"]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-lLn5ruiO.js"]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom__prebuild__-h_a0kZzS.js"]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":[],"async":["assets/_virtual_mf___mfe_internal__ActionTelegram__mf_owner__34670834521048__prebuild__react_mf_2_dom_mf_1_client__prebuild__-BRmB6rdf.js"]},"css":{"sync":[],"async":[]}}}}
|
package/build/main.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { MessageIds } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Merge the per-recipient results of `sendMessage` - each a JSON `{ "<chatId>": messageId }`, with `error` for a
|
|
4
|
+
* recipient that failed - into one object, e.g. `{ "12345": 678, "error": { "999": "Forbidden: ..." } }`.
|
|
5
|
+
*
|
|
6
|
+
* @param results what `sendMessage` resolved with
|
|
7
|
+
* @returns chat id => message id, plus `error` (chat id => reason) if a recipient failed
|
|
8
|
+
*/
|
|
9
|
+
export declare function mergeMessageIds(results: unknown): MessageIds;
|
package/build/main.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mergeMessageIds = mergeMessageIds;
|
|
6
7
|
const node_fs_1 = require("node:fs");
|
|
7
8
|
const node_path_1 = require("node:path");
|
|
8
9
|
const axios_1 = __importDefault(require("axios"));
|
|
@@ -57,7 +58,42 @@ const INTERNAL_OPTION_KEYS = new Set([
|
|
|
57
58
|
'editMessageCaption',
|
|
58
59
|
'deleteMessage',
|
|
59
60
|
'answerCallbackQuery',
|
|
61
|
+
'returnMessageIds',
|
|
60
62
|
]);
|
|
63
|
+
/**
|
|
64
|
+
* Merge the per-recipient results of `sendMessage` - each a JSON `{ "<chatId>": messageId }`, with `error` for a
|
|
65
|
+
* recipient that failed - into one object, e.g. `{ "12345": 678, "error": { "999": "Forbidden: ..." } }`.
|
|
66
|
+
*
|
|
67
|
+
* @param results what `sendMessage` resolved with
|
|
68
|
+
* @returns chat id => message id, plus `error` (chat id => reason) if a recipient failed
|
|
69
|
+
*/
|
|
70
|
+
function mergeMessageIds(results) {
|
|
71
|
+
const merged = {};
|
|
72
|
+
if (!Array.isArray(results)) {
|
|
73
|
+
return merged;
|
|
74
|
+
}
|
|
75
|
+
for (const item of results) {
|
|
76
|
+
let ids;
|
|
77
|
+
try {
|
|
78
|
+
ids = typeof item === 'string' ? JSON.parse(item) : item;
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (!ids || typeof ids !== 'object') {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
for (const [key, value] of Object.entries(ids)) {
|
|
87
|
+
if (key === 'error' && value && typeof value === 'object') {
|
|
88
|
+
merged.error = { ...merged.error, ...value };
|
|
89
|
+
}
|
|
90
|
+
else if (typeof value === 'number' || typeof value === 'string') {
|
|
91
|
+
merged[key] = value;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return merged;
|
|
96
|
+
}
|
|
61
97
|
/**
|
|
62
98
|
* Pick the Bot API parameters out of the option bag, dropping the adapter-internal keys.
|
|
63
99
|
*
|
|
@@ -1385,8 +1421,10 @@ class Telegram extends adapter_core_1.Adapter {
|
|
|
1385
1421
|
resolve(JSON.stringify(messageIds));
|
|
1386
1422
|
})
|
|
1387
1423
|
.catch(error => {
|
|
1388
|
-
// add the error to the message ids object
|
|
1389
|
-
messageIds.error = {
|
|
1424
|
+
// add the error to the message ids object - as text: an Error object becomes `{}` in JSON
|
|
1425
|
+
messageIds.error = {
|
|
1426
|
+
[String(options.chat_id ?? options.chatId)]: error instanceof Error ? error.message : String(error),
|
|
1427
|
+
};
|
|
1390
1428
|
// log error to the system
|
|
1391
1429
|
this.log.error(`Failed sending [${options.chatId ? 'chatId' : 'user'} - ${options.chatId ? options.chatId : options.user}]: ${error}`);
|
|
1392
1430
|
// If telegram was unreachable, queue the send so it can be retried on reconnect (issue #839).
|
|
@@ -1534,41 +1572,124 @@ class Telegram extends adapter_core_1.Adapter {
|
|
|
1534
1572
|
return Promise.all(tPromiseList).catch(e => e);
|
|
1535
1573
|
}
|
|
1536
1574
|
saveFile(fileID, fileName, callback) {
|
|
1537
|
-
this.
|
|
1538
|
-
|
|
1539
|
-
.then(async (file) => {
|
|
1540
|
-
if (!file.file_path) {
|
|
1541
|
-
throw new Error('telegram did not return a file path');
|
|
1542
|
-
}
|
|
1543
|
-
// the library offers no download helper, so build the file URL ourselves
|
|
1544
|
-
const url = `${this.config.baseApiUrl}/file/bot${this.config.token}/${file.file_path}`;
|
|
1545
|
-
this.log.debug(`Download media file: ${url.replace(this.config.token, '<token>')}`);
|
|
1546
|
-
const response = await this.fetchImpl(url);
|
|
1547
|
-
if (!response.ok) {
|
|
1548
|
-
throw new Error(`statusCode ${response.status}`);
|
|
1549
|
-
}
|
|
1550
|
-
const content = Buffer.from(await response.arrayBuffer());
|
|
1551
|
-
if (this.config.saveFilesTo == 'filesystem') {
|
|
1552
|
-
const fileLocation = (0, node_path_1.join)(this.tmpDirName, fileName);
|
|
1553
|
-
(0, node_fs_1.writeFileSync)(fileLocation, content);
|
|
1554
|
-
callback({
|
|
1555
|
-
info: `media file has been saved to "${this.config.saveFilesTo}": ${fileLocation}`,
|
|
1556
|
-
location: this.config.saveFilesTo,
|
|
1557
|
-
path: fileLocation,
|
|
1558
|
-
});
|
|
1559
|
-
}
|
|
1560
|
-
else if (this.config.saveFilesTo == 'iobroker') {
|
|
1561
|
-
const fileLocation = (0, node_path_1.join)(this.tmpDirName, fileName); // TODO: check new urn format https://github.com/ioBroker/ioBroker.js-controller/issues/2710
|
|
1562
|
-
await this.writeFileAsync(this.namespace, fileName, content);
|
|
1563
|
-
callback({
|
|
1564
|
-
info: `media file has been saved to "${this.config.saveFilesTo}": ${fileLocation}`,
|
|
1565
|
-
location: this.config.saveFilesTo,
|
|
1566
|
-
path: fileLocation,
|
|
1567
|
-
});
|
|
1568
|
-
}
|
|
1569
|
-
})
|
|
1575
|
+
this.downloadFile(fileID)
|
|
1576
|
+
.then(content => this.storeFile(fileName, content, callback))
|
|
1570
1577
|
.catch(err => callback({ error: `Error: ${err}` }));
|
|
1571
1578
|
}
|
|
1579
|
+
/**
|
|
1580
|
+
* Download a file the user sent (photo, voice, document, ...) from the Telegram servers.
|
|
1581
|
+
*
|
|
1582
|
+
* @param fileID the Telegram file id
|
|
1583
|
+
*/
|
|
1584
|
+
async downloadFile(fileID) {
|
|
1585
|
+
const file = await this.bot.api.getFile({ file_id: fileID });
|
|
1586
|
+
if (!file.file_path) {
|
|
1587
|
+
throw new Error('telegram did not return a file path');
|
|
1588
|
+
}
|
|
1589
|
+
// the library offers no download helper, so build the file URL ourselves
|
|
1590
|
+
const url = `${this.config.baseApiUrl}/file/bot${this.config.token}/${file.file_path}`;
|
|
1591
|
+
this.log.debug(`Download media file: ${url.replace(this.config.token, '<token>')}`);
|
|
1592
|
+
const response = await this.fetchImpl(url);
|
|
1593
|
+
if (!response.ok) {
|
|
1594
|
+
throw new Error(`statusCode ${response.status}`);
|
|
1595
|
+
}
|
|
1596
|
+
return Buffer.from(await response.arrayBuffer());
|
|
1597
|
+
}
|
|
1598
|
+
/** Set once an assistant instance answered a voice message as an empty question (too old for audio). */
|
|
1599
|
+
assistantVoiceWarned = false;
|
|
1600
|
+
/**
|
|
1601
|
+
* Forward a voice message to the ioBroker.assistant instance: it recognises the speech, answers like a text
|
|
1602
|
+
* question (same `source`, so the conversation continues) and returns what it heard. The same user check as for
|
|
1603
|
+
* text messages applies — without it anyone could talk to the assistant just by sending a voice message.
|
|
1604
|
+
*
|
|
1605
|
+
* @param msg the voice message
|
|
1606
|
+
* @param download the running download of the recording (OGG/Opus)
|
|
1607
|
+
*/
|
|
1608
|
+
async askAssistantByVoice(msg, download) {
|
|
1609
|
+
const bot = this.bot;
|
|
1610
|
+
const from = msg.from;
|
|
1611
|
+
const user = !this.config.useUsername ? from.first_name : !from.username ? from.first_name : from.username;
|
|
1612
|
+
const pollingInterval = parseInt(String(this.config.pollingInterval ?? 0), 10) || 0;
|
|
1613
|
+
if (Date.now() - msg.date * 1000 > pollingInterval + 30000) {
|
|
1614
|
+
this.log.warn(`Voice message from ${from.first_name} ignored, because too old`);
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
if ((this.config.password || this.config.doNotAcceptNewUsers) && !this.storedUsers[from.id]) {
|
|
1618
|
+
await bot.api
|
|
1619
|
+
.sendMessage({
|
|
1620
|
+
chat_id: from.id,
|
|
1621
|
+
text: adapter_core_1.I18n.translate(this.config.doNotAcceptNewUsers
|
|
1622
|
+
? 'User is not in the list'
|
|
1623
|
+
: 'Please enter password in form "/password phrase"'),
|
|
1624
|
+
})
|
|
1625
|
+
.catch(error => this.log.error(`send Message Error: ${error}`));
|
|
1626
|
+
return;
|
|
1627
|
+
}
|
|
1628
|
+
const content = await download;
|
|
1629
|
+
const options = msg.is_topic_message ? { message_thread_id: msg.message_thread_id } : undefined;
|
|
1630
|
+
// recognition + answer take a few seconds: show that something is happening
|
|
1631
|
+
bot.api.sendChatAction({ ...options, chat_id: msg.chat.id, action: 'typing' }).catch(() => { });
|
|
1632
|
+
this.log.debug(`Forward voice message from ${user} (${content.length} bytes) to ${this.config.assistantInstance}`);
|
|
1633
|
+
const response = (await this.sendToIfAlive(this.config.assistantInstance, 'ask', {
|
|
1634
|
+
text: '',
|
|
1635
|
+
audio: content.toString('base64'),
|
|
1636
|
+
format: 'ogg',
|
|
1637
|
+
source: `telegram:${user}`,
|
|
1638
|
+
user,
|
|
1639
|
+
chatId: msg.chat.id,
|
|
1640
|
+
userId: from.id.toString(),
|
|
1641
|
+
messageThreadId: msg.is_topic_message ? msg.message_thread_id : 0,
|
|
1642
|
+
}));
|
|
1643
|
+
if (!response) {
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
// an assistant that does not know `audio` sees no text and rejects the request as an empty question
|
|
1647
|
+
if (response.error === 'empty question' && response.heard === undefined) {
|
|
1648
|
+
if (!this.assistantVoiceWarned) {
|
|
1649
|
+
this.assistantVoiceWarned = true;
|
|
1650
|
+
this.log.warn(`${this.config.assistantInstance} cannot recognise voice messages - update ioBroker.assistant to the latest version`);
|
|
1651
|
+
}
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
const answer = response.answer || response.error;
|
|
1655
|
+
if (!answer) {
|
|
1656
|
+
return;
|
|
1657
|
+
}
|
|
1658
|
+
// show what was understood, so a wrong answer can be told apart from a misheard question
|
|
1659
|
+
const text = response.heard ? `🎤 ${response.heard}\n\n${answer}` : answer;
|
|
1660
|
+
this.log.debug(`Assistant response: ${text}`);
|
|
1661
|
+
await bot.api
|
|
1662
|
+
.sendMessage({ ...options, chat_id: msg.chat.id, text })
|
|
1663
|
+
.catch(error => this.log.error(`send Message Error: ${error}`));
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* Store a downloaded file where `saveFilesTo` says (file system or ioBroker file storage).
|
|
1667
|
+
*
|
|
1668
|
+
* @param fileName path below the storage root, e.g. `/voice/temp.ogg`
|
|
1669
|
+
* @param content the file content
|
|
1670
|
+
* @param callback called with the stored location (not called when saving is off)
|
|
1671
|
+
*/
|
|
1672
|
+
async storeFile(fileName, content, callback) {
|
|
1673
|
+
this.log.debug(`Saving media file to ${fileName} (location = ${this.config.saveFilesTo})`);
|
|
1674
|
+
if (this.config.saveFilesTo == 'filesystem') {
|
|
1675
|
+
const fileLocation = (0, node_path_1.join)(this.tmpDirName, fileName);
|
|
1676
|
+
(0, node_fs_1.writeFileSync)(fileLocation, content);
|
|
1677
|
+
callback({
|
|
1678
|
+
info: `media file has been saved to "${this.config.saveFilesTo}": ${fileLocation}`,
|
|
1679
|
+
location: this.config.saveFilesTo,
|
|
1680
|
+
path: fileLocation,
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
else if (this.config.saveFilesTo == 'iobroker') {
|
|
1684
|
+
const fileLocation = (0, node_path_1.join)(this.tmpDirName, fileName); // TODO: check new urn format https://github.com/ioBroker/ioBroker.js-controller/issues/2710
|
|
1685
|
+
await this.writeFileAsync(this.namespace, fileName, content);
|
|
1686
|
+
callback({
|
|
1687
|
+
info: `media file has been saved to "${this.config.saveFilesTo}": ${fileLocation}`,
|
|
1688
|
+
location: this.config.saveFilesTo,
|
|
1689
|
+
path: fileLocation,
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1572
1693
|
getMessage(msg) {
|
|
1573
1694
|
const date = new Date().toISOString().replace(/T/, '_').replace(/\..+/, '').replace(/:/g, '-');
|
|
1574
1695
|
this.log.debug(`Received message: ${JSON.stringify(msg)}`);
|
|
@@ -1616,20 +1737,18 @@ class Telegram extends adapter_core_1.Adapter {
|
|
|
1616
1737
|
});
|
|
1617
1738
|
}
|
|
1618
1739
|
if (msg.voice) {
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
});
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
this.log.error(`Error saving voice file: ${err}`);
|
|
1632
|
-
}
|
|
1740
|
+
// Downloaded once: stored as before (communicate.pathFile) and, with an assistant instance, recognised
|
|
1741
|
+
// and answered there. A voice message with a caption is answered by its caption (text pipeline) instead.
|
|
1742
|
+
const download = this.downloadFile(msg.voice.file_id);
|
|
1743
|
+
if (this.config.assistantInstance && msg.from && !msg.caption) {
|
|
1744
|
+
this.askAssistantByVoice(msg, download).catch(err => this.log.error(`Cannot send voice message to ${this.config.assistantInstance}: ${err}`));
|
|
1745
|
+
}
|
|
1746
|
+
download
|
|
1747
|
+
.then(content => this.storeFile(this.config.saveFiles ? `/voice/${date}.ogg` : '/voice/temp.ogg', content, res => {
|
|
1748
|
+
this.log.info(res.info);
|
|
1749
|
+
this.setStateSafe('communicate.pathFile', { val: res.path, ack: true });
|
|
1750
|
+
}))
|
|
1751
|
+
.catch(err => this.log.debug(`Error saving voice file: ${err}`));
|
|
1633
1752
|
}
|
|
1634
1753
|
else if (this.config.saveFiles && msg.photo) {
|
|
1635
1754
|
try {
|
|
@@ -1786,7 +1905,16 @@ class Telegram extends adapter_core_1.Adapter {
|
|
|
1786
1905
|
tPromise = this.sendMessage(obj.message);
|
|
1787
1906
|
}
|
|
1788
1907
|
tPromise
|
|
1789
|
-
.then(results =>
|
|
1908
|
+
.then(results => {
|
|
1909
|
+
if (!obj.callback) {
|
|
1910
|
+
return;
|
|
1911
|
+
}
|
|
1912
|
+
// Before 5.0 the callback got the message ids, and scripts used them to edit or delete
|
|
1913
|
+
// the message later (#1389). Since then it gets the number of recipients, which newer
|
|
1914
|
+
// scripts rely on - so the ids come on request.
|
|
1915
|
+
const wantIds = typeof obj.message === 'object' && !!obj.message.returnMessageIds;
|
|
1916
|
+
this.sendTo(obj.from, obj.command, wantIds ? mergeMessageIds(results) : results.length, obj.callback);
|
|
1917
|
+
})
|
|
1790
1918
|
.catch(e => this.log.error(`Cannot send command: ${e}`));
|
|
1791
1919
|
}
|
|
1792
1920
|
break;
|