So they are using bot token like user token?

16 ответов

40 просмотров

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.

Яico X
I mean, you can login via bot tokens since, well a...

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)

Яico X
Telethon throws this error message when trying to ...

Maybe target an earlier layer, is that possible

Poolitzer X
Maybe target an earlier layer, is that possible

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.

Яico X
Arabic people seem to love php. So I am going to a...

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

Яico X
screenshot This seems to be their way of fetching all chats f...

Aha, so get_dialogs() doesnt work, but MP somehow gets a Chats iterator

Poolitzer X
Aha, so get_dialogs() doesnt work, but MP somehow ...

Yeah. But it seems like this uses some database stored data... weird.

Яico X
screenshot This seems to be their way of fetching all chats f...

@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.

painor
(where does the thread start?)

https://t.me/BotTalk/665906

painor
(where does the thread start?)

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.

Похожие вопросы

Карта сайта