A Python-based X (Twitter) bot powered by Google Gemini 3 (Flash Preview).
- AI-Powered: Generates creative and context-aware posts using Gemini 3.
- Automated: Runs on a loop, posting at configurable intervals (default: 12 hours).
- Clean Output: Automatically strips markdown and hashtags for a professional look on X.
- Easy Configuration: Manage API keys and prompts via external files.
-
Clone the repository:
git clone https://github.com/Hamza1s34/xbot.git cd xbot -
Install dependencies:
pip install -r requirements.txt
-
Configure APIs: Create or update
apis.txtwith your credentials:Gemini: YOUR_GEMINI_API_KEY Api_key: YOUR_X_API_KEY Api_key_secret: YOUR_X_API_KEY_SECRET Bearer_token: YOUR_X_BEARER_TOKEN Access_token: YOUR_X_ACCESS_TOKEN Access_token_secret: YOUR_X_ACCESS_TOKEN_SECRET Gemini_Model: gemini-3-flash-preview -
Run the bot:
python x_bot.py
x_bot.py: The main bot script.apis.txt: API credentials (private).context.txt: Information about the project for the AI to use.prompts: Themes and scenarios for post generation.requirements.txt: Python package dependencies.
MIT