A Discord bot that generates and schedules tweet threads using OpenAI and Typefully.
- Generate tweet threads with GPT-4
- Automatic scheduling via Typefully
- Customizable parameters (keywords, mentions, deadline)
- Easy-to-use Discord slash commands
- Clone this repository
- Install dependencies:
pip install -r requirements.txt- Create a
.envfile with the following variables:
DISCORD_TOKEN=your_discord_bot_token
OPENAI_API_KEY=your_openai_api_key
TYPEFULLY_API_KEY=your_typefully_api_key
- Run the bot:
python main.pyUse the /create command with the following parameters:
main: Main topic/TLDRcontext: Additional context/requirementskeywords: Must-mention keywords (comma-separated)tag: X accounts to mention (comma-separated)length: Approximate number of tweets in thread
For production deployment:
- Set up a server (e.g., AWS EC2, DigitalOcean Droplet)
- Install Python 3.8+ and required dependencies
- Set up environment variables
- Use a process manager like PM2 or systemd to keep the bot running:
Example systemd service file (/etc/systemd/system/tweetbot.service):
[Unit]
Description=Tweet Scheduler Discord Bot
After=network.target
[Service]
Type=simple
User=your_user
WorkingDirectory=/path/to/bot
Environment=PYTHONUNBUFFERED=1
ExecStart=/usr/bin/python3 main.py
Restart=always
[Install]
WantedBy=multi-user.targetThen enable and start the service:
sudo systemctl enable tweetbot
sudo systemctl start tweetbot