From 314fa18bdcdab25147d4df3ca3ed754888188e3f Mon Sep 17 00:00:00 2001
From: Adam Stachowicz
- - {{ telegramGetUpdatesURL }} - - - - {{ telegramGetUpdatesURL }} - + {{ telegramGetUpdatesURL() }}
@@ -40,49 +34,47 @@ From ba46fb6b1c126838eae55ed6b5a87de937e00ed7 Mon Sep 17 00:00:00 2001 From: Adam Stachowicz- {{ telegramGetUpdatesURL() }} + {{ telegramGetUpdatesURL() }}
From d645e29455e850792d63d01bb3d26080878f5993 Mon Sep 17 00:00:00 2001 From: Louis- {{ telegramGetUpdatesURL() }} + {{ telegramGetUpdatesURL("masked") }}
@@ -42,18 +42,22 @@ export default { HiddenInput, }, methods: { - telegramGetUpdatesURL(withToken = false) { + telegramGetUpdatesURL(mode = "masked") { let token = `<${this.$t("YOUR BOT TOKEN HERE")}>`; - if (this.$parent.notification.telegramBotToken && withToken) { - token = this.$parent.notification.telegramBotToken; + if (this.$parent.notification.telegramBotToken) { + if (mode === "withToken") { + token = this.$parent.notification.telegramBotToken; + } else if (mode === "masked") { + token = "*".repeat(this.$parent.notification.telegramBotToken.length); + } } return `https://api.telegram.org/bot${token}/getUpdates`; }, async autoGetTelegramChatID() { try { - let res = await axios.get(this.telegramGetUpdatesURL(true)); + let res = await axios.get(this.telegramGetUpdatesURL("withToken")); if (res.data.result.length >= 1) { let update = res.data.result[res.data.result.length - 1];