From 0cd1e40da2268024edc3abc90d2f90eb1d8e65ec Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Sat, 16 Mar 2024 21:45:08 -0700 Subject: [PATCH] Parse hashtags for Bluesky --- app/social/clients/BlueskyClient.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/social/clients/BlueskyClient.mjs b/app/social/clients/BlueskyClient.mjs index e1ab9fa..4e058ca 100644 --- a/app/social/clients/BlueskyClient.mjs +++ b/app/social/clients/BlueskyClient.mjs @@ -1,8 +1,8 @@ -import blue from "@atproto/api"; +import atprotoApi from "@atproto/api"; import Client from "./Client.mjs"; import sharp from "sharp"; -const BskyAgent = blue.BskyAgent; +const { BskyAgent, RichText } = atprotoApi; export default class BlueskyClient extends Client { @@ -49,8 +49,15 @@ export default class BlueskyClient extends Client ); // Send status - await this.#agent.post({ + const rt = new RichText({ text: status.status, + }); + + await rt.detectFacets(this.#agent); + + await this.#agent.post({ + text: rt.text, + facets: rt.facets, embed: { images, $type: 'app.bsky.embed.images',