MarshalX / tgcalls

Voice chats, private incoming and outgoing calls in Telegram for Developers
https://t.me/tgcallslib
GNU Lesser General Public License v3.0
514 stars 91 forks source link

400 BOT_METHOD_INVALID #188

Closed sistematico closed 1 year ago

sistematico commented 1 year ago

I'm using:

I tried with my only account, run bot using APP_ID, APP_HASH and BOT_TOKEN.

With this snippet.

And facing this error:

/home/lucas/music-bot/main.py:34: DeprecationWarning: There is no current event loop
  asyncio.get_event_loop().run_until_complete(main(pyro_client))
tgcalls v3.0.0.5 DEV, Copyright (C) 2020-2021 Il`ya (Marshal) <https://github.com/MarshalX>
Licensed under the terms of the GNU Lesser General Public License v3 (LGPLv3) 

Task exception was never retrieved
future: <Task finished name='Task-59' coro=<GroupCallBase.__emit_join_payload_callback.<locals>._() done, defined at /home/lucas/music-bot/venv/lib/python3.10/site-packages/pytgcalls/implementation/group_call_base.py:173> exception=BotMethodInvalid('Telegram says: [400 BOT_METHOD_INVALID] - The method can\'t be used by bots (caused by "phone.JoinGroupCall")')>
Traceback (most recent call last):
  File "/home/lucas/music-bot/venv/lib/python3.10/site-packages/pytgcalls/implementation/group_call_base.py", line 180, in _
    await self.mtproto.join_group_call(
  File "/home/lucas/music-bot/venv/lib/python3.10/site-packages/pytgcalls/mtproto/pyrogram_bridge.py", line 211, in join_group_call
    response = await self.client.send(
  File "/home/lucas/music-bot/venv/lib/python3.10/site-packages/pyrogram/methods/advanced/invoke.py", line 79, in invoke
    r = await self.session.invoke(
  File "/home/lucas/music-bot/venv/lib/python3.10/site-packages/pyrogram/session/session.py", line 361, in invoke
    return await self.send(query, timeout=timeout)
  File "/home/lucas/music-bot/venv/lib/python3.10/site-packages/pyrogram/session/session.py", line 331, in send
    RPCError.raise_it(result, type(data))
  File "/home/lucas/music-bot/venv/lib/python3.10/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 "phone.JoinGroupCall")
MarshalX commented 1 year ago

Hello. It's not possible to join group calls or use voice chats via bots. Telegram doesn't give this ability. User bots work only. It is basically a typical dedicated telegram account that will be controlled by the program.

rojvv commented 1 year ago

@MarshalX This can be closed.

  1. It is not a tgcalls issue.
  2. You have explained why.