fixed length limit
This commit is contained in:
parent
7356c4bb93
commit
e6ff6aeee5
6
main.js
6
main.js
@ -102,9 +102,13 @@ async function postToBluesky(text, images) {
|
|||||||
}
|
}
|
||||||
const richText = new RichText({ text: completetext });
|
const richText = new RichText({ text: completetext });
|
||||||
await richText.detectFacets(agent);
|
await richText.detectFacets(agent);
|
||||||
|
let text = richText.text;
|
||||||
|
if (richText.graphemeLength > 300) {
|
||||||
|
text = text.substr(0,299) + '…';
|
||||||
|
}
|
||||||
|
|
||||||
return agent.post({
|
return agent.post({
|
||||||
text: richText.text,
|
text: text,
|
||||||
facets: richText.facets,
|
facets: richText.facets,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user