PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.32k stars 186 forks source link

How can I pass on a variable value to tweet while posting it? #471

Open giteshsarvaiya opened 1 year ago

giteshsarvaiya commented 1 year ago

Using the code under tweets.tweetThread

await rwClient.v2.tweetThread([
  "today's verse",
  { text: `${variableTHA}`},
  //  {text: 'This thread is automatically made with twitter-api-v2 :D'}
]);
  } catch(e) {
    console.error(e);
  }
} catch (error) {
    console.error(error);
}
}

the tweet is showing 'undefined' instead of the value of the variableTha

I want to post dynamically generated texts(originally generated in json fomat, via Another API). How can I perform this task ?