telegram-bot-client
                                
                                
                                
                                    telegram-bot-client copied to clipboard
                            
                            
                            
                        How to set proxy for this package?
My code is like:
'use strict';
const token = '122222222:SSAAADSDASDASDASDASDASASDS';
const chatid = '-456667554';
const TelegramBotClient = require('telegram-bot-client');
const client = new TelegramBotClient(token);
console.log('Start send telegram message!');
client.sendMessage(chatid, 'I\'m a bot, so what?').promise().then(function(response) {
  console.log(response);
}, function(err) {
  console.log(err);
});
Due to internet limit, It does not work. My network proxy is 127.0.0.1:7891, How can I ser proxy in my code?
At the moment this usecase it not supported as the endpoint URL is simply hardcoded here: https://github.com/m90/telegram-bot-client/blob/8fa0ff9d6974c34f9c97948e40f1ed10d4162a8b/src/apiclient.js#L8
It should not be too hard to add it though and have the constructor expose a signature of something like this:
const client = new TelegramBotClient('122222222:SSAAADSDASDASDASDASDASASDS', {endpoint: 'http://127.0.0.1:7891'});
which would override the default.
I don't have the time to look into this right now, but if you want to go ahead and implement this I am happy to support and merge.