I mean, you can login via bot tokens since, well always I guess. That's no secret. I was just very sure that it wasn't able to fetch all the chats for bot accounts with mtproto either - because I tried about 4 months ago.
Telethon throws this error message when trying to call await bot.get_dialogs() on a bot account: telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetDialogsRequest)
Maybe target an earlier layer, is that possible
mtproto is a giant Pandora's Box to me
Arabic people seem to love php. So I am going to assume they wrote this bot in php. Checking MadelineProto it seems like they implemented a special "getDialogs" function, because the mtproto one is not usable for bot api accounts.
The plot thickens
This seems to be their way of fetching all chats for bot api accounts: https://cs.github.com/danog/MadelineProto/blob/2e0d70bdc87d60a88022432d77a1a49e48168714/src/danog/MadelineProto/Wrappers/DialogHandler.php?q=getFullDialogs#L41-L56
Aha, so get_dialogs() doesnt work, but MP somehow gets a Chats iterator
Yeah. But it seems like this uses some database stored data... weird.
Thats impossible with a new token...
@painor @twitface @SitiSchu you would be my go to MTProto creaks, you have any idea? The thread isn't too long, like 5 messages up.
(where does the thread start?)
https://t.me/BotTalk/665906
tl;dr There is a bot that takes a bot token as input and returns the number of chats/users that bot had in the past. We are trying to find out how it works. Telethon calls an mtproto method that returns BOT_METHOD_INVALID when we try to fetch all dialogs.
Обсуждают сегодня