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

feature: Tweet thread helper #79

Merged
merged 1 commit into from
Sep 21, 2021
Merged

feature: Tweet thread helper #79

merged 1 commit into from
Sep 21, 2021

Conversation

alkihis
Copy link
Collaborator

@alkihis alkihis commented Sep 20, 2021

Add .tweetThread as suggested in #76.

Simply takes a list of statuses text/statuses params, tweet while maintaining links between tweets using .reply, then return all the posted tweets.

@alkihis alkihis requested a review from PLhery September 20, 2021 15:59
@deadcoder0904
Copy link
Contributor

Dang, that was quick. Does this support images too?

@alkihis
Copy link
Collaborator Author

alkihis commented Sep 21, 2021

Image support is available through media_ids parameters; you just need to upload images before using .tweetThread.

const mediaId = await client.v1.uploadMedia('./image.png');

await client.v1.tweetThread([
  'Hello, lets talk about Twitter!',
  { status: 'Twitter is a fantastic social network. Look at this:', media_ids: mediaId },
  'This thread is automatically made with twitter-api-v2 :D',
]);

@alkihis alkihis merged commit 2e1b31a into master Sep 21, 2021
@alkihis alkihis deleted the feat/threads branch September 21, 2021 16:49
@deadcoder0904
Copy link
Contributor

@alkihis put this in the README recipe instead of what you have currently. makes more sense :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants