@elizaos/plugin-twitter 1.2.15 → 1.2.16
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/README.md +27 -1
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -304,7 +304,33 @@ TWITTER_ENABLE_POST=true
|
|
|
304
304
|
TWITTER_POST_IMMEDIATELY=true
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
-
##
|
|
307
|
+
## 🚨 Troubleshooting
|
|
308
|
+
|
|
309
|
+
### 403 Errors When Engaging with Tweets
|
|
310
|
+
|
|
311
|
+
If you see errors like "Failed to create tweet: Request failed with code 403", this usually means:
|
|
312
|
+
|
|
313
|
+
1. **Missing Write Permissions**: Make sure your Twitter app has "Read and write" permissions
|
|
314
|
+
- Go to your app settings in the Twitter Developer Portal
|
|
315
|
+
- Check that App permissions shows "Read and write" ✅
|
|
316
|
+
- If not, change it and regenerate your Access Token & Secret
|
|
317
|
+
|
|
318
|
+
2. **Protected Accounts**: The bot may be trying to engage with protected/private accounts
|
|
319
|
+
- The plugin now automatically skips these with a warning
|
|
320
|
+
|
|
321
|
+
3. **Self-Engagement**: Trying to reply to or quote your own tweets
|
|
322
|
+
- Twitter API doesn't allow this and returns 403
|
|
323
|
+
|
|
324
|
+
4. **Account Restrictions**: Your account may have restrictions
|
|
325
|
+
- Check if your account is in good standing
|
|
326
|
+
- Ensure you're not violating Twitter's automation rules
|
|
327
|
+
|
|
328
|
+
The plugin will now:
|
|
329
|
+
- Automatically detect and skip 403 errors with a warning
|
|
330
|
+
- Continue processing other tweets
|
|
331
|
+
- Mark failed tweets as "skip" to avoid retrying
|
|
332
|
+
|
|
333
|
+
### Other Common Issues
|
|
308
334
|
|
|
309
335
|
### "403 Forbidden" When Posting
|
|
310
336
|
|
package/dist/index.js
CHANGED
|
@@ -8062,6 +8062,13 @@ var TwitterDiscoveryClient = class {
|
|
|
8062
8062
|
// Remove the discoverFromTrends method since API v2 doesn't support it
|
|
8063
8063
|
// Remove the isTrendRelevant method since we're not using trends
|
|
8064
8064
|
scoreTweet(tweet, source) {
|
|
8065
|
+
if (tweet.isRetweet) {
|
|
8066
|
+
return {
|
|
8067
|
+
tweet,
|
|
8068
|
+
relevanceScore: 0,
|
|
8069
|
+
engagementType: "skip"
|
|
8070
|
+
};
|
|
8071
|
+
}
|
|
8065
8072
|
let relevanceScore = 0;
|
|
8066
8073
|
const sourceScores = {
|
|
8067
8074
|
topic: 0.4,
|
|
@@ -8225,10 +8232,25 @@ var TwitterDiscoveryClient = class {
|
|
|
8225
8232
|
engagementCount++;
|
|
8226
8233
|
await this.delay(3e3 + Math.random() * 5e3);
|
|
8227
8234
|
} catch (error) {
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8235
|
+
if (error?.message?.includes("403")) {
|
|
8236
|
+
logger7.warn(
|
|
8237
|
+
`Permission denied (403) for tweet ${scoredTweet.tweet.id}. This might be a protected account or restricted tweet. Skipping.`
|
|
8238
|
+
);
|
|
8239
|
+
await this.saveEngagementMemory(
|
|
8240
|
+
scoredTweet.tweet,
|
|
8241
|
+
"skip"
|
|
8242
|
+
);
|
|
8243
|
+
} else if (error?.message?.includes("429")) {
|
|
8244
|
+
logger7.warn(
|
|
8245
|
+
`Rate limit (429) hit while engaging with tweet ${scoredTweet.tweet.id}. Pausing engagement cycle.`
|
|
8246
|
+
);
|
|
8247
|
+
break;
|
|
8248
|
+
} else {
|
|
8249
|
+
logger7.error(
|
|
8250
|
+
`Failed to engage with tweet ${scoredTweet.tweet.id}:`,
|
|
8251
|
+
error
|
|
8252
|
+
);
|
|
8253
|
+
}
|
|
8232
8254
|
}
|
|
8233
8255
|
}
|
|
8234
8256
|
return engagementCount;
|