Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message delay #3062

Open
gplgpl775 opened this issue Sep 24, 2024 · 4 comments
Open

message delay #3062

gplgpl775 opened this issue Sep 24, 2024 · 4 comments

Comments

@gplgpl775
Copy link

gplgpl775 commented Sep 24, 2024

Now I have a problem, I am creating a client using 'client = tdl.createClient(publicValue)' by 'var all_message = await client. invoke(
{
_: 'getChatHistory',
chat_id: itemQun.chat_id,
from_message_id: itemQun.from_message_id,
offset: -99, limit: 99
limit: 99
}
)' to get telegram messages (my program must use getChatHistory to get messages, because I am using vpn to access the extranet, and I want to realize that when the VPN is interrupted, and it returns to normal, I can continue to get the data according to the previous ids), in the initial stage of login, there is no delay in getting the messages, but when the After 3-4 days of running the program, some of the groups started to have delayed messages, so I decided to restart the project using node, and for about 1-2 two days these same groups had the same delay, so I deleted the login information and re-logged in, and persisted for 3-4 days, and then started to have the delayed messages again (it's always been a fixed number of groups). So what is the cause of this please?
It is important to note that there are many groups under the current account and the volume of group messages is also high.
Techniques: node; prebuilt-tdlib:“^0.1008034.0”; tdl:“^8.0.1”
Looking forward to your reply, thanks!

@levlam
Copy link
Contributor

levlam commented Sep 24, 2024

getChatHistory is not supposed to be used to fetch new messages.

Also, messages in supergroups and channels aren't supposed to be received immediately. They can be received by different users with different delay.

@gplgpl775
Copy link
Author

gplgpl775 commented Sep 25, 2024

I understand what you mean, but I have to use "getChatHistory", so now I have a question, when I start a program, there is no delay at first, but after 3-4 days, the delay of some specific groups can reach 1 hour or even longer. When I pause the program and restart it, the delay disappears, but after a few days, the delay will appear again. What is the reason for this? @levlam

@levlam
Copy link
Contributor

levlam commented Sep 25, 2024

It can be anything and it is most likely to be intended. New messages are supposed to be received only through updateNewMessage and getChatHistory can't affect receiving of new messages.

@gplgpl775
Copy link
Author

OK, I understand, thanks

它可以是任何东西,而且很可能是有意为之。新消息只能通过它接收updateNewMessagegetChatHistory不能影响新消息的接收。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants