Skip to content

Commit e14b4f8

Browse files
authored
Merge pull request elizaOS#1477 from ag-wnl/ignore-self-tweets-for-action
chore: Do not consider self tweets when evaluating actions
2 parents 5039ca7 + 9ed83a9 commit e14b4f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/client-twitter/src/base.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ export class ClientBase extends EventEmitter {
313313

314314
async fetchTimelineForActions(count: number): Promise<Tweet[]> {
315315
elizaLogger.debug("fetching timeline for actions");
316+
317+
const agentUsername = this.runtime.getSetting("TWITTER_USERNAME");
316318
const homeTimeline = await this.twitterClient.fetchHomeTimeline(
317319
count,
318320
[]
@@ -340,7 +342,7 @@ export class ClientBase extends EventEmitter {
340342
tweet.legacy?.entities?.media?.filter(
341343
(media) => media.type === "video"
342344
) || [],
343-
}));
345+
})).filter(tweet => tweet.username !== agentUsername); // do not perform action on self-tweets
344346
}
345347

346348
async fetchSearchTweets(

0 commit comments

Comments
 (0)