Daily aphorisms posted to a Telegram group.
pip install -r requirements.txt
- Open Telegram, talk to @BotFather
- Send
/newbotand follow the prompts - Copy the API token into
config.json->bot_token(already pre-filled if you gave it to Claude Code)
Add your bot to the target group, then send a message in the group. Run this once to find the chat ID:
python -c "import urllib.request,json; r=urllib.request.urlopen('https://api.telegram.org/bot<TOKEN>/getUpdates'); print(json.dumps(json.load(r), indent=2))"Look for "id" inside "chat" in the output.
Paste that negative number as the chat_id in config.json.
{
"bot_token": "000:AB123...",
"chat_id": "-000...",
"post_hour": 8,
"post_minute": 0,
"timezone": "America/Los_Angeles",
"enabled_authors": [],
"anthropic_api_key": "sk-ant-...",
"request_model": "claude-haiku-4-5"
}post_hour/post_minute: when to post each day (24-hour clock)timezone: any pytz timezone string (e.g.UTC,America/New_York)enabled_authors: list of author names to include, e.g.["Oscar Wilde", "Nietzsche"]. Leave as[]to include all authors.anthropic_api_key: your Anthropic API key — required only for the/requestcommand.request_model: Claude model used by/request(default:claude-haiku-4-5).
python aphorism_bot.pyKeep it running (e.g. with screen, tmux, or a system service) so the daily job fires.
| Command | Description |
|---|---|
/aphorism |
Get a random quote immediately |
/authors |
List all authors and quote counts |
/request <author> |
Look up and add quotes from an author via Claude AI |
/help |
Show help |
Via bot command (easiest):
/request Mary Shelley
The bot calls Claude AI to fetch 10 new quotes and appends them to quotes.json.
Running /request again for the same author fetches additional quotes.
Manually: open quotes.json and append new entries following the schema:
{
"id": 116,
"author": "Author Name",
"text": "The quote text goes here.",
"source": "Title of Work"
}source can be null if unknown. The bot tracks used quote IDs in used_quotes.json
so it cycles through the full pool before repeating.
| Region | Timezone string |
|---|---|
| UTC | UTC |
| US Eastern | America/New_York |
| US Central | America/Chicago |
| US Mountain | America/Denver |
| US Pacific | America/Los_Angeles |
| London | Europe/London |
| Paris / Berlin | Europe/Paris |
| Moscow | Europe/Moscow |
| Tokyo | Asia/Tokyo |
| Sydney | Australia/Sydney |