fixed talk errors
This commit is contained in:
parent
509a51f967
commit
9ac2cf758c
4
bot.sh
4
bot.sh
@ -40,7 +40,9 @@ do
|
|||||||
will=$(echo "$res" | perl -pe "s/.*$nick :(.*)/\1/")
|
will=$(echo "$res" | perl -pe "s/.*$nick :(.*)/\1/")
|
||||||
from=$who
|
from=$who
|
||||||
fi
|
fi
|
||||||
com=$(echo "$will" | cut -d " " -f 2)
|
will=$(echo "$will" | perl -pe "s/^ //")
|
||||||
|
com=$(echo "$will" | cut -d " " -f1)
|
||||||
|
echo "COM:$com"
|
||||||
if [ -z "$(ls modules/ | grep -i -- "$com.sh")" ]
|
if [ -z "$(ls modules/ | grep -i -- "$com.sh")" ]
|
||||||
then
|
then
|
||||||
./modules/help.sh $who $from >> $input
|
./modules/help.sh $who $from >> $input
|
||||||
|
@ -17,7 +17,7 @@ if [ -f "$user_dir/GOODBYE" ]; then
|
|||||||
rm $user_dir/GOODBYE
|
rm $user_dir/GOODBYE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
shift 3 # chop off the first two args
|
shift 2 # chop off the first two args
|
||||||
echo "$@" >> $user_dir/input
|
echo "$@" >> $user_dir/input
|
||||||
cat $user_dir/input | java -jar modules/talk/talk_bot.jar > $user_dir/output
|
cat $user_dir/input | java -jar modules/talk/talk_bot.jar > $user_dir/output
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ retcode="${PIPESTATUS[1]}"
|
|||||||
|
|
||||||
echo "PRIVMSG $arg2 :$arg1: `tail -n 1 $user_dir/output`"
|
echo "PRIVMSG $arg2 :$arg1: `tail -n 1 $user_dir/output`"
|
||||||
|
|
||||||
if [ $retcode -eq "1" ]; then
|
if [ "$retcode" -eq "1" ]; then
|
||||||
echo "PRIVMSG $arg2 :$arg1: That was a joke! It's free to talk to me. But we do accept donations! ;D"
|
echo "PRIVMSG $arg2 :$arg1: That was a joke! It's free to talk to me. But we do accept donations! ;D"
|
||||||
# clean up old conversations
|
# clean up old conversations
|
||||||
stamp="`date +%s`"
|
stamp="`date +%s`"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user