Skip to content

Commit

Permalink
Fix KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
drego85 committed Feb 9, 2024
1 parent d16cb2b commit ccc0993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tosint.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main():
response = requests.get(url)
telegram_get_chat = response.json().get("result")

print("Chat Title: " + str(telegram_get_chat["title"]))
if "title" in telegram_get_chat: print("Chat Title: " + str(telegram_get_chat["title"]))
print("Chat Type: " + str(telegram_get_chat["type"]))
print("Chat ID: " + str(telegram_get_chat["id"]))
print("Chat has Visible History: " + str(telegram_get_chat["has_visible_history"]))
Expand Down

0 comments on commit ccc0993

Please sign in to comment.