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

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.