File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -558,9 +558,10 @@ export class TwitterPostClient {
558
558
}
559
559
560
560
if ( ! cleanedContent ) {
561
- cleanedContent = extractAttributes ( newTweetContent , [
562
- "text" ,
563
- ] ) . text ;
561
+ cleanedContent = truncateToCompleteSentence (
562
+ extractAttributes ( newTweetContent , [ "text" ] ) . text ,
563
+ this . client . twitterConfig . MAX_TWEET_LENGTH ,
564
+ ) ;
564
565
}
565
566
566
567
if ( ! cleanedContent ) {
@@ -688,7 +689,10 @@ export class TwitterPostClient {
688
689
) ;
689
690
}
690
691
691
- let truncateContent = extractAttributes ( cleanedResponse , [ "text" ] ) . text ;
692
+ let truncateContent = truncateToCompleteSentence (
693
+ extractAttributes ( cleanedResponse , [ "text" ] ) . text ,
694
+ this . client . twitterConfig . MAX_TWEET_LENGTH ,
695
+ ) ;
692
696
693
697
if ( ! truncateContent ) {
694
698
// If not JSON or no valid content found, clean the raw text
You can’t perform that action at this time.
0 commit comments