Remove fdebug function

This commit is contained in:
2021-02-03 13:22:29 +01:00
parent c0cb2dc908
commit ca91cf2c0c

View File

@@ -53,16 +53,12 @@ sendpic(){
}
# Debugging commands
fdebug(){
debug "Entered function $1()."
}
debug(){
[ ! -z $debug ] && echo "[DEBUG] $1" >&2
}
# Public commands
help(){
fdebug "help"
sendmsg "Hiya! I'm [ghnou](https://t.me/ghnou)'s personal bot, Konata.
Currently I have the following features:
- /help - Show this help message.
@@ -81,12 +77,10 @@ help(){
}
alive(){
fdebug "alive"
sendmsg "Alive and well!"
}
cv(){
fdebug "cv"
stats=$(curl -s "https://corona.lmao.ninja/v2/countries/$args")
country=$(jq -r '.country' <<< $stats)
cases=$(jq -r '.todayCases' <<< $stats)
@@ -101,12 +95,10 @@ cv(){
}
id(){
fdebug "id"
sendmsg "Chat ID: $chat"
}
ud(){
fdebug "ud"
enc=$(echo "$args" | sed "s/\ /%20/g")
res=$(curl -s "https://api.urbandictionary.com/v0/define?term=$enc")
if jq -re '.list[0].definition' <<< $res
@@ -123,7 +115,6 @@ ud(){
}
konata(){
fdebug "konata"
data=$(curl -s "https://konachan.net/post.json?limit=1&page=1&tags=order:random%20izumi_konata")
jpeg=$(jq -r '.[0].jpeg_url' <<< $data)
file=$(jq -r '.[0].file_url' <<< $data)
@@ -136,14 +127,12 @@ konata(){
fi
}
repo(){
fdebug "repo"
sendmsg "You can find my source code [here](https://git.ghnou.su/ghnou/konata)."
}
# Administrative
mp3(){
admin
fdebug "mp3"
tmp="/tmp/mp3"
[ -d $tmp ] && mkdir $tmp
sendmsg "Downloading, this might take a while..."
@@ -160,7 +149,6 @@ mp3(){
stat(){
admin
fdebug "stat"
total=$(grep MemTotal /proc/meminfo | awk '{print $2}')
avail=$(grep MemAvailable /proc/meminfo | awk '{print $2}')
used=$(bc <<< "$total-$avail")
@@ -171,7 +159,6 @@ stat(){
term(){
admin
fdebug "term"
sendmsg "\`$(whoami)@${HOSTNAME}:${PWD}$\` \`$args\`
\`$(echo $args | bash - 2>&1)\`"
}