From 69a06176c5d731f66eb034f6ae6ca32f0142ac79 Mon Sep 17 00:00:00 2001 From: windka Date: Wed, 8 Jan 2025 21:55:22 +0100 Subject: [PATCH] prettier --- telegrambot/99-telegrambot.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/telegrambot/99-telegrambot.js b/telegrambot/99-telegrambot.js index 3e033af..9480ce5 100644 --- a/telegrambot/99-telegrambot.js +++ b/telegrambot/99-telegrambot.js @@ -325,27 +325,25 @@ module.exports = function (RED) { const protocol = 'https://'; let tempUrl = this.botHost; - if(!tempUrl.startsWith(protocol)){ - tempUrl = protocol + tempUrl; + if (!tempUrl.startsWith(protocol)) { + tempUrl = protocol + tempUrl; } const parsed = new URL(tempUrl); - if(parsed.port == ''){ + if (parsed.port == '') { parsed.port = this.publicBotPort; } - parsed.port = 80; - if(parsed.pathname == ''){ + if (parsed.pathname == '') { parsed.pathname = this.botPath; - } - else { - if(parsed.botPath != ''){ - parsed.pathname = parsed.pathname + '/' + this.botPath; - } + } else { + if (parsed.botPath != '') { + parsed.pathname = parsed.pathname + '/' + this.botPath; + } } - + let botUrl = parsed.href; - botUrl += '/' + this.token; + botUrl += '/' + this.token; let setWebHookOptions; if (!this.sslTerminated && this.useSelfSignedCertificate) {