alik0211 / mtproto-core

Telegram API JS (MTProto) client library for Node.js and browser
https://mtproto-core.js.org
GNU General Public License v3.0
631 stars 117 forks source link

api.call() doesn't return #290

Open richastral opened 1 year ago

richastral commented 1 year ago

Describe the bug When using api.call() for example:

async function main() { const res = await TelegramAPI.call('help.getNearestDc', {}); console.log(res); } main();

The function does not close e.g. return to prompt. It seems like the socket is still open so that app does not finish:

node .\dc.js { _: 'nearestDc', country: 'AU', this_dc: 5, nearest_dc: 5 } // Hangs here and does not go to prompt. Expected behavior I would expect for the function to finish and the app close. Reason for the question is that I will be calling this from an API, so would want it to close.

Screenshots image

Context:

Any help on this would be appreciated.

Raptor5 commented 1 year ago

Same problem