Comments (3)
Here:
public async void CheckDMSeen()
{
var inboxResult = await InstaApi.MessagingProcessor.GetDirectInboxAsync(PaginationParameters.MaxPagesToLoad(1));
if (inboxResult.Succeeded)
{
// lets check all threads
var allThreads = inboxResult.Value.Inbox.Threads;
// or single thread:
// var singleThreadResult = await InstaApi.MessagingProcessor.GetDirectInboxThreadAsync(allThreads[0].ThreadId, PaginationParameters.MaxPagesToLoad(1));
foreach (var thread in allThreads)
{
var user = thread.Users.FirstOrDefault().UserName;
var reversed = thread.Items;
reversed.Reverse();
int ix = 0;
if (thread.LastSeenAt.LastOrDefault() != null)
{
var lastSeenAt = thread.LastSeenAt.LastOrDefault();
var itemId = lastSeenAt.ItemId;
var single = reversed.FirstOrDefault(a => a.ItemId == itemId);
var index = reversed.IndexOf(single);
if (index != -1)
ix = thread.Items.Count - (index + 1);
Console.WriteLine($"{user} has ({ix}) new messages, last message seen at {lastSeenAt.SeenTime}");
Console.WriteLine();
}
else
Console.WriteLine($"{user} isn't seen any message");
}
}
}
from instagramapisharp.
Hi,
By default You can't. Instagram doesn't have any official API to detect this.
Bu you can do this by checking some extra values from direct thread. I don't remember what was it ( I don't do programming like before).
I'll search for you and leave a new reply for this.
from instagramapisharp.
thank you
I'll check it
from instagramapisharp.
Related Issues (20)
- Banned account got LimitError status on logging
- Challenge Required Error when trying to login HOT 5
- Instagram HOT 5
- It does not receive the media share HOT 1
- How to list only unread direct messages (DM) #59 HOT 1
- UploadStoryPhotoAsync for stories doesn't seem to work properly
- Upload video is not working and giving me 500 error "internal server error" HOT 1
- Direct template message
- How to mark DM messages as read HOT 1
- How to mark DM messages as read HOT 2
- Fix issue with auto_expand_chaining
- Video views and Sponsor Tags HOT 1
- Bug : [GetFullUserInfoAsync] does not work HOT 1
- Login instagram on chrome using session ? HOT 1
- "int too big to convert" on uploading media HOT 11
- Disabling accounts who are not aggressive likers, commenters HOT 1
- Search and find related posts
- LocationProcessor.GetLocationStoriesAsync return error every time
- handle is missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instagramapisharp.