Updated .env and readme to include new env vars.

This commit is contained in:
2025-10-03 16:53:58 -07:00
parent ba9ca333d4
commit 5dfb6658d6
2 changed files with 12 additions and 5 deletions

View File

@@ -2,14 +2,19 @@
TG_API_ID=123456
TG_API_HASH=your_api_hash_here
# Telethon session file name (will create files with this prefix)
# Telethon session file prefix (actual file will be <prefix>.session)
# In Docker/K8s you can set this to /data/telethon_session to persist it.
TG_SESSION=telethon_session
# Target user — choose ONE of these (leave the other blank/zero)
# If they have a public username, set it WITHOUT the leading @
# Target selection — choose ONE of these (leave others blank/zero)
# 1) Public username WITHOUT the leading @
TARGET_USERNAME=
# If no username, use their numeric Telegram user ID
# 2) Numeric Telegram user ID (if they have no username)
TARGET_USER_ID=0
# 3) Display name the person set for themselves (case-insensitive; exact or partial match)
TARGET_DISPLAY_NAME=
# Cache file where the resolved numeric ID will be stored for future runs
TARGET_CACHE_FILE=target_id.txt
# OpenAI configuration
OPENAI_API_KEY=your_openai_api_key_here

4
README
View File

@@ -15,6 +15,8 @@ Telethon + OpenAI bot that engages unsolicited DMs with safe, time-wasting small
| TG_SESSION | no | telethon_session | Session file prefix used by Telethon |
| TARGET_USERNAME | no | — | Target's public username (without @). Leave empty if using TARGET_USER_ID |
| TARGET_USER_ID | no | 0 | Target's numeric Telegram user ID (use if no username) |
| TARGET_DISPLAY_NAME | no | — | Persons display name (case-insensitive; exact or partial match across dialogs) |
| TARGET_CACHE_FILE | no | target_id.txt | Path to store resolved numeric ID for future runs |
| OPENAI_API_KEY | yes | — | OpenAI API key |
| OPENAI_MODEL | no | gpt-4o-mini | Chat-capable model used for replies |
| MIN_DELAY_SEC | no | 25 | Minimum delay (seconds) before each reply |
@@ -25,7 +27,7 @@ Telethon + OpenAI bot that engages unsolicited DMs with safe, time-wasting small
| PYTHONUNBUFFERED | no | 1 | If set, forces unbuffered output in some environments |
Notes:
- Set either TARGET_USERNAME or TARGET_USER_ID. If neither is set, the first inbound DM will become the target automatically.
- Set one of TARGET_USERNAME, TARGET_USER_ID, or TARGET_DISPLAY_NAME. If none are set, the first inbound DM will become the target automatically.
- Increase delays if you hit Telegram flood limits.
## License