@elizaos/plugin-twitter 1.2.12 → 1.2.13
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 +23 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6944,9 +6944,14 @@ var TwitterPostClient = class {
|
|
|
6944
6944
|
);
|
|
6945
6945
|
const interval = postIntervalMinutes * 60 * 1e3;
|
|
6946
6946
|
logger4.info(`Next tweet scheduled in ${postIntervalMinutes} minutes`);
|
|
6947
|
+
await new Promise((resolve) => setTimeout(resolve, interval));
|
|
6948
|
+
if (!this.isRunning) {
|
|
6949
|
+
logger4.log("Twitter post client stopped during wait, exiting loop");
|
|
6950
|
+
return;
|
|
6951
|
+
}
|
|
6947
6952
|
await this.generateNewTweet();
|
|
6948
6953
|
if (this.isRunning) {
|
|
6949
|
-
|
|
6954
|
+
generateNewTweetLoop();
|
|
6950
6955
|
}
|
|
6951
6956
|
};
|
|
6952
6957
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
@@ -6987,6 +6992,13 @@ var TwitterPostClient = class {
|
|
|
6987
6992
|
roomId,
|
|
6988
6993
|
content: { text: "", type: "post" },
|
|
6989
6994
|
createdAt: Date.now()
|
|
6995
|
+
}).catch((error) => {
|
|
6996
|
+
logger4.warn("Error composing state, using minimal state:", error);
|
|
6997
|
+
return {
|
|
6998
|
+
agentId: this.runtime.agentId,
|
|
6999
|
+
recentMemories: [],
|
|
7000
|
+
values: {}
|
|
7001
|
+
};
|
|
6990
7002
|
});
|
|
6991
7003
|
const tweetPrompt = `You are ${this.runtime.character.name}.
|
|
6992
7004
|
${this.runtime.character.bio}
|
|
@@ -8856,9 +8868,19 @@ var postTweetAction = {
|
|
|
8856
8868
|
],
|
|
8857
8869
|
validate: async (runtime, message) => {
|
|
8858
8870
|
logger9.debug("Validating POST_TWEET action");
|
|
8871
|
+
logger9.debug("Message details:", {
|
|
8872
|
+
hasContent: !!message.content,
|
|
8873
|
+
contentType: message.content?.type,
|
|
8874
|
+
hasText: !!message.content?.text,
|
|
8875
|
+
textLength: message.content?.text?.length || 0,
|
|
8876
|
+
source: message.content?.source,
|
|
8877
|
+
roomId: message.roomId,
|
|
8878
|
+
entityId: message.entityId
|
|
8879
|
+
});
|
|
8859
8880
|
const text = message.content?.text?.trim();
|
|
8860
8881
|
if (!text || text.length === 0) {
|
|
8861
8882
|
logger9.error("No text content for tweet");
|
|
8883
|
+
logger9.debug("Stack trace:", new Error().stack);
|
|
8862
8884
|
return false;
|
|
8863
8885
|
}
|
|
8864
8886
|
if (text.length > 280) {
|