Update /cv command

This commit is contained in:
Michael De Roover 2021-02-26 14:54:52 +01:00
parent 4a4cc233bb
commit 80bb3deceb
Signed by: vim
GPG Key ID: 075496E232CE04CB

View File

@ -94,9 +94,15 @@ cv(){
fi
if [ ! -z ${cv[1]} ]
then
pct=$(echo "scale = 2; ${cv[14]} / 10000" | bc)
sendmsg "Today's COVID-19 cases for ${cv[1]}: ${cv[4]} \($pct% of the population tested\). Stay safe!
pct(){ bc <<< "scale = 2; $1 / 10000"; }
sendmsg "*Today's COVID-19 stats for ${cv[1]}:*
Cases: ${cv[4]}
Active: ${cv[9]}
Total: ${cv[3]} \($(pct ${cv[11]})%\)
Tests: ${cv[13]} \($(pct ${cv[14]})%\)
Queried at $(date +'%Y-%m-%d %H:%M %Z').
Stay safe and get yourself vaccinated!
$updated"
else
sendmsg "This country doesn't have any stats!"