yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.17k stars 1.5k forks source link

request-promise is deprecated #1076

Closed microcai closed 9 months ago

microcai commented 1 year ago

tgbot is using request-promise as https client. but request-promise is deprecated by upstream developers. see https://github.com/request/request/issues/3143

hodlerhacks commented 1 year ago

In addition, it uses 'request', which has been deprecated. And 'request' has a dependency on 'har-validator', which is no longer supported, and on an a deprecated version of 'uuid'.

It would be great if this could be resolved by moving to an alternative, e.g. see some examples here: https://github.com/request/request/issues/3143

Other than that, I'm super happy with this library. Thanks for the great work!

muety commented 1 year ago

Since version 18 (I believe) Node has the fetch API included, so no more need for a third-party HTTP client.

hodlerhacks commented 1 year ago

Indeed. The only disadvantage is that it requires every application using tgbot to be on Node 18 or above (which may cause problems for some people, including me ;-)).

jinsankim commented 1 year ago

how about node-fetch? It's a polyfill of fetch and it requires only node 12.20.0 at least.

melroy89 commented 10 months ago

Not only is request / request-promise deprecated, now you also got a nasty server side request forgery attack security issue: https://github.com/advisories/GHSA-p8p7-x288-28g6 ... so the urgency is just become more important to move away from this package!

melroy89 commented 10 months ago

And this package now also causes issues with bun!

Hambat commented 9 months ago

any updates?

danielperez9430 commented 9 months ago

fix: on next release

jinsankim commented 8 months ago

@cypress/request is not working with node v20.x. :(

danielperez9430 commented 8 months ago

@cypress/request is not working with node v20.x. :(

I test in node v20.9.0 and i dont have any problem 🤔

At less you have one bot.onText('... with a text that is not a regex. But this case we also have in the old versions. Because bot.onText exec a regex expression.

jinsankim commented 8 months ago

I test in node v20.9.0 and i dont have any problem

I found also it works in node v20 with mac. But it doesn't work in node v20 with ubuntu.

saeedhei commented 8 months ago

Does this bot have the ability to update with axios? @danielperez9430 @kamikazechaser @yagop

danielperez9430 commented 8 months ago

Does this bot have the ability to update with axios?

@danielperez9430 @kamikazechaser @yagop

The idea is not use axios. Is use the native fetch from node 16 (with feature flag), 18 or new versions that support it native without need any dependency.

This will be a breaking change to the next mayor version when we start the refactor.

danielperez9430 commented 8 months ago

I test in node v20.9.0 and i dont have any problem

I found also it works in node v20 with mac. But it doesn't work in node v20 with ubuntu.

Maybe you can open a new issuse with the error that you have and more info. But is so strange 🤔

saeedhei commented 8 months ago

Please do consider refactoring to native fetch. This change will boost performance, reduce dependencies, and align us with good development practices.✅

jinsankim commented 8 months ago

Maybe you can open a new issuse with the error that you have and more info. But is so strange 🤔

Might be related with https://github.com/cypress-io/request/issues/47 ?