Skip to content

Commit

Permalink
fix: X dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
laser-riot authored Nov 20, 2024
1 parent 8cb3467 commit a744b9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export class TwitterPostClient extends ClientBase {
// Use the helper function to truncate to complete sentence
const content = truncateToCompleteSentence(formattedTweet);

if (this.runtime.getSetting("TWITTER_DRY_RUN") === 'true') {
elizaLogger.info(`Dry run: would have posted tweet: ${content}`);
return;
}

try {
const result = await this.requestQueue.add(
async () => await this.twitterClient.sendTweet(content)
Expand Down

0 comments on commit a744b9a

Please sign in to comment.