working on private message
This commit is contained in:
parent
7efb61a9df
commit
b0a924da27
@ -1,4 +1,4 @@
|
|||||||
server="card.freenode.net"
|
server="irc.tripadvisor.com"
|
||||||
channel="tahackers"
|
channel="interns"
|
||||||
nick="elizabot"
|
nick="oontvoo_bot"
|
||||||
user="elizabot elizabot elizabot : elizabot"
|
user="oontvoo_bot oontvoo_bot oontvoo_bot : oontvoo_bot"
|
||||||
|
Binary file not shown.
@ -1,6 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
|
|
||||||
arg1=$1 # sender (the person I am talking to)
|
arg1=$1 # sender (the person I am talking to)
|
||||||
arg2=$2 # unclear????
|
arg2=$2 # unclear????
|
||||||
|
|
||||||
@ -9,6 +8,12 @@ if [ ! -d "$user_dir" ]; then
|
|||||||
mkdir $user_dir
|
mkdir $user_dir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if the user said goodbye and changed her mind!
|
||||||
|
if [ -f "$user_dir/GOODBYE" ]; then
|
||||||
|
echo "PRIVMSG $arg2 :$arg1: I thought you just said goodbye!"
|
||||||
|
rm $user_dir/GOODBYE
|
||||||
|
fi
|
||||||
|
|
||||||
shift 2 # 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 eliza_bot/eliza_java.jar > $user_dir/output
|
cat $user_dir/input | java -jar eliza_bot/eliza_java.jar > $user_dir/output
|
||||||
@ -20,4 +25,10 @@ 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
|
||||||
|
stamp="`date +%s`"
|
||||||
|
mv $user_dir/input $user_dir/"input_$stamp"
|
||||||
|
mv $user_dir/output $user_dir/"output_$stamp"
|
||||||
|
# leave good-bye flag (indicating the user already said goodbye)
|
||||||
|
touch $user_dir/GOODBYE
|
||||||
fi
|
fi
|
Loading…
x
Reference in New Issue
Block a user