Created
February 26, 2022 19:45
-
-
Save Niweera/acd594c1c313a10636d0f0fa7d4ea2cf to your computer and use it in GitHub Desktop.
Add a reply to the original tweet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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