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//# /}"
|
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
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