Skip to content

Commit

Permalink
Update message.py : Fix Corona Checking Function - Removed Recovered …
Browse files Browse the repository at this point in the history
…Value
  • Loading branch information
yymin1022 committed Mar 22, 2022
1 parent de137cb commit ad16474
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions message.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def messageCorona():
dataCritical = jsonData["confirmedCritical"]
dataDeceased = jsonData["deceased"]
dataHospitalised = jsonData["hospitalised"]
dataRecovered = jsonData["recovered"]

strConfirmed = f"확진자 : {format(dataConfirmed[1], ',')}명 (누적 {format(dataConfirmed[0], ',')}명)"
strCritical = f"위중증 : {format(dataCritical[0], ',')}명 "
Expand All @@ -205,12 +204,6 @@ def messageCorona():
else:
strHospitalised += f"(+{format(dataHospitalised[1], ',')})"

strRecovered = f"완치자 : {format(dataRecovered[0], ',')}명 "
if int(dataRecovered[1]) < 0:
strRecovered += f"(-{format(int(dataRecovered[1]) * -1, ',')})"
else:
strRecovered += f"(+{format(dataRecovered[1], ',')})"

url = f"https://apiv3.corona-live.com/domestic/live.json?timestamp={curTimestamp}"
response = requests.get(url)
jsonData = json.loads(response.content)["live"]
Expand All @@ -221,7 +214,7 @@ def messageCorona():
strConfirmedLive = f"실시간 : {format(dataConfirmedLive, ',')}명"
strConfirmedLiveYesterday = f"어제 동시간대 : {format(dataConfirmedLiveYesterday, ',')}명"

strMessage = f"{curDate} 코로나19 현황\n{strConfirmedLive}\n{strConfirmedLiveYesterday}\n\n어제까지\n{strConfirmed}\n{strCritical}\n{strHospitalised}\n{strRecovered}\n{strDeceased}"
strMessage = f"{curDate} 코로나19 현황\n{strConfirmedLive}\n{strConfirmedLiveYesterday}\n\n어제까지\n{strConfirmed}\n{strCritical}\n{strHospitalised}\n{strDeceased}"

return strMessage

Expand Down

0 comments on commit ad16474

Please sign in to comment.