-
Notifications
You must be signed in to change notification settings - Fork 109
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
messages.getAllChats always retrun INPUT_METHOD_INVALID_2271179966_* #279
Comments
I also encounter the same problem |
Hello, I also have this problem |
What happened? It didn't change anything, and all of a sudden it didn't work |
I checked the telegram api docs for update or something else, but I saw nothing related to getAllChats... |
This error is true for me too |
same for me, has anyone found any solution? |
Has anyone found any solution? |
It seems that this method has been removed from telegram API, and getDialogs must be used instead. |
however the getDialogs method gets only recent conversations and not all conversations. |
Oh, didn't noticed that, I just saw this answer... It will be a problem for me too, more digging is necessary :( |
I don't understand the Telegram have removed this method without any notice, causing a breaking change. |
@0xARK any solution? |
No, I didn't have time to look into it |
@0xARK this don't work for me. Causes a infinity loop. |
it's working on my side, check the adapted method for mtproto : const getAllChats = async () => {
const LIMIT = 100;
const offsetId = 0;
const offsetPeer = {
_: 'inputPeerEmpty'
};
let resultCount = LIMIT;
let offsetDate = 0;
let chats = [];
while (resultCount >= LIMIT) {
const result = await mtproto.call('messages.getDialogs', {
offset_id: offsetId,
offset_peer: offsetPeer,
offset_date: offsetDate,
limit: LIMIT
}).catch(e => {
if (e.error_message.includes('FLOOD_WAIT')) {
log.warn("Telegram", `API rate limit reached, please wait ${e.error_message.replace('FLOOD_WAIT_', '')} seconds`);
} else log.error("Telegram", e.message);
})
resultCount = result.dialogs.length;
if (result.chats && result.chats.length > 0) {
chats = [...chats, ...result.chats];
}
if (result.messages.length > 0) {
offsetDate = result.messages[result.messages.length - 1].date;
} else {
break;
}
}
return chats;
} |
don't work, this lists even fewer chats, and chats that have no interaction are still not listed |
I used messages.getAllChats to get all chats and then filter chats to get only chats that we need. To get chats according to a pre-known list I used two method. First try to find by @name. If @name do not exists then find by search and filter by chat.title.
|
U're able to check their changelog here https://core.telegram.org/api/layers They removed support of this method in 158 layer and yes, looks strange cuz older versions have to work (while it's supported by any of telegram server) |
…itself). By using "client.iter_dialogs()" instead of deprecated "GetAllChatsRequest".... 1. As the "GetAllChatsRequest()" has been deprecated by Telegram. 2. Need to use "client.iter_dialogs()" now for the same purpose of getting the chats. Ref: alik0211/mtproto-core#279 gram-js/gramjs#522
…t_caption', to cover file-Names having whitespaces in name instead of underscores. & More... 1. new_heading : Moded the code to work with file-Names having whitespaces in name instead of underscores (the earlier case) 2. lect_caption : Also, improved to check the last-Dot from the last/end side so the file-Names can now have multiple dots(.) as part of it. Ref for THE Prev.Commit:: alik0211/mtproto-core#279 gram-js/gramjs#522
layer: 139
Is there anyone who can help me?
The text was updated successfully, but these errors were encountered: