File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { generateTweetActions } from "@ai16z/eliza";
15
15
import { IImageDescriptionService , ServiceType } from "@ai16z/eliza" ;
16
16
import { buildConversationThread } from "./utils.ts" ;
17
17
import { twitterMessageHandlerTemplate } from "./interactions.ts" ;
18
+ import { DEFAULT_MAX_TWEET_LENGTH } from "./environment.ts" ;
18
19
19
20
const twitterPostTemplate = `
20
21
# Areas of Expertise
58
59
59
60
# Respond with qualifying action tags only.` + postActionResponseFooter ;
60
61
61
- const MAX_TWEET_LENGTH = 240 ;
62
-
63
62
/**
64
63
* Truncate text to fit within the Twitter character limit, ensuring it ends at a complete sentence.
65
64
*/
@@ -280,7 +279,7 @@ export class TwitterPostClient {
280
279
// Use the helper function to truncate to complete sentence
281
280
const content = truncateToCompleteSentence (
282
281
cleanedContent ,
283
- MAX_TWEET_LENGTH
282
+ parseInt ( this . runtime . getSetting ( " MAX_TWEET_LENGTH" ) ) || DEFAULT_MAX_TWEET_LENGTH
284
283
) ;
285
284
286
285
const removeQuotes = ( str : string ) =>
You can’t perform that action at this time.
0 commit comments