You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the bot.
I'm trying to set it up by using a bot account. After entering the bot token in the first step, this is what I get from the trace.
Traceback (most recent call last):
File "D:\Files\Code\python\PyWardBot\app\main.py", line 1208, in <module>
for dialog in user.get_dialogs():
^^^^^^^^^^^^^^^^^^
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\sync.py", line 42, in async_to_sync_gen
item, done = loop.run_until_complete(anext(agen))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\sync.py", line 36, in anext
return await agen.__anext__(), False
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\methods\chats\get_dialogs.py", line 58, in get_dialogs
r = await self.invoke(
^^^^^^^^^^^^^^^^^^
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\methods\advanced\invoke.py", line 94, in invoke
r = await session.invoke(
^^^^^^^^^^^^^^^^^^^^^
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\session\session.py", line 399, in invoke
return await self.send(query, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\session\session.py", line 367, in send
RPCError.raise_it(result, type(data))
File "D:\Files\Code\python\PyWardBot\venv\Lib\site-packages\pyrogram\errors\rpc_error.py", line 91, in raise_it
raise getattr(
pyrogram.errors.exceptions.bad_request_400.BotMethodInvalid: Telegram says: [400 BOT_METHOD_INVALID] - The method can't be used by bots (caused by "messages.GetDialogs")
I've tried using a user account and everything worked fine. Probably some telegram api changes caused this?
The text was updated successfully, but these errors were encountered:
As the documentation suggests, the .get_dialogs() method is not usable by bots (docs).
I commented the two lines as it seems like the method call is doing nothing. (not really)
Now the bot starts up as expected. However, the method is_identical_to_last is using the get_chat_history api method that suffers the same issue of the first one (docs).
After disabling the "Duplicate text" option from the bot, it skips the method call and now everything seems to work as expected.
Thank you for the bot.
I'm trying to set it up by using a bot account. After entering the bot token in the first step, this is what I get from the trace.
I've tried using a user account and everything worked fine. Probably some telegram api changes caused this?
The text was updated successfully, but these errors were encountered: