Comments (8)
I have been using all three methods (open, close and viewMessages WITH force read option True) but it won't always work. Is there a way to effectively mark messages as read for sure?
from td.
@JaEdmuva @CharlesOkwuagwu
Update: I got the reason why the openChat - viewMessages - closeChat
is not reliable.
To mark message as read in a reliable way, you must only openChat
. You MUST NOT closeChat
.
In my program, I have another timer thread. It calls openChat
and viewMessages
once a second. After 10 seconds, it calls closeChat
.
You must keep the chat "opened" as long as possible, to make it reliable.
from td.
To achieve this you need to call OpenChat/CloseChat when chats are opening/closed by the user and call ViewMessages whenever a message is shown to the user. The library will figure out which messages should be read itself. Messages are read only if they are shown in currently opened chat, but if you definitely need to read messages in a closed chat, you may use force_read parameter of ViewMessages method.
from td.
tanx
from td.
This method does not work, the "viewMessages" method works
from td.
I have been using all three methods (open, close and viewMessages WITH force read option True) but it won't always work. Is there a way to effectively mark messages as read for sure?
@JaEdmuva Hi, have you found a reliable way to mark as read?
from td.
@JaEdmuva @CharlesOkwuagwu Update: I got the reason why the
openChat - viewMessages - closeChat
is not reliable.To mark message as read in a reliable way, you must only
openChat
. You MUST NOTcloseChat
.In my program, I have another timer thread. It calls
openChat
andviewMessages
once a second. After 10 seconds, it callscloseChat
. You must keep the chat "opened" as long as possible, to make it reliable.
Are you sending openChat
and viewMessages
for each chat received?
from td.
Are you sending
openChat
andviewMessages
for each chat received?
I am creating an anti-spam bot, so I do it for every chat unless it's whitelisted. You need to do that basing on your need.
If you want to mark a message as read, you need to open
that chat (and keep it opened for a while)
This is my code, for your reference.
from td.
Related Issues (20)
- Share phone number with bot HOT 2
- Separate message_ids in the same post HOT 3
- PHP code fails to compile: `Unsupported tl-schema version -1` HOT 10
- Unknown error in class "messageReplyToMessage" HOT 1
- "Request is empty" on authorization in Ubuntu HOT 4
- How do I launch the bot correctly? HOT 2
- Can someone show the references of the SetAuthenticationPhoneNumber() function HOT 3
- Telegram
- I need to build libtdjsonandroid to work on android using Unity (C#) HOT 1
- GetSupergroup return error "400 Invalid supergroup identifier" HOT 1
- Why I cannot create this json format to send text? HOT 8
- user-bot rate limit HOT 6
- Isn't there an instant way to change the hint password? HOT 3
- How to buy/subscribe to Telegram Business/Premium on Test DC? HOT 2
- Problem with secret messaging in Telegram X HOT 3
- Exclude x86 libs from android build? HOT 1
- When send voicenote with own client official desktop telegram shows it strange HOT 8
- [static const] please write code that complies with the C++ standard HOT 5
- How often does TDLib phone back to server to decide on the connection state? HOT 2
- Delays in getting message updates from some specific channels HOT 5
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 td.