This repository contains scripts to automate tweet generation and posting for cryptocurrency and AI developments, specifically targeting Bittensor subnets. The bot gathers recent messages from Discord channels, processes them, and generates snarky yet informative tweets.
- Automated Tweet Posting: Tweets are posted between 10 AM and 10 PM (Eastern Time) at hourly intervals.
- Tweet Generation: Uses Anthropic's Claude model to generate tweets from recent Discord messages.
- Filtering and Formatting: Ensures tweets stay under 280 characters, maintain accessibility, and follow predefined stylistic constraints.
- JSON-Based Storage: Keeps track of sent tweets to avoid duplicates.
- Python 3.9+
- Install repository:
pip install -e . - Set envars in
.envfile, see.env.example. - Collect discord data via the
discord_adapter.pyscript - Generate future tweets using the
summerizer_simple.pyscript. - Run the tweet poster script:
python tweet_bot.py --tweets path/to/tweets.json
- Adjust posting frequency by modifying
TWEET_FREQintweet_poster.py. - Modify tweet generation rules by tweaking
PROMPT_TEMPLATEingenerate_tweets.py. - Add more filtering logic in
generate_tweets_no_simsearch()if needed.
- Rate Limits: If hitting Twitter API rate limits, increase
TWEET_FREQor handle retries with backoff logic. - Anthropic API Issues: If tweet generation fails, check API usage limits or tweak parameters.
- Invalid Tweets: Ensure the Discord messages used for generation are valid and well-formatted.
Feel free to submit issues or pull requests to improve functionality.
MIT License.