.gm: fix link parsing on stories

This commit is contained in:
thedragonsinn
2025-04-26 15:21:56 +05:30
parent 756d348803
commit 9388c2647c

View File

@@ -7,7 +7,7 @@ def parse_link(link: str) -> tuple[int | str, int, int]:
parsed_url: str = urlparse(link).path.strip("/")
link_chunks = parsed_url.lstrip("c/").split("/")
thread = 0
thread = "0"
if len(link_chunks) == 3:
chat, thread, message = link_chunks
else:
@@ -16,7 +16,10 @@ def parse_link(link: str) -> tuple[int | str, int, int]:
if chat.isdigit():
chat = int(f"-100{chat}")
return chat, int(thread), int(message)
if thread.isdigit():
thread = int(thread)
return chat, thread, int(message)
@BOT.add_cmd(cmd="gm")