Skip to content

Instantly share code, notes, and snippets.

@Jatin-8898
Last active March 23, 2020 10:48
Show Gist options
  • Save Jatin-8898/976339faf28b4adc1dd9d381984deff3 to your computer and use it in GitHub Desktop.
Save Jatin-8898/976339faf28b4adc1dd9d381984deff3 to your computer and use it in GitHub Desktop.
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