refactor: Use plural wording for user tweets trigger

This commit is contained in:
Faruk AYDIN
2022-08-31 16:33:51 +03:00
parent abaad7cb82
commit 6537a1c649
4 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,27 @@
import TwitterClient from '../client';
export default class UserTweets {
client: TwitterClient;
constructor(client: TwitterClient) {
this.client = client;
}
async run(lastInternalId: string) {
return this.getTweets(lastInternalId);
}
async testRun() {
return this.getTweets();
}
async getTweets(lastInternalId?: string) {
const user = await this.client.getUserByUsername.run(
this.client.step.parameters.username as string
);
const tweets = await this.client.getUserTweets.run(user.id, lastInternalId);
return tweets;
}
}