Skip to content

Error when trying to join telegram protocol link #966

@girlpunk

Description

@girlpunk

Some telegram rooms are linked with the tg protocol handler, intended to be handled by the browser and open the Telegram app. For example: tg://resolve?domain=ABC.

When trying to join such a link using !tg join tg://resolve?domain=ABC, the following error occurs

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 491, in handle
    await self._run_handler(handler, evt)
  File "/usr/lib/python3.11/site-packages/mautrix_telegram/commands/handler.py", line 194, in _run_handler
    return await handler(evt)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix/bridge/commands/handler.py", line 340, in __call__
    return await self._handler(evt)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/mautrix_telegram/commands/telegram/misc.py", line 271, in join
    async with ClientSession() as sess, sess.get(url) as resp:
  File "/usr/lib/python3.11/site-packages/aiohttp/client.py", line 1167, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/client.py", line 562, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 540, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 901, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/aiohttp/connector.py", line 1147, in _create_direct_connection
    assert port is not None
           ^^^^^^^^^^^^^^^^
AssertionError

I believe these links are functionally identical, albeit in a different format. As such, the above example should be equivalent to https://t.me/ABC

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions