A Telegram bot to use Runware image generation API on mobile, built with Python and can be deployed on Fly.io. This project uses the python-telegram-bot library along with other dependencies to provide Telegram bot functionality.
- Python 3.11 or higher
- Docker
- Fly.io CLI (
flyctl) - A Telegram Bot Token (obtain from @BotFather)
- A runware.ai API key
-
Clone the repository:
git clone https://github.com/aVariengien/cuttlefish.git cd cuttlefish -
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
-
Set up your environment variables:
export TELEGRAM_BOT_TOKEN="your_bot_token_here" export RUNWARE_API_KEY="your_runware_api_key"
-
Run the bot locally:
python bot.py
-
Install the Fly.io CLI if you haven't already:
# For macOS brew install flyctl -
Login to Fly.io:
flyctl auth login
-
Launch your app (first time only):
flyctl launch
- Choose a unique app name
- Select a region close to your users
- Choose to deploy now
-
Set your secrets:
flyctl secrets set TELEGRAM_BOT_TOKEN="your_bot_token_here" flyctl secrets set RUNWARE_API_KEY="your_runware_api_key"
-
Deploy your application:
flyctl deploy
-
Monitor your application:
flyctl status flyctl logs
bot.py- Main bot application codeDockerfile- Container configurationfly.toml- Fly.io configurationrequirements.txt- Python dependencies
This project is licensed under the MIT License - see the LICENSE file for details.
