Skip to content

Latest commit

Β 

History

History
61 lines (43 loc) Β· 1.95 KB

File metadata and controls

61 lines (43 loc) Β· 1.95 KB

Testing the Twitter Integration

Summary

The Twitter/X integration has been successfully implemented and built! Here's what you need to know:

βœ… Build Status

The project builds successfully with no compilation errors.

πŸ”§ Configuration Required

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

πŸ§ͺ Testing in Development Mode

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

πŸ“ Tweet Format

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)!

πŸš€ How It Works

  1. Sales Detection: The bot checks for new sales every minute (configurable)
  2. Discord Post: Posts the sale to configured Discord channels (existing functionality)
  3. Twitter Post: Also posts the same sale to Twitter/X (new functionality)
  4. Duplicate Prevention: Uses Redis caching to prevent posting the same sale twice

πŸ” What to Look For in Logs

When running, you should see:

  • Running Sales Checker Job - The cron job is checking for sales
  • Posting sale to Twitter: [cacheKey] - A sale is being posted to Twitter
  • [DEV MODE] Would tweet: [message] - Development mode showing what would be tweeted
  • Successfully tweeted: [id] - [message] - Production mode successful post

🎯 Next Steps

  1. Ensure all required environment variables are set
  2. Run the application: yarn start:dev or yarn start:prod
  3. Monitor the logs to see sales being posted
  4. Check your Twitter account for the posted tweets (in production mode)

The integration is complete and ready to use!