From 92203bceed492eaea270045c4fddde44a3062e4f Mon Sep 17 00:00:00 2001 From: dev-fatal Date: Sat, 11 Feb 2023 16:59:28 +0000 Subject: [PATCH] Added comments to message.py --- message.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/message.py b/message.py index d3b39cb..8ef03ff 100644 --- a/message.py +++ b/message.py @@ -3,9 +3,9 @@ def get_chat_id(token): url = f"https://api.telegram.org/bot{token}/getUpdates" - data = requests.get(url).json() + data = requests.get(url).json() # Try find chat that user sent to our bot try: - chat_id = data["result"][0]["message"]["chat"]["id"] + chat_id = data["result"][0]["message"]["chat"]["id"] # Retrieve chat id so we can reply except IndexError: return None return str(chat_id) @@ -14,4 +14,4 @@ def get_chat_id(token): def send_message(token, chat_id): message = "Your Solo Shuffle is ready." url = f"https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text={message}" - requests.get(url) + requests.get(url) # Send the message to the user