get_message bug fix.

This commit is contained in:
thedragonsinn
2023-11-03 18:32:06 +05:30
parent 35ec7fd1b0
commit 354eee056f

View File

@@ -5,9 +5,9 @@ from app.core import Message
def get_message(link: str) -> tuple[int | str, int]:
parsed_url: str = urlparse(link).path.lstrip("/")
chat, id = parsed_url.split("/")
if chat.is_digit():
parsed_url: str = urlparse(link).path.strip("/")
chat, id = parsed_url.lstrip("c/").split("/")
if chat.isdigit():
chat = int(f"-100{chat}")
return chat, int(id)