Skip to content

Commit

Permalink
Merge pull request #2951 from elizaOS/tcm-add-missing-state
Browse files Browse the repository at this point in the history
fix: {{maxTweetLength}} doesn't work in tweet post template
  • Loading branch information
tcm390 authored Jan 29, 2025
2 parents 6468591 + 3917a92 commit cb5fd11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export class TwitterPostClient {
);

const topics = this.runtime.character.topics.join(", ");

const maxTweetLength = this.client.twitterConfig.MAX_TWEET_LENGTH;
const state = await this.runtime.composeState(
{
userId: this.runtime.agentId,
Expand All @@ -518,6 +518,7 @@ export class TwitterPostClient {
},
{
twitterUserName: this.client.profile.username,
maxTweetLength,
}
);

Expand Down Expand Up @@ -574,7 +575,6 @@ export class TwitterPostClient {
}

// Truncate the content to the maximum tweet length specified in the environment settings, ensuring the truncation respects sentence boundaries.
const maxTweetLength = this.client.twitterConfig.MAX_TWEET_LENGTH;
if (maxTweetLength) {
tweetTextForPosting = truncateToCompleteSentence(
tweetTextForPosting,
Expand Down

0 comments on commit cb5fd11

Please # to comment.