From e6ff6aeee54b07e420e90faad43943ce72c17d97 Mon Sep 17 00:00:00 2001 From: "Tomoya Matsuura(MacBookPro)" Date: Mon, 11 Mar 2024 23:18:42 +0900 Subject: [PATCH] fixed length limit --- main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 2c26d86..768e57d 100644 --- a/main.js +++ b/main.js @@ -102,9 +102,13 @@ async function postToBluesky(text, images) { } const richText = new RichText({ text: completetext }); await richText.detectFacets(agent); + let text = richText.text; + if (richText.graphemeLength > 300) { + text = text.substr(0,299) + '…'; + } return agent.post({ - text: richText.text, + text: text, facets: richText.facets, }); }