updated module handling. Now you can put custom error messages one perline in response/error.txt

This commit is contained in:
Storm Dragon 2020-08-12 20:47:32 -04:00
parent 75b0b6f0ef
commit bce9713590
2 changed files with 7 additions and 3 deletions

8
bot.sh
View File

@ -101,14 +101,16 @@ set +f
command="${command//# /}" command="${command//# /}"
will="${command#* }" will="${command#* }"
command="${command%% *}" command="${command%% *}"
if [ -z "$(ls modules/ | grep -i -- "$command")" ] || [ -z "$command" ]; then if command -v "./modules/${command% *}/${command% *}.sh" ; then
continue echo "Calling module ./modules/${command% *}/${command% *}/${command% *}.sh \"$who\" \"$from\" $will" >> "$log"
fi
# Disable wildcards # Disable wildcards
set -f set -f
./modules/${command% *}/${command% *}.sh "$who" "$from" $will ./modules/${command% *}/${command% *}.sh "$who" "$from" $will
# Enable wildcards # Enable wildcards
set +f set +f
else
./modules/say/say.sh "$who" "$from" "$who: $(shuf -n1 "response/error.txt")"
fi
else else
set -f set -f
./triggers/keywords/keywords.sh "$who" "$from" "$result" ./triggers/keywords/keywords.sh "$who" "$from" "$result"

2
response/error.txt Normal file
View File

@ -0,0 +1,2 @@
I don't understand
I'm not sure how to help you with that.