Add log chat to Konata
This commit is contained in:
@@ -8,6 +8,8 @@ apk add lighttpd curl jq bash youtube-dl ffmpeg
|
|||||||
read -p "Please enter your bot token: " token
|
read -p "Please enter your bot token: " token
|
||||||
read -p "Please enter the bot's username (without @): " bot
|
read -p "Please enter the bot's username (without @): " bot
|
||||||
read -p "Please enter the domain for your bot: " domain
|
read -p "Please enter the domain for your bot: " domain
|
||||||
|
read -p "Do you want to use a log chat? (y/n): " logans
|
||||||
|
[ ! -z $logans ] && read -p "What's the log chat's chat ID? " logchat
|
||||||
|
|
||||||
if [ -f /etc/konata.conf ]
|
if [ -f /etc/konata.conf ]
|
||||||
then
|
then
|
||||||
@@ -22,6 +24,7 @@ then
|
|||||||
else
|
else
|
||||||
echo "token=$token" >> /etc/konata.conf
|
echo "token=$token" >> /etc/konata.conf
|
||||||
echo "bot=$bot" >> /etc/konata.conf
|
echo "bot=$bot" >> /etc/konata.conf
|
||||||
|
[ ! -z $logchat ] && echo "logchat=$logchat" >> /etc/konata.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing application files..."
|
echo "Installing application files..."
|
||||||
|
@@ -74,9 +74,11 @@ cv(){
|
|||||||
stats=$(curl -s "https://corona.lmao.ninja/v2/countries/$args")
|
stats=$(curl -s "https://corona.lmao.ninja/v2/countries/$args")
|
||||||
country=$(jq -r '.country' <<< $stats)
|
country=$(jq -r '.country' <<< $stats)
|
||||||
cases=$(jq -r '.todayCases' <<< $stats)
|
cases=$(jq -r '.todayCases' <<< $stats)
|
||||||
|
pm=$(jq -r '.testsPerOneMillion' <<< $stats)
|
||||||
|
pct=$(echo "scale = 2; $pm / 10000" | bc)
|
||||||
if jq -re '.country' <<< $stats
|
if jq -re '.country' <<< $stats
|
||||||
then
|
then
|
||||||
sendmsg "Today's COVID-19 cases for $country: $cases. Stay safe!"
|
sendmsg "Today's COVID-19 cases for $country: $cases \($pct% of the population tested\). Stay safe!"
|
||||||
else
|
else
|
||||||
sendmsg "This country doesn't have any stats!"
|
sendmsg "This country doesn't have any stats!"
|
||||||
fi
|
fi
|
||||||
@@ -168,6 +170,9 @@ anyone(){
|
|||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
tag(){
|
tag(){
|
||||||
sendmsg "Please stand by, he'll get to your message soon™️..."
|
sendmsg "Please stand by, he'll get to your message soon™️..."
|
||||||
|
local chat=$logchat
|
||||||
|
local atchat=$(sed "s/@//" <<< $chat)
|
||||||
|
sendmsg "Youv'e been tagged in [$atchat](tg://resolve?domain=$atchat): $msg"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Match incoming messages
|
# Match incoming messages
|
||||||
|
Reference in New Issue
Block a user