yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.13k stars 1.49k forks source link

chore: Replace request to node-fetch, #1076 #1125

Closed Dima-Dim closed 8 months ago

Dima-Dim commented 9 months ago

About tests: I don't have TEST_STICKER_SET_NAME and TEST_PROVIDER_TOKEN to run the tests related to them. The rest of the test pass normally.

Description

Getting rid of deprecated dependencies request.

References

https://www.npmjs.com/package/request

Issue: #1076.

kamikazechaser commented 9 months ago

Looks like a good change if all tests pass, though Node.js has a built in fetch API in newer version (18+).

Dima-Dim commented 9 months ago

Looks like a good change if all tests pass, though Node.js has a built in fetch API in newer version (18+).

Yes, after some time it will be possible to try to completely switch to a native solution, but i think no before end of support version older than 18.

0x114514BB commented 9 months ago

Your change literally removed the request dependency. The core _request function of NTBA depends on request-promise (also deprecated), which has request as a peer-dependency. So you should replace it with node-fetch or other solutions.

Dima-Dim commented 9 months ago

Your change literally removed the request dependency. The core _request function of NTBA depends on request-promise (also deprecated), which has request as a peer-dependency. So you should replace it with node-fetch or other solutions.

Yes, this PR is the first step. The next one will require more changes and more time.

danielperez9430 commented 8 months ago

For the moment we have already a remplace for the request library merge and without need to drop support for the current old versions.

In a future completed refactor, we will be drop the support for older versions of node. But for the moment we still preserve the compatibility.