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,15 +101,17 @@ 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
|
else
|
||||||
|
./modules/say/say.sh "$who" "$from" "$who: $(shuf -n1 "response/error.txt")"
|
||||||
|
fi
|
||||||
|
else
|
||||||
set -f
|
set -f
|
||||||
./triggers/keywords/keywords.sh "$who" "$from" "$result"
|
./triggers/keywords/keywords.sh "$who" "$from" "$result"
|
||||||
set +f
|
set +f
|
||||||
|
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