draftbit / twitter-lite

A tiny, full-featured, flexible client / server library for the Twitter API
https://npm.im/twitter-lite
MIT License
794 stars 95 forks source link

Not able Get Response object of Get API Call inside Stream #138

Open ali-mansoor opened 4 years ago

ali-mansoor commented 4 years ago

Inside Stream on data event I have called below function but it doesnt return response object it return Promise Pending

`var param = { source_id: "XXXX", target_id: "XXXXX", };

try { const response = await T.get("friendships/show", param); const data = response; } catch (e) { if ("errors" in e) { if (e.errors[0].code === 88) console.log( "Rate limit will reset on", new Date(e._headers.get("x-rate-limit-reset") * 1000) ); } } return data;`