mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-01-01 06:11:46 +00:00
remove stats command
This commit is contained in:
parent
0bda9d9feb
commit
874e37e408
44
bashbot.sh
44
bashbot.sh
@ -11,7 +11,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v1.21-dev-0-g2e878fd
|
#### $$VERSION$$ v1.21-dev-4-g0bda9d9
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 success (hopefully)
|
# - 0 success (hopefully)
|
||||||
@ -1253,45 +1253,15 @@ if [ -z "${SOURCE}" ]; then
|
|||||||
debug_checks "end init" "$@"
|
debug_checks "end init" "$@"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
# print usage stats
|
# stats deprecated
|
||||||
"stats")
|
"stats"|"count")
|
||||||
echo -e "${ORANGE}stats deprecated, see bin/bashbot_stats --help${NC}"
|
printf "${ORANGE}Stats is a separate command now, see bin/bashbot_stats.sh --help${NN}"
|
||||||
ME="$(getConfigKey "botname")"
|
"${BASHBOT_HOME:-.}"/bin/bashbot_stats.sh --help
|
||||||
declare -A STATS
|
|
||||||
jssh_readDB_async "STATS" "${COUNTFILE}"
|
|
||||||
for MSG in ${!STATS[*]}
|
|
||||||
do
|
|
||||||
[[ ! "${MSG}" =~ ^[0-9-]*$ ]] && continue
|
|
||||||
(( USERS++ ))
|
|
||||||
done
|
|
||||||
for MSG in ${STATS[*]}
|
|
||||||
do
|
|
||||||
(( MESSAGES+=MSG ))
|
|
||||||
done
|
|
||||||
if [ "${USERS}" != "" ]; then
|
|
||||||
echo "A total of ${MESSAGES} messages from ${USERS} users are processed."
|
|
||||||
else
|
|
||||||
echo "No one used your bot so far ..."
|
|
||||||
fi
|
|
||||||
jssh_readDB_async "STATS" "${BLOCKEDFILE}"
|
|
||||||
for MSG in ${!STATS[*]}
|
|
||||||
do
|
|
||||||
[[ ! "${MSG}" =~ ^[0-9-]*$ ]] && continue
|
|
||||||
(( BLOCKS++ ))
|
|
||||||
done
|
|
||||||
if [ "${BLOCKS}" != "" ]; then
|
|
||||||
echo -e "Note: ${BLOCKS} users are blocked by your bot:${GREY}"
|
|
||||||
sort -r "${BLOCKEDFILE}.jssh"
|
|
||||||
echo -e "${NC}\c"
|
|
||||||
fi
|
|
||||||
# show user created bot stats
|
|
||||||
_exec_if_function my_bashbot_stats "$@"
|
|
||||||
debug_checks "end $1" "$@"
|
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
# send message to all users
|
# broadcast deprecated
|
||||||
'broadcast')
|
'broadcast')
|
||||||
printf "${ORANGE}Broadcast is a separate command now, see ${BASHBOT_HOME:-.}/bin/send_broadcast.sh --help${NN}"
|
printf "${ORANGE}Broadcast is a separate command now, see bin/send_broadcast.sh --help${NN}"
|
||||||
"${BASHBOT_HOME:-.}"/bin/send_broadcast.sh --help
|
"${BASHBOT_HOME:-.}"/bin/send_broadcast.sh --help
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user