Skip to content

How do I create a thread of tweets? 🧵 #400

Discussion options

You must be logged in to vote

Hi @MarkOSullivan94 , thanks for using this package! 🐦

This package supports tweeting for making a thread, you can make it with following code :)

import 'package:twitter_api_v2/twitter_api_v2.dart' as v2;

Future<void> main() async {
  final twitter = v2.TwitterApi(bearerToken: 'YOUR_TOKEN_HERE');

  try {
    await twitter.tweetsService.createTweet(
      text: 'This is a thread!',

      // To represent a thread, the reply feature is used.
      reply: v2.TweetReplyParam(
        // Specify the ID of the tweet for which you want to create a thread.
        inReplyToTweetId: '1561165898718752769',
      ),
    );
  } on v2.TwitterException catch (e) {
    print(e);
  }
}

And the followin…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@MarkOSullivan94
Comment options

Answer selected by myConsciousness
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants