The Twitter/X integration has been successfully implemented and built! Here's what you need to know:
The project builds successfully with no compilation errors.
To run the bot with Twitter posting, you need to set these environment variables:
TWITTER_CONSUMER_KEY=your_api_key
TWITTER_CONSUMER_SECRET=your_api_secret
TWITTER_ACCESS_KEY=your_access_token
TWITTER_ACCESS_SECRET=your_access_token_secret
Set APP_ENVIRONMENT=development to run in development mode where:
- The bot will log what tweets would be sent without actually posting
- You can verify the format and functionality without using Twitter API quota
Sales will be posted in this format:
TOKEN_NAME (#ID) sold for PRICE ETH ($USD_PRICE USD)!
Example:
Wizard #1234 sold for 0.5 ETH ($925.50 USD)!
- Sales Detection: The bot checks for new sales every minute (configurable)
- Discord Post: Posts the sale to configured Discord channels (existing functionality)
- Twitter Post: Also posts the same sale to Twitter/X (new functionality)
- Duplicate Prevention: Uses Redis caching to prevent posting the same sale twice
When running, you should see:
Running Sales Checker Job- The cron job is checking for salesPosting sale to Twitter: [cacheKey]- A sale is being posted to Twitter[DEV MODE] Would tweet: [message]- Development mode showing what would be tweetedSuccessfully tweeted: [id] - [message]- Production mode successful post
- Ensure all required environment variables are set
- Run the application:
yarn start:devoryarn start:prod - Monitor the logs to see sales being posted
- Check your Twitter account for the posted tweets (in production mode)
The integration is complete and ready to use!