Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch timeline for followed accounts via Twitter client methods #1475

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/client-twitter/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ export class ClientBase extends EventEmitter {
return homeTimeline.tweets;
}

async fetchHomeTimeline(count: number): Promise<Tweet[]> {
/**
* Fetch timeline for twitter account, optionally only from followed accounts
*/
async fetchHomeTimeline(count: number, following?: boolean): Promise<Tweet[]> {
elizaLogger.debug("fetching home timeline");
const homeTimeline = await this.twitterClient.fetchHomeTimeline(
count,
[]
);
const homeTimeline = following
? await this.twitterClient.fetchFollowingTimeline(count, [])
: await this.twitterClient.fetchHomeTimeline(count, []);

elizaLogger.debug(homeTimeline, { depth: Infinity });
const processedTimeline = homeTimeline
Expand Down
Loading