Skip to content

Instantly share code, notes, and snippets.

@Niweera
Created February 26, 2022 19:45
Show Gist options
  • Save Niweera/acd594c1c313a10636d0f0fa7d4ea2cf to your computer and use it in GitHub Desktop.
Save Niweera/acd594c1c313a10636d0f0fa7d4ea2cf to your computer and use it in GitHub Desktop.
Add a reply to the original tweet
import config from "../keys";
import { TwitterApi } from "twitter-api-v2";
const addReplyToTweet = async (tweetID, assetURL) => {
const twitterClient = new TwitterApi({
appKey: config.TWITTER_CONSUMER_KEY,
appSecret: config.TWITTER_CONSUMER_SECRET,
accessToken: config.TWITTER_ACCESS_TOKEN,
accessSecret: config.TWITTER_ACCESS_TOKEN_SECRET,
});
const reply = `☝ This tweet is for sale.\nCheck it out on @opensea marketplace.\n${assetURL}`;
await twitterClient.v2.reply(reply, tweetID);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment