More code cleanup, including removing lines of code that as far as I can tell did absolutely nothing. Watch for breakage.

This commit is contained in:
Storm Dragon 2020-08-13 21:00:57 -04:00
parent 5984a2dbb2
commit c6a8d0ce12

25
bot.sh
View File

@ -114,31 +114,6 @@ tail -f "$input" | telnet "$server" "$port" | while read -r result ; do
./triggers/keywords/keywords.sh "$who" "$from" "$result"
set +f
fi
# "#" would mean it's a channel
if [ "$(echo "$from" | grep '#')" ]; then
[[ "$(echo "$result" | grep ":$nick:")" ]] || continue
will="${result#*#*:}"
will="${will#*:}"
else
will="${result:1}"
will="${will#* :}"
from="$who"
fi
# Had to turn on globbing to remove all leading whitespace, then turn it off again afterwards.
shopt -s extglob
will="${will##*( )}"
shopt -u extglob
command="${will%% *}"
will="${will#* }"
if [ -z "$(ls modules/ | grep -i -- "$command")" ] || [ -z "$command" ]; then
set -f
./modules/help/help.sh "$who" "$from"
set +f
continue
fi
set -f
./modules/$command/$command.sh "$who" "$from" $will
set +f
;;
*)
echo "$result" >> "$log"