2018-08-23 21:05:42 +00:00
|
|
|
#!/usr/bin/env ash
|
|
|
|
|
|
|
|
. /home/zgrep/offtopiabday/happybot/common.sh
|
|
|
|
|
|
|
|
irc | while read -r n m; do
|
|
|
|
m="$(var "$m" | tr 'A-Z' 'a-z')"
|
|
|
|
if reg '^((happy|hate)bot[:,]? ?)(rm|destroy|boom|wipe) ?(the)? ?logs?$' "$m"; then
|
|
|
|
echo -n '' > '/home/zgrep/offtopiabday/irc.freenode.net/'"$chan"'/out'
|
|
|
|
echo 'Logs have been wiped.' | zwsp | say;
|
2018-08-23 21:25:43 +00:00
|
|
|
elif reg '^((happy|hate)bot[:,]? ?)(leave|part|die)$' "$m"; then
|
|
|
|
echo 'Bye bye.' | zwsp | say;
|
|
|
|
echo '/part '"$chan" > '/home/zgrep/offtopiabday/irc.freenode.net/in';
|
2018-08-23 21:05:42 +00:00
|
|
|
fi;
|
|
|
|
done;
|