From 966acd108eeb12da626abcdadfd9bcf7fba3f3f4 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 24 Oct 2024 23:45:29 +0800 Subject: [PATCH] chore: update bsky domain --- defs/bsky.py | 4 +++- modules/bsky_api.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/defs/bsky.py b/defs/bsky.py index c9dae7d..b7bd4be 100644 --- a/defs/bsky.py +++ b/defs/bsky.py @@ -59,7 +59,9 @@ class Timeline: ) @staticmethod - def get_media_group(text: str, post: HumanPost, has_spoiler: bool) -> list[InputMediaPhoto]: + def get_media_group( + text: str, post: HumanPost, has_spoiler: bool + ) -> list[InputMediaPhoto]: data = [] images = post.images for idx, image in enumerate(images): diff --git a/modules/bsky_api.py b/modules/bsky_api.py index 4062d62..4825035 100644 --- a/modules/bsky_api.py +++ b/modules/bsky_api.py @@ -18,7 +18,7 @@ class Reply(BaseModel): async def process_url(url: str, reply: Reply, override_hidden: bool): url = urlparse(url) - if url.hostname and url.hostname in ["bsky.app"]: + if url.hostname and url.hostname in ["bsky.app", "bsky.xtaolabs.com"]: if url.path.find("profile") < 0: return author_handle = str(url.path[url.path.find("profile") + 8 :].split("/")[0]) @@ -40,7 +40,7 @@ async def process_url(url: str, reply: Reply, override_hidden: bool): print(e) -@bot.on_message(filters.incoming & filters.text & filters.regex(r"bsky.app/")) +@bot.on_message(filters.incoming & filters.text & filters.regex(r"bsky.*?\/profile\/")) async def bsky_share(_: Client, message: Message): text = message.text if not text: