Closed ali-heidari closed 2 years ago
My co-worker asked this question in StackOverflow and got a comment which leads us to a workaround. You can check it here: how-to-use-proxy-in-typescript
You can put @ts-ignore on top of the nagging line. With this trick, both codes mentioned in previous comment, work like a charm.
const bot = new TelegramBot(this._token, {
polling: true,
// @ts-ignore
request: {
// url: "api.telegram.org",
proxy: "http://127.0.0.1:1234",
},
});
As I said, this is just a trick to make it work, But the solution would be adding the type definitions.
Hi everyone,
I want to create a simple telegram robot using typescript. I need set a proxy, used following code:
but got a compile-time error which says:
I read other related issues but it seems there is a lack of type definitions. Then used this one:
When i run it, gives this error...
Can anyone suggest to me how to set a proxy with typescript?