@elizaos/plugin-twitter 1.0.14 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -504,7 +504,9 @@ async function* searchTweets(query, maxTweets, searchMode, auth) {
504
504
  const convertedTweet = {
505
505
  id: tweet.id,
506
506
  text: tweet.text || "",
507
- timestamp: tweet.created_at ? new Date(tweet.created_at).getTime() : Date.now(),
507
+ // Twitter API returns created_at as ISO string, convert to seconds
508
+ // to match the expected Tweet.timestamp format used throughout the plugin
509
+ timestamp: tweet.created_at ? new Date(tweet.created_at).getTime() / 1e3 : Date.now() / 1e3,
508
510
  timeParsed: tweet.created_at ? new Date(tweet.created_at) : /* @__PURE__ */ new Date(),
509
511
  userId: tweet.author_id || "",
510
512
  name: searchIterator.includes?.users?.find((u) => u.id === tweet.author_id)?.name || "",