Open EnesKeremAYDIN opened 3 years ago
You will need to extract the tweet id and the username from data
, and create a tweet URL from it - it has a pattern:
https://twitter.com/<USERNAME>/status/<TWEETID>
Create a function to generate the link you need:
const tweetURL = (user, id) => {
const url = `https://twitter.com/${user}/status/${id}`;
return url
}
Use this function inside your code:
function replyMentions() {
T.get('statuses/mentions_timeline', { count: 100 }, function (err, data, response) {
if (data) {
data.forEach(function (mention) {
replyMentions = tweetURL(mention.user.screen_name, mention.id_str);
T.post('statuses/update', { status: replyMentions, in_reply_to_status_id: mention.id_str }, function (err, data, response) {
})
})
}
})
}
Hi, I want the bot to add the link of the tweet labeled to the
link
section in the code below, how do I do it?