Last active
March 23, 2020 10:48
-
-
Save Jatin-8898/976339faf28b4adc1dd9d381984deff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if 'A' in incoming_msg: | |
# return total cases | |
r = requests.get('https://coronavirus-19-api.herokuapp.com/all') | |
if r.status_code == 200: | |
data = r.json() | |
text = f'_Covid-19 Cases Worldwide_ \n\nConfirmed Cases : *{data["cases"]}* \n\nDeaths : *{data["deaths"]}* \n\nRecovered : *{data["recovered"]}* \n\n 👉 Type *B* to check cases in *India* \n 👉 Type *B, C, D, E, F, G* to see other options \n 👉 Type *Menu* to view the Main Menu' | |
print(text) | |
else: | |
text = 'I could not retrieve the results at this time, sorry.' | |
msg.body(text) | |
responded = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment