Nerixyz / instagram_mqtt

Realtime and Push Notification (FBNS) support for the instagram-private-api
MIT License
244 stars 49 forks source link

How can I listen to multiple accounts? #66

Open meseven opened 3 years ago

meseven commented 3 years ago

Hi all,

I want to listen to messages sent to multiple accounts. The method below works but I'm not sure it's the right solution.

const ig = withRealtime(new IgApiClient());
const ig2 = withRealtime(new IgApiClient());

ig.realtime.on('message', (data) => console.log(data));
ig2.realtime.on('message', (data) => console.log(data));

What could be your solution for connecting to 10 separate accounts? How do I refactor this code?

Nesslax commented 3 years ago

Hello meseven,

I have done the same thing for my platform. and this is the only solution i have found to be able to manage each account separately.

hope i helped

bayramn commented 2 years ago

Do you have any update on this issues? How to listen multiple accounts?