This is a Reddit bot that clarifies parent comments when a user replies with "!clearify".
DONATE > Buy Me A Slice 🍕
- Monitors the Reddit stream for new comments containing "!clearify"
- Checks if the comment has already been processed to avoid duplicate replies
- Extracts the parent comment that needs clarifying
- Calls the OpenAI API to generate a clarified version of the parent comment
- Replies to the original comment with the clarified text
- Saves the comment to mark it as processed
To use the bot:
- Reply to any comment with "!clearify"
- The bot will reply clarifying the parent comment
You can also add a modifier in the format @ [modifier] @
to customize the clarification:
!clearify @ 5 year old @
This will generate an explanation suitable for a 5 year old.
Some examples of modifiers:
- 5 year old - Explain Like I'm 5
- Stoner - Explain for a stereotypical stoner
- Grandma - Explain simply for your grandma
- Programmer - Explain using technical jargon
To run the bot yourself:
- Clone this repo
- Copy .env.example to .env and add your API keys
- Install requirements with
pip install -r requirements.txt
- Run
python clearify.py
You will need:
- Reddit API credentials
- OpenAI API key
You can customize the bot by editing:
FOOTER_TEMPLATE
- The footer appended to all repliesclearify()
- The OpenAI prompt and parametersmain()
- The subreddit(s) streamed and logic
- Only clarifies parent comments, not top level posts
- Only processes new comments, does not backfill
- Basic clarification, no other conversational abilities
Let me know if you need any clarification or have additional questions!