Skip to content

Commit

Permalink
Merge pull request #1477 from ag-wnl/ignore-self-tweets-for-action
Browse files Browse the repository at this point in the history
chore: Do not consider self tweets when evaluating actions
  • Loading branch information
shakkernerd authored Dec 26, 2024
2 parents f46b4f8 + cdcb11f commit 7625404
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/client-twitter/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ export class ClientBase extends EventEmitter {

async fetchTimelineForActions(count: number): Promise<Tweet[]> {
elizaLogger.debug("fetching timeline for actions");

const agentUsername = this.runtime.getSetting("TWITTER_USERNAME");
const homeTimeline = await this.twitterClient.fetchHomeTimeline(
count,
[]
Expand Down Expand Up @@ -340,7 +342,7 @@ export class ClientBase extends EventEmitter {
tweet.legacy?.entities?.media?.filter(
(media) => media.type === "video"
) || [],
}));
})).filter(tweet => tweet.username !== agentUsername); // do not perform action on self-tweets
}

async fetchSearchTweets(
Expand Down

0 comments on commit 7625404

Please sign in to comment.