Fixed wildcard expansion bug.
This commit is contained in:
parent
41c1e2ad43
commit
01b75635c3
24
bot.sh
24
bot.sh
@ -47,7 +47,9 @@ do
|
|||||||
fi
|
fi
|
||||||
echo "MODE #$channel +o $who" | tee -a "$input"
|
echo "MODE #$channel +o $who" | tee -a "$input"
|
||||||
if [ "${greet^^}" = "TRUE" ]; then
|
if [ "${greet^^}" = "TRUE" ]; then
|
||||||
./triggers/greet/greet.sh "$who" "$from"
|
set -f
|
||||||
|
./triggers/greet/greet.sh "$who" "$from"
|
||||||
|
set +f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
# run when someone leaves
|
# run when someone leaves
|
||||||
@ -60,7 +62,9 @@ do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [ "${leave^^}" = "TRUE" ]; then
|
if [ "${leave^^}" = "TRUE" ]; then
|
||||||
./triggers/bye/bye.sh "$who" "$from"
|
set -f
|
||||||
|
./triggers/bye/bye.sh "$who" "$from"
|
||||||
|
set +f
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
# run when a message is seen
|
# run when a message is seen
|
||||||
@ -83,9 +87,15 @@ do
|
|||||||
if [ -z "$(ls modules/ | grep -i -- "$command")" ] || [ -z "$command" ]; then
|
if [ -z "$(ls modules/ | grep -i -- "$command")" ] || [ -z "$command" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
./modules/${command% *}/${command% *}.sh "$who" "$from" $will
|
# Disable wildcards
|
||||||
|
set -f
|
||||||
|
./modules/${command% *}/${command% *}.sh "$who" "$from" $will
|
||||||
|
# Enable wildcards
|
||||||
|
set +f
|
||||||
else
|
else
|
||||||
|
set -f
|
||||||
./triggers/keywords/keywords.sh "$who" "$from" "$result"
|
./triggers/keywords/keywords.sh "$who" "$from" "$result"
|
||||||
|
set +f
|
||||||
fi
|
fi
|
||||||
# "#" would mean it's a channel
|
# "#" would mean it's a channel
|
||||||
if [ "$(echo "$from" | grep '#')" ]; then
|
if [ "$(echo "$from" | grep '#')" ]; then
|
||||||
@ -104,10 +114,14 @@ do
|
|||||||
command="${will%% *}"
|
command="${will%% *}"
|
||||||
will="${will#* }"
|
will="${will#* }"
|
||||||
if [ -z "$(ls modules/ | grep -i -- "$command")" ] || [ -z "$command" ]; then
|
if [ -z "$(ls modules/ | grep -i -- "$command")" ] || [ -z "$command" ]; then
|
||||||
./modules/help/help.sh "$who" "$from"
|
set -f
|
||||||
|
./modules/help/help.sh "$who" "$from"
|
||||||
|
set +f
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
./modules/$command/$command.sh "$who" "$from" $will
|
set -f
|
||||||
|
./modules/$command/$command.sh "$who" "$from" $will
|
||||||
|
set +f
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "$result" | tee -a "$log"
|
echo "$result" | tee -a "$log"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user