DITTI is a Farcaster bot that serves as a cast line interface (CLI), offering a variety of functions to improve user experience on the Farcaster platform. The bot is written in Python and utilizes the Farcaster-py library, OpenAI GPT, Google Cloud Translate, and Text2Img.
- Python-based Farcaster bot
- Utilizes Farcaster-py, OpenAI GPT, Google Cloud Translate, and Text2Img
- Offers a range of commands for users to interact with
To use DITTI, simply mention the bot with the desired command:
@ditti <command>
@ditti thread
- Convert a thread of posts by the same author into an image.@ditti gpt <question>
- Create an instance of ChatGPT, subsequent replies do not require the command.ditti gpt* <question>
- Creates an instance of ChatGPT and provides and initially long-form response.@ditti gpt^
- Create an instance of ChatGPT using # of thread replies for context, default 1 (i.e.@ditti gpt^4
,@ditti gpt*^2
)@ditti translate
- Translate one cast or thread of foreign language casts by user into English.@ditti hash
- Reply to cast with this to get the hash of that cast.@ditti bookmark <title> --tag <name>
- Create a bookmark of a cast using a Title description and optional category tag.@ditti cut <title> --tag <name>
- Cuts an image from cast and saves it for gallery use with option title and tag.@ditti whois <username, ens, address>
- returns a whois for the requested user, ens, or wallet address.@ditti help
- Display all commands and information
**Requirements:** Python3, Poetry, Docker, Supabase CLI
-
In the project directory, create a local Supabase instance. This will create all the tables for you:
supabase start
-
Rename
.env.example
to.env
and configure your variables with the credentials generated from the previous step. YourSUPABASE_URL
will be the API URL from the terminal output. The Studio URL is not necessary, but you may want to use it to view your database tables:cp .env.example .env
-
In the project directory, ensure poetry is using python 3.10 with
poetry env use 3.10
, then runpoetry install
andpoetry run python ditti/core/main.py
-
Create an empty Supabase project and connect to the CLI:
supabase login
supabase link --project-ref <project-id>
-
Push your database schema:
supabase db push
-
In railway, set environment variables using your .env values, and set the start command to:
python -m venv /opt/venv && . /opt/venv/bin/activate && poetry run python ditti/core/main.py
- From the main folder, run
poetry run python -m pytest tests
. - For specific tests, run
poetry run python -m pytest tests/test_<module>.py
, for examplepoetry run python -m pytest tests/test_gpt.py
.
Before submitting a pull request, please ensure your code follows the project's style guidelines by running make codestyle
and passes lint checks with make lint
.
To enforce consistent code style, we use pyupgrade
, isort
, and black
. You can run the following command to automatically format your code:
make codestyle
We use flake8
and mypy
to perform linting and type checking. Run the following command to check your code for issues:
make lint
For more information and other useful tools, visit ditti.xyz or contact @ditti on farcaster.