chore: update bsky domain

This commit is contained in:
xtaodada 2024-10-24 23:45:29 +08:00
parent e729d6e93d
commit 966acd108e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 5 additions and 3 deletions

View File

@ -59,7 +59,9 @@ class Timeline:
) )
@staticmethod @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 = [] data = []
images = post.images images = post.images
for idx, image in enumerate(images): for idx, image in enumerate(images):

View File

@ -18,7 +18,7 @@ class Reply(BaseModel):
async def process_url(url: str, reply: Reply, override_hidden: bool): async def process_url(url: str, reply: Reply, override_hidden: bool):
url = urlparse(url) 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: if url.path.find("profile") < 0:
return return
author_handle = str(url.path[url.path.find("profile") + 8 :].split("/")[0]) 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) 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): async def bsky_share(_: Client, message: Message):
text = message.text text = message.text
if not text: if not text: