From b3de90295b7d4ff75c7e622ca7069083cc4cf008 Mon Sep 17 00:00:00 2001 From: Luis Zurro de Cos Date: Mon, 16 Oct 2023 23:33:25 +0200 Subject: [PATCH] feat() Support named channels --- src/telegram-download-daemon.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/telegram-download-daemon.py b/src/telegram-download-daemon.py index ee864de..92d3bea 100644 --- a/src/telegram-download-daemon.py +++ b/src/telegram-download-daemon.py @@ -215,12 +215,13 @@ async def parse_command(event): return clean_downloads_folder() case _: # default download_uris = list( - re.finditer(r"https://t.me/c/(?P[0-9]+)(/(?P[0-9]+))?", - command)) + re.finditer(r"https://t.me/(c/)?(?P\w+)(/(?P[0-9]+))?", + event.message.message)) if download_uris: for download_uri in download_uris: message_channel = download_uri['message_channel'] + message_channel = message_channel if message_channel.isdigit() else (await client.get_entity(message_channel)).id message_id = download_uri['message_id'] if message_id is None: