Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
windka committed Jan 8, 2025
1 parent d346c52 commit 69a0617
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions telegrambot/99-telegrambot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 69a0617

Please sign in to comment.