Skip to content

Commit

Permalink
Merge pull request elizaOS#1141 from owlcode/clean-newlines-from-new-…
Browse files Browse the repository at this point in the history
…tweets

clean newlines for new tweet
  • Loading branch information
monilpat authored Dec 16, 2024
2 parents 9348c97 + db9580d commit 105025a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,11 @@ export class TwitterPostClient {
const removeQuotes = (str: string) =>
str.replace(/^['"](.*)['"]$/, "$1");

const fixNewLines = (str: string) =>
str.replaceAll(/\\n/g, "\n");

// Final cleaning
cleanedContent = removeQuotes(content);
cleanedContent = removeQuotes(fixNewLines(content));

if (this.runtime.getSetting("TWITTER_DRY_RUN") === "true") {
elizaLogger.info(
Expand Down

0 comments on commit 105025a

Please sign in to comment.