From 30c8853209ccbab9133f5089377ded95d25426b6 Mon Sep 17 00:00:00 2001 From: tomyprs Date: Thu, 29 Jun 2023 09:42:47 +0700 Subject: [PATCH] make methode async Signed-off-by: tomyprs --- caligo/modules/network.py | 2 +- caligo/util/tg.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/caligo/modules/network.py b/caligo/modules/network.py index ca37b523..6ffe974d 100644 --- a/caligo/modules/network.py +++ b/caligo/modules/network.py @@ -118,7 +118,7 @@ async def cmd_download(self, ctx: command.Context) -> str: # Check if media is group or not if ctx.input: - chat_id, msg_id = util.tg.parse_telegram_link(ctx.input) + chat_id, msg_id = await util.tg.parse_telegram_link(ctx.input) else: chat_id = ctx.chat.id msg_id = reply_msg.id diff --git a/caligo/util/tg.py b/caligo/util/tg.py index f290f6b3..999f64bf 100644 --- a/caligo/util/tg.py +++ b/caligo/util/tg.py @@ -90,7 +90,7 @@ async def send_as_document( caption="❯ ```" + caption + "```", ) -def parse_telegram_link(link): +async def parse_telegram_link(link): # Pattern for extracting chat_id and msg_id pattern = r'https?://t.me/(?:c/)?([a-zA-Z0-9_]+)/(\d+)'