From e8337197ca97bd9eac46c926bc2470a8ed634c3b Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 8 Jun 2022 18:29:34 -0400 Subject: [PATCH] #35 filtering out demo shop from telegram --- __init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/__init__.py b/__init__.py index 7599617..577587e 100644 --- a/__init__.py +++ b/__init__.py @@ -119,11 +119,12 @@ def submit_new_site_build( token = app_config.get("TELEGRAM_TOKEN", None) chat_id = app_config.get("TELEGRAM_CHAT_ID", None) new_site_url = f"https://{subdomain}.{domain}" - task_queue.put( - lambda: requests.get( - f"https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text=NewShop%20{new_site_url}" # noqa + if subdomain != "demo": + task_queue.put( + lambda: requests.get( + f"https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text=NewShop%20{new_site_url}" # noqa + ) ) - ) except Exception as e: print(f"Telegram not sent: {e}")