yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.35k stars 1.52k forks source link

[Feature] localhost as url #1048

Open b5414 opened 1 year ago

b5414 commented 1 year ago

Introduction

I can't able to specify localhost:3000 as baseApiUrl var on bot init, but imho this is a more commonly used alias to your local machine connections, especially for nodejs developers 👍

Example

const baseApiUrl_1 = 'http://0.0.0.0:3000'; // will work
const baseApiUrl_2 = 'http://localhost:3000'; // will NOT work
const baseApiUrl_3 = 'http://192.168.1.1:3000'; // will work

const bot = new TelegramBot(token, {polling: true, baseApiUrl: baseApiUrl_1});

ps: I'm using valid-built version of LocalTgBotApi

pss: I have searched for such a feature request (https://github.com/yagop/node-telegram-bot-api/labels/enhancement) and found none