iobroker.telegram-menu
Advanced tools
Comparing version 0.7.0 to 0.7.1
{ | ||
"common": { | ||
"name": "telegram-menu", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"news": { | ||
"0.7.1": { | ||
"en": "bugfix, Error read UserListTypeError: Cannot read properties of undefined", | ||
"de": "bugfix, Fehler lesen UserListType Fehler: Nicht zu lesen Eigenschaften von undefiniert", | ||
"ru": "bugfix, Ошибка читать UserListType Ошибка: Не смогите прочитать свойства неопределенного", | ||
"pt": "bugfix, Erro lido UserListType Erro: Não é possível ler propriedades indefinidas", | ||
"nl": "error las UserListType Error: Kan niet onbepaalde eigenschappen lezen", | ||
"fr": "bugfix, Erreur lire UserListType Erreur: Cannot read properties of undefined", | ||
"it": "bugfix, Error read UserListType Errore: Proprietà di lettura non definite", | ||
"es": "bugfix, Error leer UserListType Error: No se pueden leer propiedades indefinidas", | ||
"pl": "error przeczytał UserListType Error: Cannot czytał właściwości nieokreślone", | ||
"uk": "javaScript licenses API Веб-сайт Go1.13.8 Помилка: Не можна прочитати властивості невизначених", | ||
"zh-cn": "bugfix, Error读者 rror: 评 注" | ||
}, | ||
"0.7.0": { | ||
@@ -83,15 +96,2 @@ "en": "#53 feature: sendPicture von server-path\n#52 icons are missing, copy data\n#51 by creating a new Menu, the Users are not shown", | ||
"zh-cn": "增 编" | ||
}, | ||
"0.6.5": { | ||
"en": "get user by chatID and send back to this chatID", | ||
"de": "benutzer per chatID ermitteln und zurück senden an diese chatID", | ||
"ru": "получить пользователя по чатID и отправить обратно в этот чатID", | ||
"pt": "obter usuário por chatID e enviar de volta para este chatID", | ||
"nl": "haal gebruiker van chatID en stuur terug naar dit chatID", | ||
"fr": "obtenir utilisateur par chatID et renvoyer à ce chatID", | ||
"it": "ottenere l'utente da chatID e tornare a questo chatID", | ||
"es": "obtener usuario por chatID y enviar de nuevo a este chatID", | ||
"pl": "użytkowanie przez czat i wysyłane do tego czatID", | ||
"uk": "отримати користувач по chatID і відправити назад в цей чатID", | ||
"zh-cn": "被混乱者利用,然后再送给这一混乱的裁研所。" | ||
} | ||
@@ -98,0 +98,0 @@ }, |
@@ -21,38 +21,42 @@ /** | ||
) { | ||
_this.log.debug("Send this Value : " + JSON.stringify(value)); | ||
_this.log.debug("Send this to : " + JSON.stringify(user)); | ||
_this.log.debug("Instance : " + JSON.stringify(instance)); | ||
let chatId = ""; | ||
userListWithChatID.forEach((element) => { | ||
if (element.name === user) chatId = element.chatID; | ||
}); | ||
if (keyboard.length == 0) { | ||
_this.sendTo( | ||
instance, | ||
"send", | ||
{ | ||
text: value, | ||
chatId: chatId, | ||
}, | ||
function (res) { | ||
console.log("Sent Value to " + res + " users!"); | ||
}, | ||
); | ||
} else { | ||
_this.sendTo( | ||
instance, | ||
"send", | ||
{ | ||
chatId: chatId, | ||
text: value, | ||
reply_markup: { | ||
keyboard: keyboard, | ||
resize_keyboard: resize_keyboard, | ||
one_time_keyboard: one_time_keyboard, | ||
try { | ||
_this.log.debug("Send this Value : " + JSON.stringify(value)); | ||
_this.log.debug("Send this to : " + JSON.stringify(user)); | ||
_this.log.debug("Instance : " + JSON.stringify(instance)); | ||
let chatId = ""; | ||
userListWithChatID.forEach((element) => { | ||
if (element.name === user) chatId = element.chatID; | ||
}); | ||
if (keyboard.length == 0) { | ||
_this.sendTo( | ||
instance, | ||
"send", | ||
{ | ||
text: value, | ||
chatId: chatId, | ||
}, | ||
}, | ||
function (res) { | ||
console.log("Sent to " + res + " users"); | ||
}, | ||
); | ||
function (res) { | ||
console.log("Sent Value to " + res + " users!"); | ||
}, | ||
); | ||
} else { | ||
_this.sendTo( | ||
instance, | ||
"send", | ||
{ | ||
chatId: chatId, | ||
text: value, | ||
reply_markup: { | ||
keyboard: keyboard, | ||
resize_keyboard: resize_keyboard, | ||
one_time_keyboard: one_time_keyboard, | ||
}, | ||
}, | ||
function (res) { | ||
console.log("Sent to " + res + " users"); | ||
}, | ||
); | ||
} | ||
} catch (e) { | ||
_this.log.error("Error sendToTelegram: " + JSON.stringify(e)); | ||
} | ||
@@ -59,0 +63,0 @@ } |
21
main.js
@@ -70,3 +70,3 @@ "use strict"; | ||
const userListWithChatID = this.config.userListWithChatID; | ||
const menu = { | ||
const menuData = { | ||
data: {}, | ||
@@ -103,6 +103,6 @@ }; | ||
const value = await editArrayButtons(nav[name], this); | ||
if (value) menu.data[name] = await generateNewObjectStructure(_this, value); | ||
this.log.debug("New Structure: " + JSON.stringify(menu.data[name])); | ||
const returnValue = generateActions(_this, action[name], menu.data[name]); | ||
menu.data[name] = returnValue?.obj; | ||
if (value) menuData.data[name] = await generateNewObjectStructure(_this, value); | ||
this.log.debug("New Structure: " + JSON.stringify(menuData.data[name])); | ||
const returnValue = generateActions(_this, action[name], menuData.data[name]); | ||
menuData.data[name] = returnValue?.obj; | ||
subscribeForeignStateIds = returnValue?.ids; | ||
@@ -115,3 +115,3 @@ this.log.debug("SubscribeForeignStates: " + JSON.stringify(subscribeForeignStateIds)); | ||
this.log.debug("Array Buttons: " + JSON.stringify(value)); | ||
this.log.debug("Gen. Actions: " + JSON.stringify(menu.data[name])); | ||
this.log.debug("Gen. Actions: " + JSON.stringify(menuData.data[name])); | ||
} | ||
@@ -133,7 +133,8 @@ } catch (err) { | ||
this.log.debug("User List " + JSON.stringify(userListWithChatID)); | ||
sendToTelegram( | ||
_this, | ||
user, | ||
menu.data[menu][startside].text, | ||
menu.data[menu][startside].nav, | ||
menuData.data[menu][startside].text, | ||
menuData.data[menu][startside].nav, | ||
instanceTelegram, | ||
@@ -195,5 +196,5 @@ resize_keyboard, | ||
for (const group of groups) { | ||
const groupData = menu.data[group]; | ||
const groupData = menuData.data[group]; | ||
this.log.debug("Nav: " + JSON.stringify(groupData)); | ||
this.log.debug("Menu: " + JSON.stringify(menu.data)); | ||
this.log.debug("Menu: " + JSON.stringify(menuData.data)); | ||
this.log.debug("Group: " + JSON.stringify(group)); | ||
@@ -200,0 +201,0 @@ |
{ | ||
"name": "iobroker.telegram-menu", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Easily create Telegram Menus", | ||
@@ -75,3 +75,4 @@ "author": { | ||
"release": "release-script", | ||
"lint:fix": "eslint . --fix" | ||
"lint:fix": "eslint . --fix", | ||
"checker": "node skript.mjs" | ||
}, | ||
@@ -78,0 +79,0 @@ "bugs": { |
@@ -36,2 +36,6 @@ ![Logo](admin/telegram-menu.png) | ||
--> | ||
### 0.7.1 (2023-10-02) | ||
- bugfix, Error read UserListTypeError: Cannot read properties of undefined | ||
### 0.7.0 (2023-10-01) | ||
@@ -38,0 +42,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
327398
3425
196