Skip to content

Commit 87121b5

Browse files
committed
Confirm new subscribers in English
1 parent e98ea18 commit 87121b5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def fetch_html(url: str) -> Optional[str]:
127127

128128
def telegram_get_updates(offset: int) -> list[dict[str, Any]]:
129129
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/getUpdates"
130-
params = {"timeout": 0, "offset": offset}
130+
params = {"timeout": 0, "offset": offset, "allowed_updates": ["message"]}
131131
r = requests.get(url, params=params, timeout=REQUEST_TIMEOUT)
132132
r.raise_for_status()
133133
data = r.json()
@@ -169,6 +169,11 @@ def read_new_subscribers() -> int:
169169
"first_name": chat.get("first_name"),
170170
"last_name": chat.get("last_name"),
171171
}
172+
telegram_send_message(
173+
chat_id,
174+
"✅ Subscribed. You'll receive new posts when they're published.",
175+
disable_preview=True,
176+
)
172177
new_count += 1
173178

174179
state["subscribers"] = list(subscribers.values())

0 commit comments

Comments
 (0)