updated module handling. Now you can put custom error messages one perline in response/error.txt
This commit is contained in:
parent
75b0b6f0ef
commit
bce9713590
8
bot.sh
8
bot.sh
@ -101,14 +101,16 @@ 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"
|
||||
|
2
response/error.txt
Normal file
2
response/error.txt
Normal file
@ -0,0 +1,2 @@
|
||||
I don't understand
|
||||
I'm not sure how to help you with that.
|
Loading…
Reference in New Issue
Block a user