dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

Is there a way to fetch X last messages from a direct thread? #1263

Open Androz2091 opened 4 years ago

Androz2091 commented 4 years ago

Form

Put an [x] if you meet the condition, else leave [ ].

Question

Hello, I'm using the following code to retrieve the direct threads:

ig.feed.directInbox().items()

However, only the last 10 messages are returned. Is there any way to fetch more messages? Like:

ig.entity.directThread(THREAD_ID).fetchMessages({ after: 'LAST_CACHED_MESSAGE_ID', count: 100 });
Androz2091 commented 4 years ago

I read the code and found these files: https://github.com/dilame/instagram-private-api/blob/3e16058/src/feeds/direct-thread.feed.ts#L14 https://github.com/dilame/instagram-private-api/blob/3e1605831996c19e59f7b91461eea3539cd3521f/src/feeds/direct-inbox.feed.ts#L18

Would it be possible to add parameters to modify limits? And is the cursor a message ID from which other messages are fetch?