Skip to content

it doesn't work with API tokens #34

Description

@Jerome2103

I need help :(

He has all admin rights and no restrictions have been made
It works via telephone number. but is very ugly

user@server:/path/to/telegram_bot$ python3 forwardgram.py config.yml
Please enter your phone (or bot token): HERE API Token
Traceback (most recent call last):
File "forwardgram.py", line 49, in
start(config)
File "forwardgram.py", line 20, in start
for d in client.iter_dialogs():
File "/home/user/.local/lib/python3.8/site-packages/telethon/requestiter.py", line 87, in next
return self.client.loop.run_until_complete(self.anext())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/user/.local/lib/python3.8/site-packages/telethon/requestiter.py", line 74, in anext
if await self._load_next_chunk():
File "/home/user/.local/lib/python3.8/site-packages/telethon/client/dialogs.py", line 53, in _load_next_chunk
r = await self.client(self.request)
File "/home/user/.local/lib/python3.8/site-packages/telethon/client/users.py", line 30, in call
return await self._call(self._sender, request, ordered=ordered)
File "/home/user/.local/lib/python3.8/site-packages/telethon/client/users.py", line 79, in _call
result = await future
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)
user@server:/path/to/telegram_bot

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions